Thursday, November 05, 2009

Connecting to ssh servers running on non-standard ports

If you are running your ssh server on a port different than 21, for example 22, you can connect to the machine like this:

ssh mymachineip:22

or 

ssh mymachineip -p 22

However, there is an easier way:

Create the file  ~/.ssh/config, then fill it like this:

Host mymachineip

Port 22

Now you can just ssh to the machine: ssh mymachine

No comments: