Stop guessing why your connection is stuck in a loop
Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Stop guessing why your connection is stuck in a loop
🧩 The Challenge
You’ve been staring at a connection that just won’t close, and no matter how many times you restart the service, the state stays stuck in FIN-WAIT or worse, keeps holding onto a port. I’ve lost hours tracking down sockets that refuse to die because I didn’t realize they were waiting on a keepalive.
💡 The Fix
Use the socket statistics utility with specific flags to identify exactly which process is keeping the connection warm when it should be cold. It saves you from rebooting a perfectly good server just to clear a hung port.
ss -tulpn | grep :80
⚙️ Why It Works
Adding the -p flag forces the kernel to cough up the actual process ID responsible for that socket. Seeing the PID next to the port lets you kill the actual offender instead of playing whack-a-mole with the whole application.
🚀 Pro-Tip: Pipe it into column -t if you’re tired of the messy, unreadable output alignment.
Linux Tips & Tricks | © ngelinux.com | 9/8/2026
