Search code examples
sshsshpass

How to sshpass ssh-copy-id?


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.


Solution

  • You must specify port_number like this:

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