To do so all you have to do is add another Port #### line in the configuration file.
For example:
Usually you will have something like this in your sshd_config file:
Port 22
Lets say you want to "also" listen on port 8822, so you should add:
Port 8822
the end result, you will have two lines of Port #### which will look like this:
Port 22
Port 8822
I have added as many as 3 ports, I am not sure what is the limit of how many ports you can listen to for SSH simultaneously.
Then you simply need to restart the SSH daemon by executing:
service ssh restart
or
/etc/init.d/ssh restart
How to check to make sure it is working?
The easiest is just to try out if the new port is working. :-)
but you can also execute this statement in command line:
netstat -nap | grep ssh
You should see something like this:
tcp 0 0 0.0.0.0:58251 0.0.0.0:* LISTEN 7977/sshd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 7977/sshd
tcp6 0 0 :::58251 :::* LISTEN 7977/sshd
tcp6 0 0 :::22 :::* LISTEN 7977/sshd
The above output shows that server is listening for SSH on port 22 and 58251.
No comments:
Post a Comment