Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to script file transfers between two servers. Local server is RHEL 5.x. Remote location uses two-factor authentication (key+password). Authenticates fine on the key-pair but I can't find syntax that would allow me to relay the password.

Command example that partialy works:

sftp -oIdentityFile=<path_to_ssh_key> <un>@<site>

SCP is apparently a possibility, but the remote location apparently doesn't have anyone who uses it so future support might be shallow.

Anything else I can try?

share|improve this question
    
Have you looked into expect before? You can basically set it up to watch for a specific return, and then send the password. Since it integrates well into scripts, you could store the password in an encrypted file and decrypt only when needed (using GPG) –  nerdwaller Jan 10 '13 at 20:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.