The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing ports in WHM

Discussion in 'Security' started by bulewold, Feb 3, 2015.

  1. bulewold

    bulewold Member

    Joined:
    Jan 29, 2015
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello, I'm new to VPS & WHM.
    I hear on VPS, one of easiest and best thing to do for security is to change ports numbers so that it's not default number bots/hackers will look for.

    I tried searching for this topic with no luck. Can someone give guidance on how to change that without breaking my site? Or link me the topic if it was already covered?

    Thank you for your help in advance!
     
  2. mageshm

    mageshm Well-Known Member

    Joined:
    Apr 17, 2014
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Chennai, INDIA
    cPanel Access Level:
    DataCenter Provider
    @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.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  4. bulewold

    bulewold Member

    Joined:
    Jan 29, 2015
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks for quick responses. Mageshm, would CSF take care of port change along with other security settings it seems like it provides? 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.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  6. bulewold

    bulewold Member

    Joined:
    Jan 29, 2015
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    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?
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  8. bulewold

    bulewold Member

    Joined:
    Jan 29, 2015
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Is there any way to install CSF without using SSH? (plugin or add on options?) Just trying to be careful. :)
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  10. bulewold

    bulewold Member

    Joined:
    Jan 29, 2015
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page