核查
核查
stat -c '%a %U:%G %n' /etc/passwd /etc/shadow /etc/sudoers
ls -l /etc/group /etc/gshadow /etc/ssh/sshd_config修正与保护
修正与保护
chmod 644 /etc/passwd
chmod 000 /etc/shadow
chmod 640 /etc/gshadow
chmod 600 /etc/ssh/sshd_config
chattr +i /etc/passwd /etc/shadow # 不可变位(变更前 chattr -i 解除)shadow 用 000 或 600 各发行版传统不同,只要非 root 不可读即符合通行核查口径;加 +i 需在变更流程中预留解除步骤。