Root passwd change not working

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I wanted to reset the root password after we had an outside consultant
come in to help us set up some services.  Seems smart.  So I was
logged in as root, used passwd to change it, got a confirming message
that it had been changed.  But when I logged off and logged back in,
it wouldn't take the new password. As it turns out, the root password
is now blank and will not accept change.  
I have also tried logging in as a user, used the su command, logged in
with the blank password, used the passwd command to change the root
password, confimation message.
I can see the value changing in /etc/shadow file, but it still will
only accept a blank password for root when logging in.

Any ideas?

Re: Root passwd change not working

Quoted text here. Click to load it

You didn't give many details about which distro and/or programs you're using,
so I can only suggest things to look at:

- Check out your /etc/login.defs /etc/login.access files, as well as see what
passwd -S root says. I've also had strange things happen because of bad limits
being set (ulimit, etc..).

- Check out the defaults for passwds, the -x -n -w -i parameters. Have a look
at faillog if it's in use.

- Verify that your passwd or shadow files themselves haven't some bad
characters in them. Make sure the user's shell is OK to login with.

- Consider the login program itself. I've got a few bad login programs while
compiling shadow, I think it was version 4.0.5 or 4.0.6. "lastlog" wouldn't
work correctly because login wasn't writing the proper values. I've now got
shadow-4.0.7 and so far it's been fine. Maybe un-shadow the files and see if
this works, then if it does, take it from there? Try a fresh compile of
shadow, and use all new programs, replace everything. Since you see the
password being changed, I'm betting the problem is in the login program itself.
If you have other similar machines, copy a known-good login over and try that
and see what happens.

Do you use PAM or anything of this nature? Since I don't I can't advise on it,
but I'm sure this could cause a similar problem as you are seeing.

MS09-99896 - Vulnerability in All MS Windows OS
Using Windows Could Allow Remote Code Execution
"Microsoft finally admitted today that you just
shouldn't use Windows for anything. Period."

Re: Root passwd change not working

leiriley wrote:

Quoted text here. Click to load it

Well, it's better than nothing; but if he's had root access, there are 1001
things he could have done to allow himself access at a later date (not that
i'm saying he has - most security consultants are upstanding members of the

Quoted text here. Click to load it

What about changing a regular user's password?


"Linux Network Security", the ultimate book on protecting your network from

Re: Root passwd change not working

leiriley wrote:
Quoted text here. Click to load it

Make sure the second field in /etc/passwd of the user `root'
contains the char `x' (no ticks).
Otherwise /etc/shadow will not be read.

I.e the first four fields have to look like this:

reply to usenet only

Re: Root passwd change not working

Quoted text here. Click to load it

What is (if any) your nsswitch.conf setting? Do you use NIS or NIS+ or


Dragan Cvetkovic,

To be or not to be is true. G. Boole      No it isn't.  L. E. J. Brouwer

!!! Sender/From address is bogus. Use reply-to one !!!

Site Timeline