when I run something like -

# ss -atur

I get lot of replies of opened ports such as -

udp    UNCONN     0       0                                      *                
udp    UNCONN     0       0                                     *                
udp    UNCONN     0       0                                    *

now while I know that 631 is used by CUPS, have no idea what these other ports are being used for. Is there a way to get the ports known to the application which used them, a kind of reverse-mapping. I am more concerned about local ports being open without a legitimate use. Please let me know if any more info. is needed. I am on Debian testing.

I even tried lsof but with no luck -

How to check port opened on running a service?

I am using lsof 4.93.2 in case if that makes any difference.

For e.g. I tried -

 root@debian:~# lsof -Pi | grep qbittorrent

Now I know that qbittorrent would need to open up at least a few local ports in order to accept data and similarly would be opening up local ports but don't see anything :(

  • 1
    Does your version of the ss command have the -p option? It will map each listed port to a process ID.
    – Haxiel
    May 8 '20 at 8:17
  • it does, thank you for sharing it.
    – shirish
    May 8 '20 at 10:53

The ss command provides an option to map ports to their corresponding processes:

-p, --processes

Show process using socket.

The output will then contain an additional column, which maps each listed port to a specific process ID.

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.