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