6

I have root WHM password for a domain and I am able to login using following URL

http://domain_name/whm

But when I use the same root password to connect to server using SSH I get access denied message. How can I solve this issue? I want to login using root through SSH.

I am using Putty to connect.

Thanks

2 Answers 2

7

Two Possibilities:

First, when you log into WHM's web interface, go to Security >> MAnage Wheel Group Users. Make sure that root is in the wheel group.

Second, check /etc/ssh/sshd_config by running cat /etc/ssh/sshd_config | grep PermitRootLogin - If it says yes then that's not your trouble. If it says no or it says yes but is commented out then... that's your trouble. Edit the text file with your editor of choice.

You might also consider leaving root SSH login disabled and create a regular SSH user and allow it then su - to root from there. That's a wee bit more secure.

2
  • Yes root user is in wheel group. How can I check sshd_config if I cannot connect using SSH? Sorry I am not very familiar with Linux.
    – Ali
    Apr 26, 2012 at 10:34
  • @Ali You create a cPanel user that has SSH access rights (jailed access) and then su to root.
    – Wesley
    Apr 26, 2012 at 10:41
3

You should check whether root is permitted to login remotely using SSH, this is configured in the /etc/ssh/sshd_config file. You can either use the cpanel File Manager to open the file and edit the directives, or login to SSH as a local user and then change to the root user with the su - command.

From the console the commands to check is;

# grep -i Root /etc/ssh/sshd_config
#PermitRootLogin yes
# the setting of "PermitRootLogin without-password".
PermitRootLogin yes

If you need to Change PermitRootLogin yes then you will also have to restart the sshd service.

Also, it is not clear that the users for WHM and local user accounts are using the same password database. According to the cpanel docs it looks like the root user to login to WHM is also the system root user - http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/Glossary#QqR

So it would seem that the problem use due to PermitRootLogin no

4
  • 1
    How can I check all this if I cannot connect using SSH? Sorry I am not very familiar with Linux.
    – Ali
    Apr 26, 2012 at 10:34
  • haha, see WesleyDavid he seems to be running in parallel to my thinking...
    – Tom
    Apr 26, 2012 at 11:01
  • I have a similar problem. I think WHM starts out configured to disallow SSH for everyone by key. How to enable it? I created a new key in Manage Root's Keys, but how to use it? Manage Wheel Users forbids adding "root". Sep 27, 2019 at 22:41
  • Solution! I am using an RSA key, not a password, but the SSH key was created in WHM and therefore required a passphrase. Turns out PuTTY accepts that passphrase using the -pw command option. With this small change I can connect with SSH and SFTP. Yay! This should be documented in the "how to" places! Sep 27, 2019 at 23:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .