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.

SSH on Different Port w/ KEY Authentication

Discussion in 'General Discussion' started by zackrspv, Nov 22, 2011.

  1. zackrspv

    zackrspv Registered

    Joined:
    Nov 22, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Initially, I had set my SSH server to bind to a different port other than port 22. And subsequently configured the firewall, restarted CSF, etc etc. But, anytime I would try to connect using a PKA, boom, wouldn't work. But, when i ran the link above to reset SSH back to WHM defaults, boom works fine.

    So, why?

    Nothing has changed w/ the keys, or the key pass phrases.

    It's just the port.

    Are we not able to choose a different port for SSH for security purposes, so that we do not leave it open for attack?

    What I want to do:
    * Change SSH port to a port of my choosing.
    * Login using a Key, not the actual password.

    But, unless i leave it on port 22, i can't do that. For, when i change it to something else, i can't login w/ the key.
     
    #1 zackrspv, Nov 22, 2011
    Last edited: Nov 22, 2011
  2. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi,

    You can change different ssh pot with the key authentication, I don't think that there should be any problem for ssh.
    I doubt that firewall is not allowing new ssh port accessible. Just telnet to your server at new ssh port and that will give you an idea if the port is opened or not behind server firewall.
     
  3. zackrspv

    zackrspv Registered

    Joined:
    Nov 22, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I know the port is open because when i turn on password auth, it works fine on the new port. But, not when i turn that off, and try to use a key.
     
  4. zackrspv

    zackrspv Registered

    Joined:
    Nov 22, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I know the port is open, because if i have password authentication turned on, putty and secureCRT connect just fine on the new port.

    But, if i turn off password auth, and just use public key authentication, it fails unless i'm port 22. That's why i'm askin :)
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please use verbose logging when you SSH (the -v option) and provide the failure message it is indicating for the connection attempt.
     
Loading...

Share This Page