Synergy Wholesale

Changing the SSH port on your VPS

Before completing these steps, login to your VPS via SSH.

Changing the SSH Port

By default, SSH runs on port 22. Changing the SSH port can help reduce the number of automated attacks on your server. However, please note that this is not a comprehensive security measure and should be used in conjunction with other security practices. To change the SSH port, please follow the steps below:
  1. Open the SSH configuration file in Nano by typing in this command:
    nano /etc/ssh/sshd_config
  2. Navigate down the lines using your arrow keys, and un-comment the line in the file that says "#Port 22".
    1. Use the backspace or delete key to remove the hash character.
    2. Change 22 to your desired port number.
  3. Then, exit Nano:
    1. Press Ctrl+X to quit.
    2. Then, press Y to confirm your changes
    3. Press the Enter key to confirm that the filename remains the same (do not change this).
  4. Restart the SSH daemon:systemctl restart sshd

Updating your firewall settings

If you have a firewall set up on the server, you will need to ensure that you adjust your firewall settings to allow for connections on the new SSH port. If you have CSF installed (cPanel servers)
  1. Open the CSF config file:
    nano /etc/csf/csf.conf
  2. Look for the allowed TCP ports (approximately line 138).
  3. Use the arrow keys to navigate the cursor after one of the separating commas.
  4. Type in your new port number here and add a comma if there are any values after this.
  5. Press Ctrl+X to quit.
  6. Then, press Y to confirm your changes.
  7. Press the Enter key to confirm that the filename remains the same (do not change this).
  8. Restart CSF using the following command:
    csf -r
If you're using FirewallD (CentOS/AlmaLinux 7/8, Ubuntu 18+) Note: In this example, the new SSH Port is 2222. Make sure you adjust the port number for your use case. Please replace port=2222 with your new nominated port.
sudo firewall-cmd --permanent --zone=public --add-port=2222/tcp
sudo firewall-cmd --reload

Related Articles

VPS··1 minute read

When you have provisioned your new Self-Managed VPS, it is critically important to secure it sufficiently to minimise the potential for it to be hacked. By ensuring it is secure, you protect both your data and our network from malicious use.

VPS··3 minute read

This guide will cover how to use Acronis Backup with your Self Managed VPS service through WHM and completing a restore from an available backup. If you are on a Fully Managed VPS service, please refer to our guides below on how to use Acronis Backup with your service: Restoring databases with Acronis Restoring website files with Acronis What VPS Services include Acronis Backup?

VPS··1 minute read

Before cancelling your VPS Before cancelling your VPS, we highly recommend to take a backup of any data you wish to keep before proceeding with the cancellation as once the service is cancelled, all data will be permanently deleted and cannot be recovered. Cancelling your VPS Service If you have taken a backup and are ready to cancel your VPS, below are the steps you can take to cancel your VPS service: Log in to your Synergy Wholesale Account.

VPS··2 minute read

Server Management Job is an agreed work order for system changes or upgrades to your Self Managed Virtual Private Server for a once-off fee. Below is a list of what is covered under a Server Management Job and what you can expect from the process.

VPS··2 minute read

Updating a cPanel server Updating a cPanel server is fairly easy, because cPanel/WHM has simple server update and management tools built-in. You can run updates by using the following tools in WHM: WHM > Software > System Update WHM > Software > Update Server Software Warning: The System Update tool allows you to optionally update the server's kernel if there is a new version available.

VPS··1 minute read

What do we monitor? In short, Synergy Wholesale monitors the infrastructure side of your service, this includes: The network that your VPS uses The physical server that your VPS is on Due to the nature of being a Self Managed product, We do not monitor the VPS itself or its services, This will have to be set up by yourself or your IT Infrastructure admin.