使用特定端口识别进程

时间:2017-09-30 05:52:29

标签: macos ports

我知道已经提出了类似的问题,但我仍然无法解决这个问题。

我正在尝试实例化一个docker容器,该容器需要在主机端口上的8443上进行端口绑定,但是我得到以下错误

Error starting userland proxy: Bind for 0.0.0.0:8443 failed: port is already allocated.

当我尝试诊断正在使用的端口时

enter image description here

似乎没有与此端口关联的任何进程。

enter image description here

也试过lsof -i

enter image description here

我该怎么做才能诊断这个端口。我目前在mac

使用不带过滤器的lsof进行了更新 enter image description here

1 个答案:

答案 0 :(得分:-1)

netstat通过遍历/proc伪文件系统并查询进程的内部状态,找出哪个进程拥有特定端口。出于显而易见的原因,除非您是root,否则无法查询进程的内部状态(不属于您的进程)。从您从$开始的提示判断,您没有以root身份运行netstat

以root身份重新运行该命令,该进程应该出现。

相关问题