How to specify port when ssh to server

Last updated on October 21, 2015

Share

Need this kind of port today. The ssh 22 port was used on the firewall for another server. The admin publish the server using port 1234
According to man ssh:

 -p port 

Port to connect to on the remote host. This can be specified on
a per-host basis in the configuration file.

So you should be looking at:

ssh -p 1234 user@host

to connect to port 1234.