Can I automate a download of a file from a system using scp(by entering the user id/password) and manipulate the file and upload it to the same place. If you hav开发者_JAVA技巧e any idea of using scp in a shell script, pls do let me know
Thanks
Scp is ordinary command line uility in linux so it might be used directly. See this page for examples.
Yes you can automate that from a shell script pretty easily, but the question that remains is whether you want to input the password manually everytime you run the script or use ssh keys to accomplish authentication and achieve full automation.
Check this tutorial on using SCP.
use ssh-copy-id
[the command varies by distro, but on Ubuntu it is ssh-copy-id]. here's how:
ssh-copy-id ~/.ssh/id_rsa.pub me@mysite.com
this will install your public key to the remote host. it will not ask for your password if you do this!
If you have no ~/.ssh/id_rsa.pub, then run ssh-keygen
and accept all the default options [just press enter when it prompts for input].
精彩评论