Here, we cover the process to change the SSH port from the default value of 22 on VPS or dedicated servers.
Related Article
SSH into VPS or Dedicated Server
Change SSH Port
IMPORTANT: This solution will require root access. If this needs to be obtained, follow the guide on requesting root access.
- SSH into the server as root
- Open
/etc/ssh/sshd_configusing your preferred text editor and find the line that says#Port 22
TIP: This is usually towards the top. - Remove the
#from the start of the line and replace22with the desired port number
EXAMPLE:
Before:
#Port 22After:
Port 100 - Save and exit the config file
- Restart SSH using the following command
service sshd restart
- Confirm that SSH is listening on the new port by running the following command
netstat -nlp | grep -i sshd
TIP: The results should show 0 0.0.0.0:### and 0 :::### with ### being the new port number. The port has been set to 100 in the example below.
Comments
0 comments
Article is closed for comments.