Configuring SSH to run on a nonstandard port
Use the following steps to force SSH to run on a nonstandard port.
-
Open
/etc/ssh/sshd_config
in a text editor. The following example is for vi editor.# vi /etc/ssh/sshd_config
-
Go to the following line:
# Port 22
-
Uncomment and edit this line to reflect the new port. You can set this port to any nonstandard port.
Port 2255
-
Save and quit the file, and restart SSH.
# /etc/init.d/sshd restart
-
If you are connected to the server by using SSH on port 22, you need to reconnect by using the new port.