doc: update pwck (#507)

Co-authored-by: Alan <alanmp@qq.com>
This commit is contained in:
Alan 2023-05-30 08:25:17 +08:00 committed by GitHub
parent 257259f73c
commit f707705c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 20 deletions

View File

@ -18,7 +18,8 @@ pwck(选项)(参数)
```shell
-q仅报告错误信息
-s以用户id排序文件“/etc/passwd”和“/etc/shadow”;
-r只读方式运行指令。
-r只读方式运行指令
-R在指定的chroot环境下检查密码文件。
```
### 参数
@ -29,24 +30,18 @@ pwck(选项)(参数)
### 实例
```shell
pwck /etc/passwd
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 'www-data': directory '/var/www' 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
user 'syslog': directory '/home/syslog' does not exist
user 'couchdb': directory '/var/lib/couchdb' does not exist
user 'speech-dispatcher': directory '/var/run/speech-dispatcher' does not exist
user 'usbmux': directory '/home/usbmux' does not exist
user 'haldaemon': directory '/var/run/hald' does not exist
user 'pulse': directory '/var/run/pulse' does not exist
user 'saned': directory '/home/saned' does not exist
user 'hplip': directory '/var/run/hplip' does not exist
pwck无改变
pwck
user 'ftp': directory '/var/ftp' does not exist
pwck: no changes
```
执行`pwck`命令后显示了一些警告,提示有用户`lp`的主目录 `/var/spool/lpd`不存在。为了解决这个问题,你有几个选项:
1. 如果你确定这些用户不会被使用,你可以考虑使用`userdel`命令来删除这些用户。
2. 如果这些用户需要被使用,你应该创建相应的目录。例如,你可以使用以下命令:
```shell
# 创建目录
sudo mkdir /var/ftp
# 将目录的所有权赋给相应的用户
sudo chown ftp:ftp /var/ftp
```
3. 如果这些用户对应的软件包还未安装,你可以考虑安装它们。软件包管理器(如`yum`或`apt`)通常会自动创建必要的用户和目录。