Linux系统安全 
使用GRUB口令 
编辑 /boot/grub/grub.conf,加入以下语句 
password 12345 
删除所有的特殊帐户 
包括lp,shutdown,halt,news,uucp,operator,games,gopher等 
[root@redhat root]# userdel lp 
[root@redhat root]# groupdel lp 
修改默认root密码长度 
默认root密码长度是5位,建议修改为8位 
编辑/etc/login.defs,修改 
PASS_MIN_LEN 5 
为 
PASS_MIN_LEN 8 
打开密码shadow支持功能 
利用md5算法加密 
为shadow文件添加不可更改属性 
[root@redhat root]# chattr +i /etc/shadow 
取消所有不需要的服务 
telnet、http等默认启动的服务 
关闭telnet,编辑/etc/xinetd.d/telnet,修改 
disable = no 
为 
disable = yes 
更改/etc/xinetd.conf的权限为600,只允许root来读写该文件 
[root@redhat root]# chmod 600 /etc/xinetd.conf 
关闭HTTP、FTP等服务 
屏蔽系统信息 
登录信息包括Linux发行版、内核版本名和服务器主机名等 
[root@redhat root]# rm /etc/issue 
[root@redhat root]# rm /etc/issue.net 
禁止按Ctrl+Alt+Del键关闭系统 
编辑/etc/inittab,将 
ca::ctrlaltdel:/sbin/shutdown -t3 -r now 
改为 
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now 
不允许root从不同的控制台进行登录 
编辑/etc/securetty,在不需要登录的TTY设备前添加#,禁止从该TTY设备进行root登录 
使用SSH进行远程连接 
通过SSH客户端软件连接Linux 
在Linux下利用以下命令连接其他Linux 
[root@redhat root]# ssh –l root 192.168.2.180 
禁止随意通过su命令将普通用户变为root用户 
编辑/etc/pam.d/su,加入以下内容 
auth sufficient /lib/security/pam_rootok.so debug 
auth required /lib/security/pam_wheel.so group=wheel 
(wheel为系统中隐含的组,只有wheel组的成员才能用su命令成为root) 
配置防火墙 
利用iptables防火墙 
保持最新的系统内核 
随时关注Linux网站上内核更新