Linux.com

Locked Out!

Link to this post 20 Apr 12

Hello all. I have CentOS I believe, although when booting it says something about RedHat. In any event, we had two logins we used to use to SSH into the box. root and admin, neither of them work anymore. Nobody changed the passwords, yet when attempting to log in via SSH, the system states, "Access Denied".

I have also tried to get on the machine directly at the console. I rebooted the machine, let the OS load and it eventually comes to a desktop that is blue, and an error message that states the following:

There was an error loading the theme Default

Failed to open file '//usr/share/gdm/themes/default/rehat_logo.png' No such file or directory'

That error was around prior to the SSH issue.

Long story short, I cannot get on the machine at all. Any thoughts would be great.

Thanks

Link to this post 21 Apr 12

Boot with a recovery CD/DVD disc. Mount the root file system. Edit the file /etc/inittab in the mounted file system and change the runlevel to 3. Then reboot from disc. That will boot you into text mode so you can login as root and fix the GUI and other cruft.

Link to this post 23 Apr 12

If you are able to login in the console as root, do so.

edit this file /etc/ssh/sshd_config

and set "PermitRootLogin" to "yes". (

Chances are it is either missing or set to "without-password".

restart the ssh
%/etc/init.d/sshd restart

Link to this post 23 Apr 12

Thanks for the replies. Rubberman, we will try your suggestion today. Derrick, I cannot login to the machine at all, the two accounts we have are locked out, ie. access denied, etc. The accounts are root and admin, and both locked. CTRL-ALT-F1 did enable me to break out of the stalled desktop and actually to the command line login though.

Link to this post 23 Apr 12

Maybe you were hacked and the passwords were changed just to fool you around.

Get a livecd, mount /, get into the /etc/shadow and set to emtpy the first field after your login names.

Reboot the machine and try login in now

Link to this post 23 Apr 12

Here is the resolution we used. Thanks to all who helped.

Solution:

Shut down box and put drive in another Linux box.
Mount drive and edit the grub.conf file, add "single" to the end of the kernel line and save
Put drive back in box, bring up machine in single mode and then VI the passwd file on a monitor that you really can't even see what it says, remove the encrypted root password and save the passwd file, then init 3 and bring up machine, login as root with no password and set password.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board