Site icon New Generation Enterprise Linux

Stop wasting time guessing why your local socket is refusing connections

Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)

Stop wasting time guessing why your local socket is refusing connections

đź§© The Challenge

You finally got your app deployed, but every request to localhost is getting a connection refused error. You check the firewall, restart the service, and verify the config file, but nothing shows up in the logs.

đź’ˇ The Fix

Use the socket statistics tool to peer directly into the kernel’s view of the listening ports. It shows you the exact process ID and user owner that’s actually holding the socket.

ss -lptn 'sport = :8080'

⚙️ Why It Works

Adding the numeric flag prevents the tool from trying to resolve port names or DNS, which keeps the output fast even when your resolver is acting up. The -lptn flags force the kernel to dump the listening state, the associated process, and the raw port numbers in one go.

🚀 Pro-Tip: If you don’t see your app in the list, double-check that you aren’t accidentally binding to 127.0.0.1 while the client tries to hit the public interface.

Linux Tips & Tricks | © ngelinux.com | 9/5/2026

0 0 votes
Article Rating
Exit mobile version