Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Stop wondering which process is hogging your ephemeral ports
🧩 The Challenge
Dealing with a service that suddenly stops accepting connections because it ran out of ports is pure misery. You look at the app, everything looks fine, but the connections are just hanging in limbo.
💡 The Fix
You need to peek at the socket statistics to see who is actually holding onto those TCP connections. It cuts through the noise so you can see exactly which PID is refusing to let go.
ss -tulpn | grep :[port_number]
⚙️ Why It Works
This command forces the kernel to dump the raw socket state without the usual netstat overhead. It effectively filters for the specific port, showing you the exact process name and PID currently squatting on that socket.
🚀 Pro-Tip: Add the -o flag if you need to see the actual TCP timer states like keepalive or retransmits.
Linux Tips & Tricks | © ngelinux.com | 12/4/2026
