linux系统安全加固

1、S位
[root @test / ]#chmod a-s /usr/bin/chage   
[root @test / ]#chmod a-s /usr/bin/gpasswd   
[root @test / ]#chmod a-s /usr/bin/wall   
[root @test / ]#chmod a-s /usr/bin/chfn   
[root @test / ]#chmod a-s /usr/bin/chsh   
[root@test / ]#chmod a-s /usr/bin/newgrp   
[root@test / ]#chmod a-s /usr/bin/write   
[root@test / ]#chmod a-s /usr/sbin/usernetctl   
[root@test / ]#chmod a-s /usr/sbin/traceroute   
[root@test / ]#chmod a-s /bin/mount   
[root@test / ]#chmod a-s /bin/umount     
[root@test / ]#chmod a-s /sbin/netreport 
[root@test / ]#chmod a-s /bin/ping
[root@test / ]#chmod a-s /usr/bin/sudo


2、文件权限

[root@test / ]#chmod 700 /usr/bin/ssh
[root@test / ]#chmod 700 /usr/bin/scp
[root@test / ]#chmod 700 /usr/bin/finger
[root@test / ]#chmod 700 /usr/bin/gcc
[root@test / ]#chmod 700 /sbin/shutdown
[root@test / ]#chmod 700 /sbin/reboot
[root@test / ]#chmod 700 /usr/bin/lsattr




3、目录权限
[root@test / ]#cd /
[root@test / ]#chmod o-r *
[root@test / ]#cd /usr
[root@test / ]#chmod o-r *
[root@test / ]#cd /var
[root@test / ]#chmod o-r *         
[root@test / ]#chmod go-r /usr/local/httpd/conf
[root@test / ]#chmod go-rx /etc/rc.d/init.d
[root@test / ]#chmod o-r /etc/rc.d/init.d/*
[root@test / ]#chmod go-rx /usr/bin/gcc
[root@test / ]#chmod go-rx /usr/bin/g++
[root@test / ]#chmod go-rx /usr/include




4、密码最小长度
[root@test / ]#vi /etc/login.defs
PASS_MIN_LEN  14 


[root@test / ]#chattr +i /etc/passwd
[root@test / ]#chattr +i /etc/group
[root@test / ]#chattr +i /etc/shadow
[root@test / ]#chattr +i /etc/gshadow
[root@test / ]#chattr +i /etc/services

你可能感兴趣的:(linux系统安全加固)