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.

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:
    50
    Likes Received:
    0
    Trophy Points:
    6
    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:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Change SSH port

    Dear grabyourhosting,

    change line Port 22 on file /etc/ssh/sshd_config.
     
  3. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    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:
    50
    Likes Received:
    0
    Trophy Points:
    6
    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:
    16
    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
     
  6. jayh38

    jayh38 Well-Known Member

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

Share This Page