Tuesday, March 06, 2007

Problem Changing the root Password

It was that time again. We had to change the root password. I changed it on the first workstation and it failed. Why? The /etc/nsswitch.conf file was initially setup for NIS+ and then files. I had to swap them.

Here's the error message: "passwd: Unsupported switch entry for "passwrd:", Use "-r repository". Unexpected failure. Password file/table unchanged.

Here's how it was setup.

passwd: nisplus files
group: nisplus files

Change to the following:
# vi /etc/nsswitch.conf
passwd: files nisplus
group: files nisplus
:wq! (saves and quits vi)

Then I proceeded with the root password change
# passwd root

...or as Cass pointed out

For Files
# passwd -r files root
# passwd -r file username

For NIS+
# passwd -r nisplus username


Anonymous said...

Not to detract from your method, but you could have just used

passwd -r files root

save any trouble with nsswitch.conf


esofthub said...

I appreciate the tip and gaining more knowledge from contributors like you. Thanks Cass.

Anbu said...


I was trying -r files option to change password for user but it was not happening.This server is integrated with our Windows domain controller.

Below is the command output

bash-3.00# passwd -r files opsuser
New Password:
Permission denied

I am using Solaris 10 Server with Windows 2008 Domain controller