|
In order to improve server security, it is generally recommended that you change your SSH port on your Linux server.
In order to do this, you need to carry out the following steps:
1. Login to your server via SSH on it's current port
2. Open your SSH configuration file using the command:
pico /etc/ssh/sshd_config
3. Uncomment (meaning remove the #) next to #Port 22 and change this to a number like 8640 (for security reasons, we suggest selecting your own number and not 8640) but also make sure it's not a current port in use. cPanel clients must be wary of this as they may find they conflict port numbers.
4. Once altered, press Ctrl + X to exit the file, press Y for yes to save changes then press enter.
5. Do not close your SSH connection yet. Instead, restart the SSH daemon by typing:
service sshd restart
6. Once SSHD has restarted, leave your current SSH session open, and attempt to open a new SSH session on your new port.
Note: Users who have firewalls on their linux servers will need to allow their new port inbound access through their firewall first
7. Once the connection is established, that's it! You have successfully changed your SSH port.
There are a number of other SSH security features that can be enabled, to which you will need to cover in other articles that we may have available.
If you have any issues or happen to lock yourself out of your server or cannot log back in via SSH, you may wish to contact us for assistance.
|