系统安全性测试

更新时间:2023-07-26 03:48:18 阅读: 评论:0

系统安全性
1 设置登录超时退出机制
/etc/profile 中加入:
TMOUT=180  ---3 分钟无操作,退出
source /etc/profile  --即时生效
2 历史记录
/etc/profile 中修改:
HISTSIZE=30  ---保留历史记录30条
source /etc/profile  --即时生效
3 登录策略
/etc/pam.d/system-auth中:
auth        required      pam_env.so 下面添加:
auth        required      pam_tally.so onerr=fail no_magic_root deny=3 unlock_time=300  ----账户连续3次输入密码错误,锁定5分钟
4 账户策略
/etc/login.defs 中修改:
PASS_MAX_DAYS  90  #新建用户的密码最长使用天数 PASS_MIN_DAYS  0    #新建用户的密码最短使用天数
PASS_MIN_LEN    8  #密码最小长度
PASS_WARN_AGE  7    #新建用户的密码到期提前提醒天数
/etc/pam.d/system-auth韩国大邱大学 中添加
十二生肖的动画片
password    requisite    pam_cracklib.so try_first_pass retry=3 minlen=8 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1
---passwd最小长度为8--
password    requisite    pam_cracklib.so try_first_pass retry=3 minlen=8 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1 difok=3
---新密码和旧密码不能有3个以上字符重复---
password sufficient pam_unix.so md5 shadow nullok try_first_pass u_authtok remember=5
---以前的5次之内的密码不能使用---
此设置如果要生效还依赖于一个文件,/etc/curity/opasswd,如果不存在, 自己创建:
日记10字大全
touch /etc/curity/opasswd
chown root:root /etc/curity/opasswd
chmod 600 /etc/curity/opasswd
-
和雪有关的诗句
-------------------------------------------------
配置项说明:
lcredit=-1:小写字母最少1位
ucredit=-1:大写字母最少1位
dcredit=-1:数字最少1位
ocredit=-1:其他字符最少1位
difok=3  :新旧密码不同的位数
minlen=8  :密码的最少位数
-------------------------------------------------------
禁止root登录:   
/etc/ssh/sshd_config 中修改:
PermitRootLogin改成no  重启服务 /etc/rc.d/sshd restart
禁止普通用户su root :
/etc/pam.d/su印度性感美女 中添加:
auth sufficient /lib/curity/pam_rootok.so debug
auth required /lib/curity/pam_wheel.so group=pay
将auth  required  pam_wheel.so u_uid  注释# 去掉
-----仅pay组的用户可以用su作为root---
如果你希望用户test 能够用su作为root,可以运行如下命令
urmod -G10 test
八下物理5 停止服务
chkconfig bluetooth off 
chkconfig firstboot off
chkconfig isdn off
chkconfig pcscd off
chkconfig restorecond off
chkconfig cupsd off
chkconfig mcstrans off
chkconfig avahi-daemon off
锁定无用的用户:
变异的谚语
urmod -L adm
urmod -L lp
urmod -L shutdown
urmod -L halt
urmod -L news
urmod -L uucp
urmod -L operator
urmod -L games
urmod -L gopher
6 监控用户
建立专门的nagios用户:
uradd nagios
没有一天不想你--nagios 用户只能启动nagios服务,不能登录
7 控制用户使用资源限制
/etc/pam.d/login中添加:
ssion    required    pam_limits.so
/etc/ f中添加相应的资源限制:
test  -     nofile      20            ##限制用户打开文件的最大数目为20##
test  -    nproc     20            ##限制用户进程的最大数目为20##
test  -      maxlogins     5         ##限制单个用户登录后,打开窗口数##
test  -    memlock    64000   #限制用户可使用最大内存空间64M#
8 安装clamav防火墙
安装包放在工作机 x盘 保留1个月中:clamav-0.
groupadd clamav

本文发布于:2023-07-26 03:48:18,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1096887.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:用户   密码   限制
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图