CWP comes with the OpenSSH server. This is using by default port 22. CWP doesn’t modify this at installation time but notifies you to change it as soon as possible. The message looks like:
WARNING: Security vulnerability! Your server is using default SSH Port 22, to make your server more secure change SSH port in config file /etc/ssh/sshd_config and in CSF firewall ! After changes are done don’t forget to restart SSH and CSF Firewall.
To modify the SSH port on CentOs Web Panel:
- Login to CWP at https://domainname.com:2087 (port 2087 is for a secure connection)
- Go to Services Config->SSH Configuration
- This will open for editing the file /etc/ssh/sshd_config
- Look for the line:
#Port 22
and change the port number to something else, like 2211; also remove the # character from the beginning of the line. In the end, you will have:
Port 2211
- Click the Save changes button
- Go to the Dashboard and restart the SSH server.
- Go to Security->CSF Firewall, click the Firewall Configuration button
- Look for the # Allow incoming TCP ports section and add your port number to the list.
- Click the Save changes button
- Go to Security->CSF Firewall, click the Firewall Restart button
- Now you will be able to connect to the server via SSH using the new port number
The short video tutorial for this KB article:
Related KB article: Change the default SSH server port number
Thanks
Thanks mate!
What’s the point of this? How does it make server more secure?
We didn’t say it makes the server more secure 🙂 But it’s considered a good practice.
The idea is that you usually see many more connection attempts on the default port -22. So by changing the default port you reduce the number of failed login attempts.