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.

Help troubleshooting ssh shell access

Discussion in 'General Discussion' started by kurtosis, Oct 31, 2013.

  1. kurtosis

    kurtosis Registered

    Joined:
    Oct 31, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi all, I'm new to cPanel and WHM, helping a friend with a site hosted at Godaddy on CentOS with cPanel and WHM.

    I've added a keypair to the root user's 'manage root's ssh keys' page in cPanel, and then used ssh-add to add it to my local dev machine too (Ubuntu 12.04). However, ssh'ing in as root is rejected, key isn't accepted.

    The box is also configured to enable ssh password login, and there is a sub-account (or whatever the correct term is) associated with the site's domain (only one website/domain running). I notice the sub-account is also the only account enabled for shell access in cPanel's shell access page. Is that why ssh as root is rejected, b/c only the sub-account is enabled for ssh?

    We don't have access to the sub-account password, so can't use that to ssh in. I tried creating a second sub-account associated with the same website domain, but cPanel doesn't allow that, seems that only one sub-account can exist per domain.

    I'm stumped as to what exactly the problem is, and how to proceed. How do I set up either root or a second sub-account for ssh shell access? Any advice much appreciated. Thanks!
     
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    If you have root access you can access WHM as root.
    In there you can create an account:
    Home » Account Functions » Create a New Account
    give it shell access
    Home » Account Functions » Manage Shell Access
    and then you must add it to the wheel group
    Home » Security Center » Manage Wheel Group Users

    after that you can make a SSH connection to the server, log in as that user, and then you su to root:
    you give the root password and you are in.
     
  3. kurtosis

    kurtosis Registered

    Joined:
    Oct 31, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thank you, I do have root access and that would be perfect, except I'm getting stuck on creating the new account.

    The problem is that in Home >> Account Functions >> Create a New Account you have to specify a domain for the account, and it can't be the same domain as an already existing account.

    However, there is only one domain being hosted on this server, and it is already used with another account. I'm not at liberty to delete or modify that other account, nor obtain the password for it.

    So, do I create a new account under a fake domain? Or is there another/better way? Thanks!
     
  4. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    You can do that, it does not matter.
    When you are able to log in as root you can create an account in command line, add it to the wheel group and use it as "ssh user".
    EDIT:
    Oh yes don't forget to give that account a password.
     
  5. kurtosis

    kurtosis Registered

    Joined:
    Oct 31, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thank you, that got it, much appreciated!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I just wanted to add that it's likely better to create a SSH user manually via the command line instead of creating a new cPanel account with a fake domain name. A full cPanel account is not necessary if you are only seeking to setup an additional SSH user.

    Thank you.
     
  7. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Of course it is, but (as I understood) the OP was not able to get to command line.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, that's correct and it's a legitimate alternative if SSH access is not possible. I just wanted to clarify the recommended method for others who may view this thread in the future.

    Thank you.
     
Loading...

Share This Page