LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   scp, don't prompt password!! (http://www.linuxquestions.org/questions/linux-networking-3/scp-dont-prompt-password-273344/)

dlublink 01-03-2005 12:44 PM

scp, don't prompt password!!
 
scp somefile.ext username@remotehost.tld:/path/to/where/I/want/it

This obviously asks for my password. I do not want it to ask for my password, I want to put the password on the command line. So I tried:

echo "secret" | scp somefile.ext username@remotehost.tld:/path/to/where/I/want/it


That does not work.

How do I pass the command my password so I can put it in a script ?

Thanks,
David

david_ross 01-03-2005 12:54 PM

I would suggest setting up public key authentication:
http://www.linuxquestions.org/questi...ticle&artid=79

If you use lines like that in a script they will often be visible to any other user that lists the proccesses which are running. If you need to have the password in a script then use an expect script.


All times are GMT -5. The time now is 09:42 AM.