要确认 CentOS 用户是否已被删除,可以通过以下步骤进行检查:
查看 /etc/passwd 文件:
cat 或 less 命令查看 /etc/passwd 文件,该文件包含了系统中所有用户的列表。cat /etc/passwd
查看 /etc/shadow 文件:
cat 或 less 命令查看 /etc/shadow 文件,该文件包含了用户的加密密码和其他安全信息。cat /etc/shadow
使用 id 命令:
id 命令检查特定用户是否存在。id username
id: username: no such user 的错误信息。使用 getent 命令:
getent 命令查询用户信息。getent passwd username
检查 /home 目录:
/home 目录,确认被删除用户的家目录是否已被删除。ls -ld /home/username
No such file or directory 的错误信息。通过以上步骤,您可以确认 CentOS 用户是否已被删除。如果用户已被删除,所有相关的文件和条目都将不再存在。