kurtosis

Registered
Oct 31, 2013
3
0
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!
 

quietFinn

Well-Known Member
Feb 4, 2006
2,041
551
493
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.
 

kurtosis

Registered
Oct 31, 2013
3
0
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!
 

quietFinn

Well-Known Member
Feb 4, 2006
2,041
551
493
Finland
cPanel Access Level
Root Administrator
So, do I create a new account under a fake domain? Or is there another/better way? Thanks!
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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.
 

quietFinn

Well-Known Member
Feb 4, 2006
2,041
551
493
Finland
cPanel Access Level
Root Administrator
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.
Of course it is, but (as I understood) the OP was not able to get to command line.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Of course it is, but (as I understood) the OP was not able to get to command line.
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.