6

How can I make ssh-copy-id use a port other than 22?

I tried it with -p but I get:

ssh-copy-id -p XXX [email protected]
Bad port 'umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys'

I know that the port is good because I'm connected to the server on that port.

4 Answers 4

12

I use this command, note the quotes:

ssh-copy-id -i ~/.ssh/id_dsa.pub "user@host -p 6842"
5

Set the port to use in ~/.ssh/config like the following:

Host secret-host.example.com
Port 2222
4

Try this:

ssh-copy-id "user@host -p 8888"
0
ssh-copy-id -i ~/.ssh/id_rsa.pub ‘-p 221 username@host’

From: Is it possible to run ssh-copy-id on port other than 22?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .