禁止root登陆ssh
vi /etc/ssh/sshd_config
PermitRootLogin no
禁止其他用户su到root
[root@sample ~]# usermod -G wheel centospub ← 将一般用户 centospub 加在管理员组wheel组中
[root@sample ~]# vi /etc/pam.d/su ← 打开这个配置文件
#auth required /lib/security/$ISA/pam_wheel.so use_uid ← 找到此行,去掉行首的“#”
↓
auth required /lib/security/$ISA/pam_wheel.so use_uid ← 变为此状态(大约在第6行的位置)
[root@sample ~]# echo "SU_WHEEL_ONLY yes" >> /etc/login.defs ← 添加语句到行末

