You are currently viewing How To Change The Default SSH Port in CentOS

How To Change The Default SSH Port in CentOS

How To Change The Default SSH Port in CentOS, the default SSH port is 22 ,you can change the default SSH port , you can easily do it.you need to make a little change on sshd_config files. The default port number is 22  & now we are going to change it to 1155.
Step 1:  Open the SSH config file.

/etc/ssh/sshd_config

Add a New line with your New port. please see following the picture , I have added a  new line ( Port 1155 )  under the line , #port 22 . you can change port from 22 to any other. I have changed the port 22 to 1155.


#port 22
Port 1155

change ssh port

now save it ,  & now your  new port is 1155.

Step 2: Reload SSH Service

service sshd reload

reload sshd

Its done , you can verify the new port by this command :

netstat -tulpn | grep sshd

check ssh port

You should see two entries with the status of “LISTEN” With new port.

Note:  If you have firewall on server , Please ensure you update your firewall/iptables and ensure the new port is allowed for incoming connections.

Jobair Alam Bipul

I'm Jobair Alam, a cPanel Certified WHM/cPanel server administrator and web hosting expert with over 10 years of experience in the industry.

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

HostArmada - Affordable Cloud SSD Web Hosting