how to execute a scp command with the user name and password in one line

Mervyn picture Mervyn · Nov 19, 2012 · Viewed 112.8k times · Source

I would like to put the password in on one line when running scp in my terminal

scp [email protected]:sys_config /var/www/dev/

Answer

Mervyn picture Mervyn · Nov 19, 2012

Thanks for your feed back got it to work I used the sshpass tool.

sshpass -p 'password' scp [email protected]:sys_config /var/www/dev/