Running SSHD on Multiple Ports (Without restarting service)


Running SSH on Standard port 22 on live critical servers is not a wise decision, You may get too many hack attempts on port 22.  To prevent those attacks we can change the default ssh port 22 to different port. It’s pretty easy to do on your Linux box.  On the server edit the file /etc/ssh/sshd_config

To stop SSH listening on Port 22 put # in front of 22 like and you want SSH should listen on 8081 and 2222. Add like below

#Port 22
Port 8081
Port 2222



Reload the service (note: this command will not restart the service just reload)
# /etc/init.d/sshd reload 
Or
#service sshd reload 

To log into a system that is running ssh on an unusual port, include the port number
in the ssh command like this:
# ssh -p 8081 user@your-ip or domain name.

e.g : # ssh –p 8081 tecgeeks@192.168.0.1

OR
# ssh -p 2222 rahul@tecgeeks.com



Running SSHD on Multiple Ports (Without restarting service) Running SSHD on Multiple Ports (Without restarting service) Reviewed by TecGeeks News on April 04, 2016 Rating: 5

No comments:

Get Your Business Online Now


Powered by Blogger.