NetstatコマンドPID/Program Nameが表示されない理由-root以外のユーザー
参照リンク:https://access.redhat.com/solutions/394093 Why does netstat not show the process PID/Program Name in RHEL
[root@abc ~]# netstat -plnt | head -5
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5899 0.0.0.0:* LISTEN 4877/postgres
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1644/rpcbind
tcp 0 0 0.0.0.0:63124 0.0.0.0:* LISTEN 1701/rpc.statd
[root@abc ~]# netstat -tulp | head -5
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:5899 *:* LISTEN 4877/postgres --->>> user PID/Program name tcp 0 0 *:sunrpc *:* LISTEN 1644/rpcbind
tcp 0 0 *:63124 *:* LISTEN 1701/rpc.statd
[root@abc ~]# su - highgo475 ---->>> highgo475
[highgo475@abc ~]$ netstat -tulp | head -5
(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 (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:5899 *:* LISTEN 4877/postgres --->>> user PID/Program name
tcp 0 0 *:sunrpc *:* LISTEN -
tcp 0 0 *:63124 *:* LISTEN -
[highgo475@abc ~]$ exit
[root@abc ~]# su - highgo432 ---->>> highgo432
[highgo432@abc ~]$ netstat -tulp | head -5
(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 (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:5899 *:* LISTEN - --->>> 。
tcp 0 0 *:sunrpc *:* LISTEN -
tcp 0 0 *:63124 *:* LISTEN -
[highgo432@abc ~]$