pwck
Used to verify the integrity of the content and format of system certification files
Supplementary instructions
pwck command is used to verify the integrity of the content and format of the system authentication files /etc/passwd and /etc/shadow.
grammar
pwck(option)(parameter)
Options
-q: only report error information;
-s: Sort files "/etc/passwd" and "/etc/shadow" by user ID;
-r: Run the command in read-only mode;
-R: Check the password file in the specified chroot environment.
Parameters
Example
pwck
user 'ftp': directory '/var/ftp' does not exist
pwck: no changes
After executing the pwck command, some warnings are displayed, indicating that the home directory /var/spool/lpd of the user lp does not exist. To solve this problem, you have several options:
-
If you are sure that these users will not be used, you may consider using the
userdelcommand to delete these users. -
If these users need to be used, you should create the corresponding directories. For example, you can use the following command:
# Create a directory
sudo mkdir /var/ftp
# Assign directory ownership to the corresponding user
sudo chown ftp:ftp /var/ftp
-
If the software packages corresponding to these users have not been installed, you may consider installing them. Package managers (such as
yumorapt) usually create the necessary users and directories automatically.


