SSH config for non-standard ports

This is the coolest thing I have seen in a while. I frequently spend time on remote hosts via SSH, some, if not most, of which run sshd on a port other than 22. This resulted in me adding “-p 1234″ to every single ssh command I executed.

Well, no more. Today I stumbled upon SSH config. Just edit your ~/.ssh/config file and add the following to get rid of all those -p’s:

Host myserver.com
    Port 1234
Do that for all your frequently visited hosts, and you will have saved your fingers a lot of typing.

No related posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>