How to check open ports on Linux with ss, netstat, and Open Port Scanner
Linux provides built-in socket inspection tools for local processes, but auditing remote network nodes or finding all active ports across a local subnet requires a different toolkit. Here is how to handle both.
Download Open Port Scanner for Linux
Standalone x64 binary (~2.8 MB) • No dependencies • CLI & GUI
Method 1: Modern socket statistics with ss
On modern Linux systems (Ubuntu 20.04+, Debian 11+, RHEL/CentOS 8+), ss replaces the deprecated netstat utility. It queries socket information directly from kernel space:
# Show all TCP ports in LISTEN state with PID/Process name:
sudo ss -tulpn | grep LISTEN
# Filter for a specific port number (e.g. 5432):
ss -tlpn '( sport = :5432 )'
# Display numeric addresses and ports without slow DNS lookups:
ss -tln
Method 2: Check process ownership with lsof
# Find which process has bound to port 80 or 443:
sudo lsof -i :80
sudo lsof -i :443
Method 3: Multi-host subnet auditing with Open Port Scanner
While ss tells you what is happening on your local server, Open Port Scanner sweeps remote hosts, other VMs, Docker containers, and entire subnets without requiring root privileges:
# Install via Cargo or download standalone binary:
cargo install open-port-scanner
# Scan entire local subnet automatically:
port-scanner --lan --profile quick
# Audit a database server across common ports and export JSON:
port-scanner 10.0.0.15 -p 3306,5432,6379,27017 -o db-audit.json
# Launch the desktop UI (X11 / Wayland):
port-scanner --gui
Comparison summary
- ss / lsof: Essential for checking local server sockets and troubleshooting port conflict errors (e.g.
address already in use). - Open Port Scanner: Ideal for cross-network verification, firewall validation, subnet mapping, and automated JSON auditing.