VPS & Dedicated Hosting: How to Change SSH Port
Want to boost your server's security? Changing your SSH port is a quick and easy way to do it. Most servers use port 22 for SSH, which can be an easy target for attackers. By switching to a different port, you make it much harder for them to find and access your server. In this guide, we'll walk you through how to change your SSH port number easily.
How to Change SSH Port
- You can find the SSH configuration file at
/etc/ssh/sshd_config
- To edit this file, you will need to log into your server through shell as the root user.
- To change specific parameters within sshd_config, you need to uncomment the line by removing the number-sign (#) and changing the value for the line. For example, the default SSH port appears in a line like this:
#Port 22
- To change the SSH port to 456, you will need to make the line appear like this:
Port 456
- After you are finished configuring SSH, you will need to restart the SSH daemon. You can do so by issuing the following command:
/etc/init.d/sshd restart
- After you restart SSH, you will need to log out of your server and log in again using the proper user, IP address, and port number you specified in sshd_config.
Summary
Alright! You have successfully modified your SSH port and enhanced the security of your server. Don't forget to keep your new port number private and think about adding extra security measures to better safeguard your VPS or Dedicated server.
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.