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