Skip to content

Use a non-default port with ssh-copy-id

Quote a “-p” flag specifying the port with the “user@machine” portion of the arguments; e.g. for port 2234:

ssh-copy-id -i ~/.ssh/id_rsa.pub '-p 2234 user@machine'

Hat tip to Mike Gerwitz for getting me looking in the right direction, although the solution described on his blog does not work with the version of ssh-copy-id I have. (Edit: Looks like the same solution that I arrived at was pointed out in the comments on the above blog post.)

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*