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 Port Kills SSH

Discussion in 'General Discussion' started by elflaco, Jan 4, 2007.

  1. elflaco

    elflaco Member

    Joined:
    Nov 6, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hi All:

    I have been reading and utilizing 000000000's exceptional "A Beginners Guide to Securing Your Server", but have hit a bit of a snag.

    Every time I attempt to change the port to a number other than 22 per the instructions, I can't SSH in any longer. Not as root (which is disabled anyway) or as the other user in the wheel group. I either get "Access Denied" or "No address associated with nodename". I have restarted the ssh services both through the terminal and on WHM. A couple of times I've had to use the nifty little script that Chirpy supplied (thank God he's not evil) to get back into the server via SSH.

    Now, as I said, I am following the guide step by step, so I haven't gotten to the part where I would install the firewall, so it isn't like I forgot to open the new port on the FW.

    Is there something painfully obvious I'm missing here? I've searched the forums, as well as Google, but can't find this exact problem.

    Thanks in advance for any assistance you might lend.

    **Edit**

    This is on a VPS running RHL 4
     
    #1 elflaco, Jan 4, 2007
    Last edited: Jan 4, 2007
  2. ffeingol

    ffeingol Well-Known Member
    PartnerNOC

    Joined:
    Nov 9, 2001
    Messages:
    215
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    did you open whatever port you changed ssh to on your firewall?

    Frank
     
  3. elflaco

    elflaco Member

    Joined:
    Nov 6, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    That's what is odd: I haven't installed a firewall yet.

    I'm guessing that I need to skip ahead, install the firewall, and then go back and change the port...
     
  4. ffeingol

    ffeingol Well-Known Member
    PartnerNOC

    Joined:
    Nov 9, 2001
    Messages:
    215
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    no,

    I was just thinking you locked yourself out with a firewall.

    Frank
     
  5. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Check with your datacenter to make sure they've not blocked the port upstream of you...
     
  6. 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
    May be silly, but did you change the port on your SSH client from 22 to the new port? The port might be changed on the server but your program might still be trying on 22?
     
  7. elflaco

    elflaco Member

    Joined:
    Nov 6, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Good idea.

    I'll give that a shot and let you know.
     
  8. elflaco

    elflaco Member

    Joined:
    Nov 6, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Not silly, as I usually forget the first time I log in, but I still get the same result when I change the port#.
     
  9. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    If root is disabled - what group is wheel getting it's permissions from?
     
  10. elflaco

    elflaco Member

    Joined:
    Nov 6, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Another non-sensical account I created to make it harder to guess.

    And I figured out what the issue was; I only restarted the ssh server, and not apache.

    I restarted apache, and it worked fine.

    Thanks to everyone for their assistance!

    :)

    **Edit**

    I do have one question, though.

    Why is the sshd_config file blank now?
     
    #10 elflaco, Jan 4, 2007
    Last edited: Jan 4, 2007
Loading...

Share This Page