Locked out of root?

riotrequest

New member
Joined
Jul 10, 2019
Messages
4
Hi everyone! I hope this is the right place to post this. No idea why or how but I can't SSH as root nor can I get su - to work. Every password I try fails. My admin login works, however.

I've tried resetting the root password (a few times) and it doesn't work for the system either. My host allows as much in their Cloud control panel.

Any thoughts or ideas? I have no idea what to do.
 
Are you running a DirectAdmin control panel? Is it a VPS or dedicated server?
 
Hi! Thanks for replying. I am running a VPS (KVM) and yes I am running DirectAdmin. I still have my "admin" login, it works in both :2222 and in SSH but it seems to be limited to what it can do in SSH.
 
Have you tried logging in through the console in your cloud panel? That should prompt a system login just like ssh, but in fact is not ssh but the actual system. If the issue is with ssh than in this way you can circumvent this.
 
Yes as Arieh said you should be able to login with the username root and the root password as if you had a keyboard and monitor connected to it. Its not using ssh at all at that point.

Notice what it says on this page https://www.directadmin.com/installguide.php

You *must* add "AllowUsers username" to /etc/ssh/sshd_config before you log out from root or you'll lose root on the server forever, and you'll have to format.

So you may need to add "AllowUsers root" to sshd_config.

You may have to use the VPS panel to reset the password again.

If all of this fails then get your host to help you as they will know exactly how to get in and fix it. If they don't then find a new host.
 
After reading both yours and his reply, and my previous searching on the forum yeah you're right, I've already made contact with my host.

Thanks!
 
Back
Top