编辑文件; /etc/login.defs,在文件中设置umask 027或UMASK 027
在文件/etc/login.defs中设置 PASS_MAX_DAYS 不大于标准值,PASS_MAX_DAYS 90
在文件/etc/login.defs中设置 PASS_MIN_LEN 不小于标准值6
mv /etc/issue /etc/issue.bak
mv /etc/issue.net /etc/issue.net.bak
/etc/profile,增加 export TMOUT=300
修改/etc/pam.d/system-auth 文件,
将字符串lcredit=-1 dcredit=-1 ocredit=-1
追加到password requisite pam_cracklib.so后面,添加到配置文件中。
在/etc/pam.d/su配置文件开头添加下面两行:
auth sufficient pam_rootok.so 和
auth required pam_wheel.so group=wheel
把用户添加到wheel组:
usermod -G wheel bobo
编辑 /etc/pam.d/login文件,配置auth required pam_securetty.so
修改/etc/ssh/sshd_config文件,配置PermitRootLogin no。
重启服务,/etc/init.d/sshd restart。