Computing.Net > Forums > Unix > Doing sftp

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Doing sftp

Reply to Message Icon

Name: poornimajayan
Date: May 18, 2009 at 13:16:27 Pacific
OS: KSH
Subcategory: General
Comment:

Hi,
I am using sftp to connect to a remote machince (from my unix machine) and placing some files over there.I need to automate this process with a shell script.I am using KShell.
Currently I am connecting as sftp xxx01@sftp.yyy.com.Then it asks for password where I enter 123 and use "put" to place over there.
In one of the posts, I had seen to use a shell script as follows:
cd /a
ftp -n > ftp.log <<!
open ftp.xyz.com
user 123456 password
put filename
Since I do not have a username to enter, how can I modify the script? Also will this ftp command work for me?Please advise.
Thanks,



Sponsored Link
Ads by Google

Response Number 1
Name: wollie
Date: May 19, 2009 at 01:58:00 Pacific
Reply:

xxx01 on sftp.yyy.com IS your userid
So why worry?

cheers

Wollie


0

Response Number 2
Name: poornimajayan
Date: May 19, 2009 at 07:19:57 Pacific
Reply:

Wollie Thanks for response. Will the same scipt work for sftp? Apart from using keygen, can I hardcode userid & passwd?

Thanks,
P


0

Response Number 3
Name: poornimajayan
Date: May 19, 2009 at 14:13:28 Pacific
Reply:

Wollie Thanks for response. Will the same scipt work for sftp? Apart from using keygen, can I hardcode userid & passwd?

Thanks,
P


0

Response Number 4
Name: wollie
Date: May 22, 2009 at 01:18:45 Pacific
Reply:

there is no syntactical difference between ftp and sftp.
You can hardcode uid and pw, either with a .netrc - file or in a script. A script version would work like:
sftp user@server ......
or:
sftp
open server
user uid password ....
################
but hardcoding uid and password is a security issue (so why SECURE ftp?). If possible generate an rsa key and you don't have to provide uid and password.

cheers

wollie


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Doing sftp

sftp Korn shell script www.computing.net/answers/unix/sftp-korn-shell-script/4741.html

sftp command in Unix www.computing.net/answers/unix/sftp-command-in-unix/7526.html

Help: how do i search a file? www.computing.net/answers/unix/help-how-do-i-search-a-file/4660.html