sudo ss -tulpn
tTCP,uUDPlonly listening socketspthe process behind it (needs sudo to see other users' processes)nnumbers 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.