Jump to content

How to List Open Ports on your Mac


Recommended Posts

Sometimes its helpful to know what ports on your Mac are in LISTENING status. So here are a few commands that I found helpful in my quest to find what ports are open.

$ netstat -atp tcp | grep -i "listen"
tcp4       0      0  *.irdmi                *.*                    LISTEN
tcp4       0      0  localhost.49155        *.*                    LISTEN
tcp4       0      0  localhost.49154        *.*                    LISTEN
tcp4       0      0  localhost.49153        *.*                    LISTEN
tcp4       0      0  localhost.49152        *.*                    LISTEN
tcp4       0      0  *.kerberos             *.*                    LISTEN
tcp6       0      0  *.kerberos             *.*                    LISTEN
tcp4       0      0  *.ssh                  *.*                    LISTEN
tcp6       0      0  *.ssh                  *.*                    LISTEN
tcp4       0      0  localhost.ipp          *.*                    LISTEN
tcp6       0      0  localhost.ipp          *.*                    LISTEN
tcp4       0      0  *.rfb                  *.*                    LISTEN
tcp6       0      0  *.rfb                  *.*                    LISTEN           

And also I used

$ sudo lsof -i -P | grep -i "listen"
Password:
launchd      1           root   26u  IPv6 0x6a234a812945c29f      0t0    TCP *:5900 (LISTEN)
launchd      1           root   28u  IPv4 0x6a234a81294621ef      0t0    TCP *:5900 (LISTEN)
launchd      1           root   30u  IPv6 0x6a234a812945c29f      0t0    TCP *:5900 (LISTEN)
launchd      1           root   31u  IPv4 0x6a234a81294621ef      0t0    TCP *:5900 (LISTEN)
launchd      1           root   43u  IPv6 0x6a234a812945b89f      0t0    TCP *:22 (LISTEN)
launchd      1           root   46u  IPv4 0x6a234a812946104f      0t0    TCP *:22 (LISTEN)
launchd      1           root   52u  IPv4 0x6a234a812946191f      0t0    TCP localhost:631 (LISTEN)
launchd      1           root   53u  IPv6 0x6a234a812945bd9f      0t0    TCP localhost:631 (LISTEN)
launchd      1           root   54u  IPv6 0x6a234a812945bd9f      0t0    TCP localhost:631 (LISTEN)
launchd      1           root   55u  IPv6 0x6a234a812945b89f      0t0    TCP *:22 (LISTEN)
launchd      1           root   56u  IPv4 0x6a234a812946104f      0t0    TCP *:22 (LISTEN)
launchd      1           root   59u  IPv4 0x6a234a812946191f      0t0    TCP localhost:631 (LISTEN)
pma_agent   70           root   19u  IPv4 0x6a234a812945db6f      0t0    TCP *:8000 (LISTEN)
bcua-serv   76           root   16u  IPv4 0x6a234a812945e43f      0t0    TCP localhost:49154 (LISTEN)
bcua-serv   76           root   19u  IPv4 0x6a234a812945feaf      0t0    TCP localhost:49155 (LISTEN)
mtmfs       79           root    4u  IPv4 0x6a234a812945f5df      0t0    TCP localhost:49152 (LISTEN)
mtmfs       79           root    6u  IPv4 0x6a234a812945ed0f      0t0    TCP localhost:49153 (LISTEN)
kdc         96           root    6u  IPv6 0x6a234a812945b39f      0t0    TCP *:88 (LISTEN)
kdc         96           root    8u  IPv4 0x6a234a812946077f      0t0    TCP *:88 (LISTEN)       

Link to post
Share on other sites

Announcements


×
×
  • Create New...