Linux服务器安全防护
禁止ping centos服务器 ip地址
两条命令搞定,主要是下面第一条
echo 'net.ipv4.icmp_echo_ignore_all = 1' >>/etc/sysctl.conf
sysctl -p
[root@localhost ~]# cat /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
net.ipv6.conf.lo.disable_ipv6=0
kernel.printk = 5
[root@localhost ~]#
[root@localhost ~]# echo 'net.ipv4.icmp_echo_ignore_all = 1' >>/etc/sysctl.conf
[root@localhost ~]#
[root@localhost ~]# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
kernel.printk = 5
net.ipv4.icmp_echo_ignore_all = 1
[root@localhost ~]#
[root@localhost ~]# cat sysctl.conf
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
net.ipv6.conf.lo.disable_ipv6=0
kernel.printk = 5
net.ipv4.icmp_echo_ignore_all = 1
[root@localhost ~]#