您的位置:首页 > 职场人生

日记 [2007年01月24日]服务器加强安全

2007-01-24 10:36 281 查看
禁止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 ← 添加语句到行末
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  职场 服务器 休闲