首页 运维 网络学院 查看内容

关于端口的关闭——Linux

2014-6-6 09:49 590 0

摘要: 1.关闭服务 service 服务 stop netstat -ntlp kill -9 PID 2.使用两个方法 1. ps aux|grep 端口 ...
关键词: nbsp services service 端口 服务 iptables netstat 8080 etc 12345

1.关闭服务 service 服务 stop netstat -ntlp kill -9 PID 2.使用两个方法 1. ps aux|grep 端口 kill -9 PID 2. iptables -I INPUT -p tcp --dport 端口号 -j DROP 3.查看服务 grep 8080 /etc/services   原帖由 wangyl1977 于 2006-6-18 19:21 发表 grep 8080 /etc/services webcache 8080/tcp # WWW caching service webcache 8080/udp # WWW caching service [quote]原帖由 wumu888 于 2006-6-18 18:54 发表 在services文件里注解 [/quote] 这只是一个 “service_name/protocol & port” 的对照表而已 若你把 apache 的 listen 端口改为 12345,那么 netstat -lp,会看到端口 12345 在监听 若你在 /etc/services 里面添加 12345 端口的说明,前面注释为 platinum,那么 netstat -lp 就会变为 platinum 服务了 若用 iptables 做针对 port 的 DROP 的话,iptables -vL 也会看到同样的效果 这是在 /etc/nsswitch.conf 里面定义的,service 的解析使用 files 这个功能隶属于 /lib/libnss_files.so.1 和 /lib/libnss_files.so.2 关于 /etc/services 有很多人有误解,以为删了/添了一行数据,就可以关掉/开启某个服务,这是错误的概念,我这里说一下 
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部