Networking

ss

Utility to investigate socket connections, replacing legacy netstat.

COMMAND SYNTAX
$ ss [options] [FILTER]

Common Options & Flags

Option / FlagDescription
-tDisplay TCP sockets
-uDisplay UDP sockets
-lDisplay listening sockets only
-pShow process using socket (requires root)
-nDo not resolve service names (show numeric ports)

Practical Command Examples

$ ss -tulpn

List all listening TCP and UDP sockets with numeric port numbers and associated PIDs.

$ ss -tulpn | grep :80

Check which process is listening on HTTP port 80.

Production Real-World Use Case

Diagnosing port binding conflicts, checking listening services, and verifying firewall bindings.

Common Mistakes

  • ✕Running without sudo, which hides process names (Users/PIDs) bound to ports.

Security Considerations

Audit all open listening ports to shut down unnecessary public listeners.