Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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/

like image 200
Mervyn Avatar asked Nov 19 '12 10:11

Mervyn


People also ask

How do I run a scp command in the background in Linux?

bg -> Send job to background. Show activity on this post. You can use jobs command to check the processes. For example jobs -l will list all running processes along with the process id.

Can I pass password in SSH command?

Combining the use of SSHPASS and SSH to access a remote server, router, or firewall gets rid of unnecessary two-liner commands that lead to an additional password entry prompt. It makes your remote access to other Linux environments faster and efficient.


1 Answers

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/

like image 155
Mervyn Avatar answered Sep 30 '22 18:09

Mervyn