Posts Tagged ‘How change port of SSH’

How change port of SSH
To force ssh to run on a non standard port, use the following steps:

1. Open /etc/ssh/sshd_config in your favorite text editor:

# vi /etc/ssh/sshd_config

2. Browse to the following line:

# Port 22

3. Uncomment and edit this line to reflect the new port.

Port 2255 (this can be set to any non standard port)

4. Save and quit the file, and restart ssh.

# /etc/init.d/ssh restart

5. If you are connected to the server via ssh on port 22, your connection will drop and you will need to reconnect using the new port.

If you have apf installed, Please add the port in apf


nano /etc/apf/conf.apf

For tcp ports

# Common ingress (inbound) TCP ports