CyberPanel is a free open source control panel for web hosting. It use OpenLiteSpeed web server. You have the option to use Commercial LiteSpeed web server with CyberPanel.
To change SSH port on CyberPanel server, login to CyberPanel, then go to
Securiy > Secure SSH
From the left side menu. On next page, you will get option to change SSH port.
Once port is changed, click on “Save Changes” button. Now your SSH port changed to non standard port.
Fix Web Terminal
On side bar, you have “Web Terminal” that allow you to access sevrers terminal. If you change SSH port, this feature stop working. To get Web Terminal work again, you need to edit file
vi /usr/local/CyberCP/WebTerminal/CPWebSocket.py
Find
DEFAULT_PORT = 22
Replace with
DEFAULT_PORT = 3333
3333 – replace with your actual SSH port.
Now you need to restart the cyberpanel, for this find the CyberPanel process with command
ps aux | grep CPWebSocket
Kill the process with
kill -9 PID
Example
[root@musiverse ~]# ps aux | grep CPWebSocket root 188833 3.2 3.4 412708 35684 ? Sl 17:19 0:41 /usr/local/CyberCP/bin/python /usr/local/CyberCP/WebTerminal/CPWebSocket.py root 189672 0.0 0.2 112808 2364 pts/2 S+ 17:40 0:00 grep --color=auto CPWebSocket [root@musiverse ~]# kill -9 188833 [root@musiverse ~]#
It will auto restart once you killed and Web Termianl on CyberPanel will work with custom SSH port.
See CyberPanel
Leave a Reply