Argelbargel Argelbargel - 1 year ago 147
Linux Question

How to pass password to scp?

I know it is not recommended, but is it at all possible to pass the user's password to scp?

I'd like to copy a file via scp as part of a batch job and the receiving server does, of course, need a password and, no, I cannot easily change that to key-based authentication.

Answer Source

You can script it with a tool like expect (there are handy bindings too, like Pexpect for Python).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download