Sabtu, 02 Mei 2020

, , ,

Change SSH port in CWP

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:






sumber : plothost.com

if the login fault, try this
semanage port -l | grep ssh
and if output is 22
semanage port -a -t ssh_port_t -p tcp 2222
than, finally
semanage port -l | grep ssh
and show the port used ssh_port_t 

Continue reading Change SSH port in CWP