Centos永久禁止ping的设置方法

2015年12月28日12:17:22系统教程评论2,6751

网站的攻击一般是从ping开始的,黑客攻击网站前会先ping下服务器看其是否在线,所以如果服务器禁止ping,可以有效减少服务器被攻击次数。Centos系统默认是允许ping的,如你有服务器root账户管理权限,可以通过修改Centos系统内核参数永久禁止ping。文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

编辑/etc/sysctl.conf,文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

vi /etc/sysctl.conf文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

在/etc/sysctl.conf最后增加以下内容:文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

net.ipv4.icmp_echo_ignore_all=1文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

保存后执行sysctl -p命令使配置生效。文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

sysctl -p文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

配置生效后,ping服务器收不到任何响应,ping被永久禁止。文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

可能某一天你需要服务器允许ping了,可以删除/etc/sysctl.conf文件中的“net.ipv4.icmp_echo_ignore_all=1”或者将其修改为“net.ipv4.icmp_echo_ignore_all=0”,然后执行sysctl -p命令使配置生效,配置生效后服务器又可以正常被ping通了。文章源自堕落的鱼-https://www.duoluodeyu.com/2092.html

匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定