How to pass password to scp?

Use sshpass:

 

sshpass -p "password" scp -r user@example.com:/some/remote/path /some/local/path

 

or so the password does not show in the bash history

 

sshpass -f "/path/to/passwordfile" scp -r user@example.com:/some/remote/path /some/local/path

 

来源:https://stackoverflow.com/questions/50096/how-to-pass-password-to-scp

 

posted @ 2024-02-18 09:39  profesor  阅读(3)  评论(0编辑  收藏  举报