1

Some program was connected from my local ip 111.111.111.111 with 130.239.18.176:80,how to get the pid number?

 netstat  -np
(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 (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 111.111.111.111:46243    52.89.80.240:443        TIME_WAIT   -               
tcp        0      1 111.111.111.111:36553    173.239.79.210:443      SYN_SENT    2630/firefox-esr
tcp        0      0 111.111.111.111:48470    130.239.18.176:80       ESTABLISHED -               
tcp        0      1 111.111.111.111:36552    173.239.79.210:443      SYN_SENT    2630/firefox-esr
tcp        0      1 111.111.111.111:34202    74.125.204.101:80       SYN_SENT    2630/firefox-esr
tcp        0      0 111.111.111.111:52243    203.208.48.79:443       ESTABLISHED 2630/firefox-esr
tcp        0      1 111.111.111.111:46521    74.125.203.93:443       SYN_SENT    2630/firefox-esr
tcp        0      1 111.111.111.111:34200    74.125.204.101:80       SYN_SENT    2630/firefox-esr
tcp        0      0 111.111.111.111:48424    130.239.18.176:80       ESTABLISHED -               
tcp        0      0 111.111.111.111:46238    52.89.80.240:443        TIME_WAIT   -               
tcp        0      1 111.111.111.111:46523    74.125.203.93:443       SYN_SENT    2630/firefox-esr
tcp        0      0 111.111.111.111:34204    74.125.204.101:80       TIME_WAIT   -               
tcp        0      0 111.111.111.111:33700    104.24.98.177:443       ESTABLISHED 2630/firefox-esr
tcp        0      1 111.111.111.111:34206    74.125.204.101:80       SYN_SENT    2630/firefox-esr
tcp        0      0 127.0.0.1:49941         127.0.0.1:80            ESTABLISHED 2630/firefox-esr
  • 1
    Like the message says: "you would have to be root to see it all". Try sudo netstat -np. – ridgy Feb 28 '17 at 10:52
  • The quoted block has a PID column already - and no edition log?. Are we still looking for something here? – SYN Feb 28 '17 at 12:04
1

The netstat output explains it fairly well:

(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.)

Just run it as root (e.g. sudo netstat -np)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.