LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh-copy-id not working as it should (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-copy-id-not-working-as-it-should-4175573233/)

james K mobley 02-25-2016 02:37 PM

ssh-copy-id not working as it should
 
Hi

I read the man page for ssh-copy-id and the -p port switch seems to not work.

Code:

ssh-copy-id -p 22025 -i .ssh/id_rsa.pub blah@192.168.0.55
I get this message from the shell:
usage: ssh-copy-id [-i identity_file] [user@]hostname

I tried again without the -p switch
Code:

ssh-copy-id -i .ssh/id_rsa.pub blah@192.168.0.55
and I get this error

Quote:

15
ssh: connect to host 192.168.0.55 port 22: Connection refused
Now try logging into the machine, with "ssh 'blah@192.168.0.55'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.
Anyway, it didn't work either.

Good news is I solved it by using scp to copy it over to the server and then doing a cat id.rsa.pub >> .ssh/authorized_keys

Has anyone had issues using ssh-copy-id in the past?

michaelk 02-25-2016 05:09 PM

Specifying a port other than 22 is not a published option in earlier versions of the utility. One way to do it is:

ssh-copy-id -i "user@server -p xxxx"


All times are GMT -5. The time now is 11:18 PM.