-   Linux - Networking (
-   -   scp, don't prompt password!! (

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 ?


david_ross 01-03-2005 12:54 PM

I would suggest setting up public key authentication:

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 11:41 AM.