scp without interative password

using sshpass instead

 

sudo apt update

sudo apt install sshpass

 

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

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

 

参考:
https://stackoverflow.com/questions/50096/how-to-pass-password-to-scp

 

posted @ 2024-10-01 09:46  profesor  阅读(3)  评论(0编辑  收藏  举报