[命令] Linux 命令 nestat (显示本地端口,以及其 PID 信息等)

案例一

$ netstat -ntulap
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:7001            0.0.0.0:*               LISTEN      1250/nxnode.bin     
tcp        0      0 127.0.0.1:25001         0.0.0.0:*               LISTEN      1345/nxrunner.bin   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:3001          0.0.0.0:*               LISTEN      1316/pipewire
......


补充:
1) -n 不解析名称
2) -t 显示 tcp 端口
3) -u 显示 udp 端口
4) -l 显示服务器接口
5) -a 显示所有接口
6) -p 显示 PID 或者程序名称的接口

案例二

mingyuzhu@mingyuzhu:~$ netstat -W -neopa
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name     Timer
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      991        6431       -                    off (0.00/0/0)
tcp        0      0 0.0.0.0:7001            0.0.0.0:*               LISTEN      1001       11218      1250/nxnode.bin      off (0.00/0/0)
tcp        0      0 127.0.0.1:25001         0.0.0.0:*               LISTEN      1001       11498      1345/nxrunner.bin    off (0.00/0/0)
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      0          6018433    -                    off (0.00/0/0)
tcp        0      0 127.0.0.1:3001          0.0.0.0:*               LISTEN      1001       12293      1316/pipewire        off (0.00/0/0)
tcp        0      0 0.0.0.0:4000            0.0.0.0:*               LISTEN      121        11121      -                    off (0.00/0/0)
tcp        0      0 127.0.0.1:26001         0.0.0.0:*               LISTEN      1001       11426      1250/nxnode.bin      off (0.00/0/0)
tcp        0      0 127.0.0.1:26002         0.0.0.0:*               LISTEN      1001       6513629    1065010/nxnode.bin   off (0.00/0/0)
......


补充:
1) -W 不缩写 IP 地址
2) -n 不解析名称
3) -e 显示更多的信息
4) -o 显示计时器
5) -p 显示 PID 或者程序名称的接口
6) -a 显示所有接

[命令] Linux 命令 ss (显示本地端口,以及其 PID 信息等)

案例一

$ ss -ntulap
Netid  State      Recv-Q   Send-Q     Local Address:Port         Peer Address:Port   Process                                                                              
udp    UNCONN     188672   0          80.66.196.238:5353              0.0.0.0:*                                                                                           
udp    UNCONN     0        0                0.0.0.0:5353              0.0.0.0:*                                                                                           
udp    UNCONN     0        0                0.0.0.0:5353              0.0.0.0:*                                                                                           
udp    UNCONN     0        0                0.0.0.0:4000              0.0.0.0:*                                                                                           
udp    UNCONN     0        0                0.0.0.0:4011              0.0.0.0:*       users:(("nxnode.bin",pid=1065010,fd=27),("nxnode.bin",pid=1250,fd=70))              
......


补充:
1) -n 不解析名称
2) -t 显示 tcp 端口
3) -u 显示 udp 端口
4) -l 显示服务器接口
5) -a 显示所有接
6) -p 显示 PID 或者程序名称的接口

[CONTENT] The network connections required for system register

Content:

RHEL:

DomainPort NumberPort protocol
subscription.rhsm.redhat.com443TCP
cdn.redhat.com443TCP
RHEL Register Connections Requirement

SLES:

DomainPort NumberPort protocol
scc.suse.com80 or 443
TCP
updates.suse.com80 or 443
TCP
installer-updates.suse.com80 or 443TCP
SLES Register Connections Requirement

Reference:

https://access.redhat.com/solutions/65300

https://www.suse.com/support/kb/doc/?id=000021034#:~:text=%2A%20The%20current%20list%20of%20IPs,for%20scc.suse.com%20and%20registry.suse.com%20are%3A%2099.83.188.102