Jump to content

Can't change root password

Guest wahro02

Recommended Posts

Guest wahro02

Morning folks -


We are running Mandrake MNF 8.2.


Recently, the root password expired and was changed at the console. After changing it, it no longer worked, even the previous password. I could not boot into single-user mode, as it asked for a "maintenance password". I had to boot with a Linux live CD and edit /etc/passwd and /etc/shadow to blank out the root password.


This allowed me to enter single-user mode, as it no longer asked me for a maintenance password. At the prompt, I did passwd to reset the root password. Rebooted. The password still did not work when trying to log in as root at the console command line (no GUI). However - the new password does work as the maintenance password and also works when I issue the reboot command as a user. It does not work when I try to sudo though.


In summary:

- root password works for single user maintenance mode

- root password works when I issue reboot command as a user

- root password does not work when I try to log in as root at the console


Any thoughts on what the problem might be?



Regards -



Link to comment
Share on other sites

What's your pam configuration? Changed this recently attempting to authentication through other sources than passwd?


Incidently, you don't need to comment root out of /etc/passwd and /etc/shadow. Once you've booted the live cd, you just simply chroot into your Mandrake install and then use passwd in the normal way for resetting the root password.

Link to comment
Share on other sites

Guest wahro02

No changes to anything in pam.d. Everything in it is 5+ years old.


My fault: I didn't comment out root from /etc/passwd and /etc/shadow. I just deleted anything in the second field; i.e. the entry now looks like


root::(whatever else follows)


in both files.


I'll try the live CD and chroot when I bring the firewall down again.


Thanks much for the reply.

Link to comment
Share on other sites

Guest wahro02

No luck. I did the following:


- booted from a Puppy Linux live CD

- opened a terminal session

- mounted the appropriate drive of the host

- chroot /mnt/sda1 /bin/bash

- passwd


I received the "all auth tokens updated" message and both /etc/passwd and /etc/shadow had current timestamps. Still the same situation though: the root password works to enter single mode and to reboot while logged in with a different account, but not for logging in root directly, and not for sudo (if that helps).

Link to comment
Share on other sites

Can you tell me what the contents of your /etc/securetty file is? This is how mine looks:


[ian@esprit ~]$ cat /etc/securetty 


maybe yours is empty and why cannot login. Just a guess, because I can't figure out why.

Link to comment
Share on other sites

Guest wahro02

This looks interestingly promising:



# ls -lrt securetty

-rw-r----- 1 root root 0 Mar 10 2004 securetty



Nothing in it and never was?


Googling for Mandrake mnf and securetty, I found a similar issue in these forums:




Mandrake MNF - Spoofing MAC address - How?


I can login using a secondary account and su works, so I guess I'm ok. I think I tried sudo before...


Thanks for the help





Per the link above, it looks like the "PermitRootLogin without-password" entry in /etc/ssh/sshd_config plays some part in this also.

Edited by wahro02
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...