Linux Password (/etc/passwd) & Group (/etc/group) Integrity File Checkers Commands

by on December 21, 2005 · 0 comments· LAST UPDATED October 4, 2013

in , ,

In old good Sun Solaris days, one can use test /etc/passwd file integrity with the pwck command. The pwck command scans the password file and notes any inconsistencies. The checks include validation of the number of fields, login name, user ID, group ID, and whether the login directory and the program-to-use-as-shell exist.

Linux commands to check and verify integrity of password files

Check integrity of group file /etc/group with the grpck command command:
# grpck
# echo $?

To check integrity of password file /etc/passwd and /etc/shadow file with pwck the command:
# pwck
Sample outputs:

user 'lp': directory '/var/spool/lpd' does not exist
user 'news': directory '/var/spool/news' does not exist
user 'uucp': directory '/var/spool/uucp' does not exist
user 'list': directory '/var/list' does not exist
user 'irc': directory '/var/run/ircd' does not exist
user 'gnats': directory '/var/lib/gnats' does not exist
user 'nobody': directory '/nonexistent' does not exist
pwck: no changes

These are very handy utility in case of problem. Read man page of pwck(8) and grpck(8) for more information.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: