Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sshpass ssh-copy-id?

Tags:

ssh

sshpass

I dont want to keep typing the passwords again and again, hence want to provide it into the command itself. How can I do it?

Currently, I'm doing like this

sshpass -p server_password port_number ssh-copy-id user@IP

It says,

sshpass: Failed to run command: No such file or directory

Where am I going wrong? I found the net, and it was given the same.

like image 683
PythonEnthusiast Avatar asked Dec 05 '25 17:12

PythonEnthusiast


1 Answers

You must specify port_number like this:

sshpass -p server_password ssh-copy-id user@IP -p port_number
like image 184
Ghasem Pahlavan Avatar answered Dec 08 '25 07:12

Ghasem Pahlavan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!