ITPub博客

首页 > IT基础架构 > > Linux系统的一般性安全加固

Linux系统的一般性安全加固

作者:yuanxueming 时间:2019-09-16 17:27:27 0 删除 编辑

编辑文件; /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。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2687/viewspace-3123604/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-07-25

  • 博文量
    89
  • 访问量
    818