scp without interative password

profesor發表於2024-10-01

using sshpass instead

sudo apt update

sudo apt install sshpass

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

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


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