Operating System - HP-UX
1832986 Members
2649 Online
110048 Solutions
New Discussion

problem with changing the "root" password

 
praveen..
Super Advisor

problem with changing the "root" password

Hi,
i need to change my root password.
but everytime i am getting this error.

# passwd
Old password:
Changing password for root
New password:
Re-enter new password:
Unexpected failure. Password file unchanged. Recommend running pwck command.


some time before i have added this line in /etc/passwd file:

+::-2:-2:::


Please suggest


6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: problem with changing the "root" password

Shalom,

This system is an NIS client. Make sure its properly connected as an NIS client before changing the root password.

It is apparent that root is being managed by the NIS server. You may change it there and it should be changed on all NIS clients.

Did you run pwck? What did it say?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
MarkSyder
Honored Contributor

Re: problem with changing the "root" password

Steven is quite right - that line you added is for NIS. Do you want to change the root passwd on all your servers/workstations at the same time? If so, use yppasswd. The systems I support each have their own root password, so I don't use the /etc/passwd file on the NIS server as the NIS passwd file. I have a separate passwd file in the /var/yp directory. This file does not have an entry for root, so the systems always look to their own /etc/passwd file for the root password.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
praveen..
Super Advisor

Re: problem with changing the "root" password

i am able to change the "root" password on other NIS Client server but not on this one server.
it is giving the same NIS Server name as other servers are giving using "ypwhich" command.

i didnt try with pwck command

please suggest
Mridul Shrivastava
Honored Contributor

Re: problem with changing the "root" password

Verify the contents of the /etc/passwd file. Making sure that the entries are in the correct format, no entries are mangled, incomplete, empty entries or blank lines in the file.
# vipw

Verify the entries in /etc/passwd:
# pwck
Problem entries will report something similar to:
cherylg:*:111:20::/home/cherylgr:/sbin/sh
Login directory not found
Blank lines within or at the end of the file will be noted as:
Too many/few fields

Verify there are no unseen characters in the file:
# cat /etc/passwd |vis
Unseen characters would show up as control characters or numbers using vis.
Look for blank lines within or at the end of the file as well.

Verify permissions, owner, group on /etc/passwd:
# ll /etc/passwd
-r--r--r-- 1 root sys 1794 Jul 11 13:15 /etc/passwd

Correct these if necessary:
# chmod 444 /etc/passwd
# chgrp root:sys /etc/passwd

If the problem cannot be identifed, check when /etc/passwd was last modified.
# ll /etc/passwd
If /etc/passwd was recently modified, copy it to /etc/passwd.bak or something and recover /etc/passwd from backup prior to the last change and test changing the password. Does it still fail? If it does, a clean copy from /usr/newconfig/etc/passwd may have to be moved into place and the entries recreated.

Time has a wonderful way of weeding out the trivial
RAC_1
Honored Contributor

Re: problem with changing the "root" password

You have +::-2:-2::: means nis. So how does your /etc/nsswitch.conf file look like? You want to chnage root passwd on local machine. Right?
There is no substitute to HARDWORK
Rick Garland
Honored Contributor

Re: problem with changing the "root" password

Check the /etc/nsswitch.conf file.

Are you searching NIS in the nsswitch.conf file? You will want the NIS search to be first in the list.