Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How do I open a port in ssh?

Discussion in 'General Discussion' started by grabyourhosting, Apr 9, 2007.

  1. grabyourhosting

    grabyourhosting Well-Known Member

    Joined:
    Jan 18, 2007
    Messages:
    71
    Likes Received:
    3
    Trophy Points:
    158
    cPanel Access Level:
    Root Administrator
    Whats the command for it? I want to change the port where SSH is used. What port do you recommend for high security?
     
  2. jsilvestre

    jsilvestre Member

    Joined:
    Jul 7, 2005
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    151
    Change SSH port

    Dear grabyourhosting,

    change line Port 22 on file /etc/ssh/sshd_config.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Be sure to open that port in your firewall if you;re running one or you could lock yourself out. :)
     
  4. grabyourhosting

    grabyourhosting Well-Known Member

    Joined:
    Jan 18, 2007
    Messages:
    71
    Likes Received:
    3
    Trophy Points:
    158
    cPanel Access Level:
    Root Administrator
    How do you open a port with your firewall?
     
  5. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    166
    If you are running apf, add the port number on wish to run SSH in the file /etc/apf/conf.apf
    Open the file and add here. You can see other port numbers, add the port umber you wish. restart apf using, apf -r

    # Common ingress (inbound) TCP ports
    IG_TCP_CPORTS=

    If there is no apf, add the iptables rule like this.

    iptables -I INPUT -s 0/0 -- dport -p port_number -j ACCEPT

    Now save the rule
    service iptables save
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    166
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice