Tom's Guide | Tom's Hardware | Tom's Games | PC Safety Suite
![]() |
![]() |
![]() |
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,
+1 | ![]() |
Wollie Thanks for response. Will the same scipt work for sftp? Apart from using keygen, can I hardcode userid & passwd?
Thanks,
P
+1 | ![]() |
Wollie Thanks for response. Will the same scipt work for sftp? Apart from using keygen, can I hardcode userid & passwd?
Thanks,
P
+1 | ![]() |
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
![]() |
How to send mails from un...
|
output to serial port
|
| Login or Register to Reply | |
| Login | Register |