Computing.Net > Forums > Unix > Doing sftp

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, 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,




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

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

cheers

Wollie



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

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

Thanks,
P



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

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

Thanks,
P



Response Number 4
Name: wollie
Date: May 22, 2009 at 01:18:45 Pacific
+1
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



Reply to Message Icon

Related Posts

See More


How to send mails from un... output to serial port


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Google Ads



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