我们有红帽7.5服务器
我们怀疑端口50070没有被服务正确关闭(我们通过netstat和PID检查未找到),但是从日志中我们可以看到端口正在使用。
所以我们试着做以下工作--例如,
ss --kill state listening src :50070
ss: unrecognized option '--kill'
Usage: ss [ OPTIONS ]
ss [ OPTIONS ] [ FILTER ]
-h, --help this message
-V, --version output version information
-n, --numeric don't resolve service names
-r, --resolve resolve host names
-a, --all display all sockets
-l, --listening display listening sockets
-o, --options show timer information
-e, --extended show detailed socket information
-m, --memory show socket memory usage
-p, --processes show process using socket
-i, --info show internal TCP information
-s, --summary show socket usage summary
-b, --bpf show bpf filter socket information
-Z, --context display process SELinux security contexts
-z, --contexts display process and socket SELinux security contexts
-N, --net switch to the specified network namespace name
-4, --ipv4 display only IP version 4 sockets
-6, --ipv6 display only IP version 6 sockets
-0, --packet display PACKET sockets
-t, --tcp display only TCP sockets
-u, --udp display only UDP sockets
-d, --dccp display only DCCP sockets
-w, --raw display only RAW sockets
-x, --unix display only Unix domain sockets
-f, --family=FAMILY display sockets of type FAMILY
-A, --query=QUERY, --socket=QUERY
QUERY := {all|inet|tcp|udp|raw|unix|unix_dgram|unix_stream|unix_seqpacket|packet|netlink}[,QUERY]但是ss不包括杀死标志
什么是正确关闭端口或释放孔机端口的选择?
发布于 2020-07-22 08:41:11
不是关闭端口,而是关闭打开它的守护进程/服务。您可以使用firewalld或iptables阻止到端口的通信。
首先,尝试telnet localhost 50070。你能联系上吗?
如果是,请执行以下命令:
sudo ss -tulp
(如果要以root用户身份执行命令,则不需要sudo。-p参数显示进程和需要提升的权限)
找到提到端口50070的线路。如果您有许多侦听端口,请使用grep。最后一列将显示打开端口的名称和PID。杀了这个,它就会关闭。
https://unix.stackexchange.com/questions/599688
复制相似问题