I am getting the following error message "passwd: User unknown: username" Permission denied error message when trying to change the password for that given user account.
The user account is within the /etc/passwd file and I can also su to the account without any problems. This is sever is not using NIS, the passwd field is set to "files"
The OS tells username doesn't exists. It obviously cannot change a password if that account is not already created. What makes you feel the account exists ?
I know the account exists because I can see the account information within the passwd file; I also used the account several days ago without any problems. I can also "su" to that account name without any problems. The OS is also showing the owner / group information for the account without any problems.
That's not enough for a password to be set/changed. Your account is probably missing from the /etc/shadow file. You probably never logged in under that account.
Yes, the user account is within the shadow file, and has a password set. As I stated before, I have logged in and used this account several times before.
Then you'll need to provide more evidence about what's going on. Possibly a locked out account. Please copy/paste the precise command and error message you got when trying to change the password and the output of:
id
grep username /etc/passwd
grep username /etc/shadow
I ran the pwconv command and it complained about a blank line prior to the user account in question. Upon looking at the passwd file, on line 25, there was a ":" missing between the two fields. I fix the problem and everything is working as expected.
For completeness. If you are experienced enought to manually edit a passwd file, backup passwd, shadow and group first.
Use "vipw" not just "vi" and then run "pwconv", "pwck" and "grpck" to maintain and check the integrity of the files.