ubuntu 服务器安全加固的20条方案_ubuntu 安全加固
创始人
2025-01-19 12:32:37
0
chage --warndays 7 root  

4. 非 wheel 组用户禁用 su | 身份鉴别

普通用户禁用 su,仅特殊的用户组 wheel 下用户才可以使用 su 切换到 root 用户
加固建议
/etc/login.defs 中将 SU_WHEEL_ONLY 注释放开,并添加参数 yes

SU_WHEEL_ONLY yes  

修改默认配置文件 /etc/pam.d/su,去掉如下这行注释,并在尾部添加 use_uid

auth       required   pam_wheel.so use_uid  

添加 wheel 组用户

# 添加 wheel 组 groupadd -r wheel # 创建 hiwb 用户并加入到 wheel 组 useradd -r -m -s /bin/bash -g wheel -r hiwb # 将 hiwb 添加到 wheel 组 usermod -G wheel hiwb # 为 hiwb 用户设置密码 passwd hiwb  

查看 wheel 组用户

cat /etc/group | grep wheel  

5. 密码复杂度检查 | 身份鉴别

检查密码长度和密码是否使用多种字符类型
加固建议
安装 pam 的 cracklib 模块,cracklib 能提供额外的密码检查能力

apt install libpam-cracklib  

编辑 /etc/pam.d/common-password 配置文件中包含 password requisite pam_cracklib.so 这一行。配置 minlen(密码最小长度)设置为 9-32 位,ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1,它表示密码必须至少包含一个大写字母(ucredit),一个小写字母(lcredit),一个数字(dcredit)和一个标点符号(ocredit)。如

vim /etc/pam.d/common-password  password 	requisite 	pam_cracklib.so retry=3 minlen=11 difok=3 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1  

6. 检查密码重用是否受限制 | 身份鉴别

强制用户不重用最近使用的密码,降低密码猜测攻击风险
加固建议
/etc/pam.d/common-passwordpassword [success=1 default=ignore] pam_unix.so 这行的末尾配置 remember 参数为

相关内容

热门资讯

黑科技好友“wepoke智能a... 黑科技好友“wepoke智能ai”wepoke黑科技(ai辅助)一直真的有挂(有挂教学)-哔哩哔哩1...
黑科技挂“wepoke黑科技”... 黑科技挂“wepoke黑科技”wepoke软件透明挂价格(透明黑科技)都是是有挂(有挂头条)-哔哩哔...
黑科技模拟器“wepoke智能... 黑科技模拟器“wepoke智能ai”wepoke真的有挂(智能ai)果然是有挂(有挂头条)-哔哩哔哩...
黑科技黑科技“wepoke有没... 黑科技黑科技“wepoke有没有挂”wepoke辅助器(黑科技ai)总是是真的有挂(有挂教学)-哔哩...
黑科技总结“wepoke黑科技... 黑科技总结“wepoke黑科技”wepoke是不是有挂(智能ai)本来是有挂(有挂总结)-哔哩哔哩1...
黑科技计算“wepoke智能a... 黑科技计算“wepoke智能ai”wepoke透视挂怎么测试(ai辅助)原来真的有挂(有挂教学)-哔...
黑科技脚本“wepoke有没有... 黑科技脚本“wepoke有没有挂”wepoke有没有挂(智能ai)原来真的有挂(有挂猫腻)-哔哩哔哩...
黑科技黑科技“wepoke智能... 黑科技黑科技“wepoke智能ai”wepoke有没有辅助挂(黑科技ai)总是存在有挂(发现有挂)-...
黑科技黑科技“wepoke智能... 黑科技黑科技“wepoke智能ai”wepoke透明挂要多少钱(软件透明挂)果然是有挂(真的有挂)-...
黑科技神器“wepoke透明黑... 黑科技神器“wepoke透明黑科技”wepoke透明挂软件(透明挂)果然是有挂(真的有挂)-哔哩哔哩...