Changing the SSH Port for Your Linux Server

< 1 min read

You can change the default SSH port for your Linux server as an added security measure

NOTE! Make sure the new SSH port does not conflict with any known or blocked ports, and it is enable in your firewall !

See this for useful firewalld examples

See this for useful iptables examples

To Change the SSH Port for Your Linux Server:

Step 1

Connect to your server via SSH 

Step 2

Open /etc/ssh/sshd_config with your favorite text editor 

Step 3

Locate the following line:

# Port 22

Step 4

Remove # and change 22 to your desired port number and save the file. Please use port numbers higher then 1024

Port 31337

Step 5

Restart your SSH server

service sshd restart
sudo reload ssh

We want to hear your thoughts about this. Is there anything in particular that you love about it? What can we do to improve our services and experience? Leave a comment below or open a ticket on our helpdesk and we’ll personally review all suggestions and feedback. 

About Servercheap.NET

Since it was founded in 2015, Servercheap has always strived to provide its clients with enterprise-level performance at an unbeatable cost. Servercheap offers a wide range of customizable hybrid and virtual private server hosting services. All Servercheap clients enjoy a 99.9% uptime SLA and 24/7 rapid response support team.
At Servercheap, our core directive has always been to provide our clients with the best services and infrastructure possible, whether you’re hosting a game server, a high-intensity database, a development environment, or anything in-between.
For more information, visit

Leave a Reply

Your email address will not be published. Required fields are marked *