Skip to main content

Changing ports in WHM

Comments

9 comments

  • mageshm
    @bulewold, Are you referring WHM/cPanel port numbers or SSH port number ? For security purpose i advise you to install CSF, change ssh port number, disable direct root login, enable wheel user and enable ssh-key generation logoin. If you have static IP add that IP for server access.....that's it.
    0
  • cPanelMichael
    Hello :) You can change the "port=" value for cPanel in /var/cpanel/cpanel.config from 2082 to a new port number. The SSL port will be this value plus one. It's not possible to change the WHM port value. Thank you.
    0
  • bulewold
    Thanks for quick responses. Mageshm, would CSF take care of port change along with other security settings it seems like it provides? [url=http://configserver.com/cp/csf.html]ConfigServer Security & Firewall Also, if I install this, would it cause any reset of configuration that'll cause stop in currently running web services? I'm just being careful cuz I had my web service stopped recently when I changed setting on apache server configuration following more secure setting advice, had to restore to make it work again.
    0
  • cPanelMichael
    CSF takes over as a firewall management utility for iptables after you install it, so you can make all firewall changes through it's administrative interface. Changing the SSH port is completed separately. This thread will help: SSH Hardening Thank you.
    0
  • bulewold
    Thank you! I started following instruction but on port changing, it shows how to find available port but not on how to change...... So i found another tutorial that showed how to change using vim sshd_config and change port number on it... yet once i've done that, it didnt' let SSHD restart. Any way to get back into ssh when it's not restarting? And what did i do wrong?
    0
  • cPanelMichael
    You will need to ensure that you add the new port to the allowed ports list in your CSF configuration. Thank you.
    0
  • bulewold
    Is there any way to install CSF without using SSH? (plugin or add on options?) Just trying to be careful. :)
    0
  • cPanelMichael
    You will need to initially install it via SSH using their instructions:
    0
  • bulewold
    Yes, I actually found that guide and took care of it. It wasn't bad. :) Thank you! Although I'm considering moving to a new host that'll actually help me with setting up firewall.
    0

Please sign in to leave a comment.