2

I'm having a weird problem, and I don't know if I've screwed something up or this is the way it's supposed to be and I never noticed..

Using passwd and chpasswd to change a users password works as expected, /etc/passwd is ignored and /etc/shadow is updated.

Using passwd and chpasswd to change the root users password does the opposite; /etc/passwd is updated and /etc/shadow is ignored.

I checked permissions on /etc/shadow, it is 0644, same as /etc/passwd.

This is a CentOS 5.9 system, updated in the last few months, yum update shadow-utils show no updates and rpm -q shadow-utils shows shadow-utils-4.0.17-21.el5.

What the heck is going on?

harleypig
  • 121
  • 1
  • 4

1 Answers1

-1

You might try the Methods in this other answer from Rahul Patil, it worked for me.

the one I used was echo "root:" | chpasswd

that updates the encrypted password in the second field of /etc/shadow

the other fields in shadow are the ones affected by the command chage

Here is the man of shadow, but see the primary command related to that file is chage, so try to use chage first for the other fields in shadow that is not the user and encrypted password

Jose Pla
  • 69
  • 1
  • 3