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


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/

This question is tagged with terminal command scp

~ Asked on 2012-11-19 10:32:35

The Best Answer is


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/

~ Answered on 2012-11-19 12:49:51


Using sshpass works best. To just include your password in scp use the ' ':

scp user1:'password' /var/www/dev/

~ Answered on 2013-11-26 15:45:49

Most Viewed Questions: