unable to reset user password

hi,
i am unable to reset one of my server user password.
whenever i make a "passwd username" i get the following
error

New Password:
Re-enter new Password:
Permission denied

========================================

please advise.thanks alot.:confused:

To change the Passward of a user (Here, Username), You should login as
root or the user itself (Here, Username)....

Cheers....

am in root ...still unable to reset...

Is this user's password stored remotely (NIS, NIS+, ldap) ?

Is the user a/c listed in the passwd and shadow file? If yes, try removing the encrypted passwd in the shadow file.
Make sure that /etc/passwd is mode 444 (-r--r--r--) with an owner of root and group of other.

Makre sure that /etc/shadow is mode 400 (-r--------) with an owner of root and group of other.

passwd -r files <username>
:b:

Just as a little note. I've had a similar problem on an old Sun box before. The problem was a passwd lock file in /etc. I used truss to watch passwd and it kicked back at this lock file. It had been created by another admin changing a password and his session bailed out leaving the lock file in place. Once I cleared it it fixed the problem.

So you might open another window to the server and log in as root. In the first window, type in passwd. Then shift to the second window and do a ps -ef | grep passwd. Next type in truss -p <pid of passwd>. In the first window type in the new password twice. The second window should show you where the problem is happening.

It might be a lock file or some other problem but truss is a helpful tool.

Carl

great info..thanks alot guys...btw,the passwords are on NIS