-3

I have a conflict between the mail server and one more service.

netstat -ltnp | grep -w ': 25'

Conclusion:

(Not all processes could be identified, non-owned process info
  will not be shown, you would have to be root to see it all.)
tcp6 0 0 ::: 25 ::: * LISTEN -
The problem is that I do not know who is listening on port 25. How can this be determined?

I fixed it:

sudo netstat -tulpn | grep LISTEN
[sudo] password for eurvanov: 
tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      2967/java           
tcp        0      0 127.0.0.1:5939          0.0.0.0:*               LISTEN      1445/teamviewerd    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      583/systemd-resolve 
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      709/cupsd           
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      7935/master         
tcp        0      0 127.0.0.1:9050          0.0.0.0:*               LISTEN      955/tor             
tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      2967/java           
tcp        0      0 0.0.0.0:45577           0.0.0.0:*               LISTEN      2967/java           
tcp6       0      0 ::1:631                 :::*                    LISTEN      709/cupsd           
tcp6       0      0 :::25                   :::*                    LISTEN      7935/master         
tcp6       0      0 :::10012                :::*                    LISTEN      2199/docker-proxy  
4
  • Hi, what OS it's ? as on an Windows OS netstat return a PID, which if your process ID (that is findable in taskmgr)
    – yagmoth555
    Aug 29, 2019 at 18:51
  • os: ubuntu18.04 Aug 29, 2019 at 18:53
  • To cite from the output of netstat: "Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all". This clearly says what you need to do: run netstat as root. Aug 29, 2019 at 18:57
  • Yes, i was found it. This is postfix process Aug 29, 2019 at 18:58

1 Answer 1

3

You can't see processes in deprecated netstat (or current ss) output if you are not root and aren't the process owner.

To see the process information for all processes, you need to run it as root, e.g. with sudo. For example:

sudo netstat -ltnp | grep -w ': 25'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .