Having SSH listen on more than one port on Red Hat Linux
The default port for SSH to listen on is port 22. Sometimes webmasters or system administrators need to have access on either complete different port or to have SSH to listen on two ports at the same time. The following steps explain how this can be done.
The file that holds the current SSH port settings can be found at:
Log on to your server via SSH and switch to the root user. Open this file in your favorite text editor and either change/remove the setting for port 22 or add the additional port setting in a new line. Example:
Save the file and then restart SSH:
service sshd restart
Now you need to verify that SSH is listening on the new port:
netstat -an | grep 435
It is highly recommended to use a port that is not in use by popular applications on the Internet. A random port number should be chosen for better security. If you are running a firewall on your server you will also need to adjust the firewall rules to allow the new port to be accessible from the Internet.
© 2006 – Web Hosting Resource Kit