How to change ssh port number

Stop worrying about your server.

cPanel/Plesk Server Management for just $59/mo with Unlimited tickets, Unlimited admin hours, Security audits, 24×7 monitoring and lot more 

cPanel Server Management  $59/mo Click here

Plesk Server Management $59/mo Click here

How to change ssh port number:

You can change ssh port number of the server by editing the ssh configuration file on the server.

After you have logged in to the server as user: root , you need to edit the configuration file for the SSH service. The configuration file is sshd_config . Also it is highly recommended to take a backup of the configuration file before making any changes to the configuration. So it will help in case of any further issues happen after editing the configuration.

The ssh configuration file is,

/etc/ssh/sshd_config

For taking backup of the file use the copy command,

cp /etc/ssh/sshd_config  /etc/ssh/sshd_config_backup

After that edit the file using the file editor,

vi  /etc/ssh/sshd_config

Now, change the line ” #Port 22 ” to something like,

Port 55676

Then save the file and restart the ssh service using the command,

/etc/init.d/sshd restart

The port number will be now changed to the new port number you have given. That’s all 🙂

If you need our help to fix the issue with incoming/outgoing spam from your server. Please feel free to contact us, simply email to [email protected]

Monthly server support with Unlimited tickets, 24×7 monitoring, Security Audit and lot more for just $59 

Server Management at just $59

Leave a Reply

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