List listening ports on linux

What is this server actually exposing to the world?

SNP 080 #259 Filed cmd network linux

shell
sudo ss -tulpn
  • t TCP, u UDP
  • l only listening sockets
  • p the process behind it (needs sudo to see other users' processes)
  • n numbers instead of service names

Anything on 0.0.0.0 or [::] listens on every interface, 127.0.0.1 only locally. A database on 0.0.0.0:3306 without a firewall is how you end up in a breach report.

netstat -tulpn is the old version of the same command, if ss is somehow missing.