关注安全:加固Linux服务器Unix/Linux
5.禁止Ctrl Alt Delete重新启动机器命令 修改/etc/inittab文件,将“ca::ctrlaltdel:/sbin/shutdown -t3 -r now”一行注释掉。然后重新设置/etc/rc.d/init.d/目录下所有文件的许可权限,运行如下命令: # chmod -R 700 /etc/rc.d/init.d/* 这样便仅有root可以读、写或执行上述所有脚本文件。 6.限制su命令 如果你不想任何人能够用su作为root,可以编辑/etc/pam.d/su文件,增加如下两行: auth sufficient /lib/security/pam_rootok.so debug auth required /lib/security/pam_wheel.so group=isd 这时,仅isd组的用户可以用su作为root。此后,如果你希望用户admin能够用su作为root,可以运行如下命令: # usermod -G10 admin 7.删减登录信息 默认情况下,登录提示信息包括Linux发行版、内核版本名和服务器主机名等。对于一台安全性要求较高的机器来说这样泄漏了过多的信息。可以编辑/etc/rc.d/rc.local将输出系统信息的如下行注释掉。 # This will overwrite /etc/issue at every boot. So,make any changes you # want to make to /etc/issue here or you will lose them when you reboot # echo "">/etc/issue # echo "">>/etc/issue # echo "Kernel 100 100uname -r) on 100 100uname -m)">>/etc/issue # cp -f /etc/issue /etc/issue.net # echo>>/etc/issue 然后,进行如下操作: # rm -f /etc/issue # rm -f /etc/issue.net # touch /etc/issue # touch /etc/issue.net |