I need to perform SFTP automation (to get rid of the password prompt). How can I do this?
feedback
|
migrated from stackoverflow.com Jul 30 '09 at 19:51
This question came from our site for professional and enthusiast programmers.
|
You need to set up a public/private key. How can I automate an SFTP transfer between two servers? | |||
|
feedback
|
|
My suggestion is using SSH authorized_keys. You will need to create a key on the client side (using ssh-keygen) and then copy the public key to the target side.
Note that if you want to access target-machine from two or more "clients", you can not copy the id_rsa.pub to authorized_keys2 directly. You will need to open authorized_keys2 and paste the id_rsa.pub from each client machine on it (or use the line below to append the content)
Now you can use ssh/scp without user/password information:
| |||
|
feedback
|
|
If security is not a concern then the password can be in clear text in your script. E.g. on Microsoft Windows using pscp from the PuTTY package. Example:
Password: MyNotSoSecretPassWord. User name: kingOfTheHill. Host: www.pil.sdu.dk. The sftp server in our case runs on a Linux based server. | |||
|
feedback
|
|
Take a look at the VisualCron automation suite. It has built in automation for SFTP and SSH as well as normal FTP. http://www.visualcron.com | |||
|
feedback
|
