Linux系统加固

为空口令用户设置密码
1 | cat /etc/passwd |
缺省密码长度限制
1 | vim /etc/login.defs |
缺省密码生存周期限制
1 | vim /etc/login.defs |
口令过期提醒
1 | vim /etc/login.defs |
限制超级管理员远程登录
1 | vim /etc/ssh/sshd_config |
为不同的管理员分配不同的账户
1 | cat /etc/passwd |
去除不需要的帐号、修改默认帐号的shell变量
1 | cat /etc/passwd |
对系统账号进行登陆限制
1 | 禁止某用户登陆 |
设置关键目录的权限
1 | 关键目录: |
设置目录权限
1 | ls -l查看权限 |
设置关键文件的属性
禁止ping
1 | # echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all 开启 |
初始化
1 | > iptables -F #清空所有的链 |
关掉全部端口
1 | > iptables -P INPUT DROP |
开启端口第一步
1 | iptables -A INPUT -p icmp --icmp-type any -j ACCEPT |
关闭端口号
1 | iptables -I INPUT -i eth0 -p tcp --dport 81 -j DROP |
打开端口号
1 | iptables -I INPUT -i eth0 -p tcp --dport 81 -j ACCEPT |
- Post title:Linux系统加固
- Post author:langu_xyz
- Create time:2016-09-01 21:00:00
- Post link:https://blog.langu.xyz/Linux系统加固/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.