Linux安全设置
1、删除系统特殊的的用户和组1userdelusername2userdeladm3userdellp4userdelsync5userdelshutdown6userdelhalt7userdelnews8userdeluucp9userdeloperator10userdelgames11userdelgopher以上所删除用户为系统默认创建,但是在常用服务器中基本不使用的一些帐号,但是这些帐号常被黑客利用和攻击服务器。12groupdelusername13groupdeladm14groupdellp15groupdelnews16groupdeluucp17groupdelgames18groupdeldip同样,以上删除的是系统安装是默认创建的一些组帐号。这样就减少受攻击的机会。
2、服务管理关闭系统不使用的服务1chkconfiglevel35apmdoff2chkconfiglevel35netfsoff3chkconfiglevel35yppasswddoff4chkconfiglevel35ypservoff5chkconfiglevel35dhcpdoff?6chkconfiglevel35portmapoff7chkconfiglevel35lpdoff8chkconfiglevel35nfsoff9chkconfiglevel35sendmailoff10chkconfiglevel35snmpdoff11chkconfiglevel35rstatdoff12chkconfiglevel35atdoff??
3、定期更新系统yum-yupdate,可以加入到cronjob。
4、LAMP安全系统文件权限修改init目录文件执行权限1chmod-R700/etc/init.d/*修改部分系统文件的SUID和SGID的权限2chmoda-s/usr/bin/chage3chmoda-s/usr/bin/gpasswd4chmoda-s/usr/bin/wall5chmoda-s/usr/bin/chfn6chmoda-s/usr/bin/chsh7chmoda-s/usr/bin/newgrp8chmoda-s/usr/bin/write9chmoda-s/usr/sbin/usernetctl10chmoda-s/usr/sbin/traceroute11chmoda-s/bin/mount12chmoda-s/bin/umount13chmoda-s/bin/ping14chmoda-s/sbin/netreport
5、修改系统引导文件1chmod600/etc/grub.conf2chattr+i/etc/grub.conf