The files shouldn't have mismatch entries if you use the system-provided tools to add users and don't modify the files yourself..basically there are one line per user in both shadow and passwd files, but so that passwd does not contain the password, instead it's in the shadow file (encrypted). Read man pages of both files and see that the fields are correctly set in either of them. If you are unable to solve it otherwise, you could perhaps remove all entries from them except for root and then add all the system's users using useradd or equivalent tool, though that's quite a lot of job to do (note that the user id numbers would need to be the same as they were before, otherwise you'll get in trouble).
|