1.禁用ping,vi /etc/rc.d/rc.local下添加一行:echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all,0表示运行,1表示禁用
2.关闭系统不需要的服务
service acpid stop chkconfig acpid off #停止服务,取消开机启动 service autofs stop chkconfig autofs off #停用自动挂载档案系统与周边装置 service bluetooth stop chkconfig bluetooth off #停用Bluetooth蓝牙 service cpuspeed stop chkconfig cpuspeed off #停用控制CPU速度主要用来省电 service cups stop chkconfig cups off #停用Common UNIX Printing System 使系统支援印表机 service ip6tables stop chkconfig ip6tables off #禁止IPv6
3.修改ssh端口
修改22端口为8822端口,vi /etc/ssh/sshd_config把port 22改为port 8822
service sshd restart
查看端口是否正确,netstat -lnp|grep ssh
4.修改root密码 passwd
密码要包含大小写,数字, 各种符号拼接,最好没有规则才安全