Skip to main content

ssh-copy-id using a different/custom port


Have you ever created your own cloud server and changed your ssh port from the default 22 to something else? And have you ever tried to use ssh-copy-id to copy your local ssh public key to the remote and it doesn't work?

The answer is simple. There are no parameters that you can provide for ssh-copy-id command. Instead do the following:

ssh-copy-id -i id_rsa.pub "user@domain.com -p 12345"
That's it. It should work without a problem. 

Comments

Featured

How to Get Color Prompts on your MacOS Terminal

Have you ever wondered that you would want colors to pop up on your terminal? I did and it made my life easier. It helped me to understand very quickly about the following:
Which folder im currently inWhich git branch my local workspace is inWhat terminal commands I have issued All you have to do is to use the following script in your ~/.bash_profile
Gist link: https://gist.github.com/gten/a6d261d32cea97e9a52b82f48989c07f


You will receive wonderful short stories written by him and inspirational articles once every month.