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!

SSH Connection Denied

Discussion in 'Security' started by cravend, Apr 4, 2017.

Tags:
  1. cravend

    cravend Member

    Joined:
    Apr 4, 2017
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    Hello. I'm trying to connect to my server's root account through the PuTTY client on Windows. I imported my keys into the "Manage root's SSH Keys" tab on WHM. However, whenever I try to connect, before I can type anything in, I get an error that says "connection refused."
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    604
    Likes Received:
    43
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Make sure you are using correct SSH Port and the port is allow in server firewall.
    Another possibility is that sshd service is not running on the server
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,491
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cravend

    cravend Member

    Joined:
    Apr 4, 2017
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    I read through the tutorial, but it says it requires the ability to log into the shell via SSH. I'm not able to do that--when I type the command "ssh [hostname]" or "ssh [ip]", the connection is refused.
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,491
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    One available solution to try when SSH access fails is to start a temporary instance of SSH using the SafeSSHRestart Autofixer. Here's an example of the URL you would enter once logged into WHM:

    Code:
    https://IP:2087/cpsess12345678/scripts2/doautofixer?autofix=safesshrestart
    You would replace "IP" with the server's IP address and the session number with what's displayed in your address bar after logging in to WHM. Note that this is simply a temporary instance of SSH that will run on a different port (23 by default), so you can login and determine what's wrong with the standard SSH service.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. cravend

    cravend Member

    Joined:
    Apr 4, 2017
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    This fixed it! Using the SSH command now works fine. Thank you for your help, you can mark it this closed.
     
    cPanelMichael likes this.
  7. cravend

    cravend Member

    Joined:
    Apr 4, 2017
    Messages:
    21
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    I originally said that this fixed everything. However, I've noticed it's a temporary fix & I have to frequently run the autofixer. What should I do to check why my SSH keeps closing?
     
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,491
    Likes Received:
    1,964
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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