هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
The quick answer
Replace 8080 with your port. Run as root (with sudo), or you will not see the process names of other users:
ss -ltnp 'sport = :8080'
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 511 0.0.0.0:8080 0.0.0.0:* users:(("nginx",pid=1432,fd=6),("nginx",pid=1431,fd=6))
lsof -i :8080
fuser -v 8080/tcpHere the answer is nginx, process IDs 1431 and 1432. For UDP ports use ss -lunp 'sport = :53'.
Step by step
- List every listening port with its program — a good overview first:
ss -ltnup| Option | Meaning |
|---|---|
-l | Only listening sockets (servers). |
-t / -u | TCP / UDP. |
-n | Show numbers (port 443), not names (https) — faster and clearer. |
-p | Show the process (needs root for other users' processes). |
- Read the Local Address column.
0.0.0.0:8080or*:8080= open on all network cards.127.0.0.1:8080= only from this server.[::]:8080= IPv6 (often also IPv4). - Find out what the process is — its full command and which systemd service started it:
ps -o pid,user,etime,cmd -p 1431
systemctl status 1431
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Mon 2026-11-17 08:12:01 +03; 2h agosystemctl status PID shows the unit that owns the process — now you know which service to stop, restart or reconfigure.
- Is it a container? If the process is
docker-proxy,conmon,rootlessportorcontainerd, a container published the port:
docker ps --filter publish=8080
docker port web
podman ps --format '{{.Names}} {{.Ports}}'
kubectl get svc -A | grep 30080- Decide what to do: stop or disable the other service (
systemctl disable --now NAME), change the port of one of the two programs, or bind your app to127.0.0.1if only a local proxy needs it.
On RHEL and Ubuntu, ss is always installed (package iproute/iproute2). lsof may need dnf install lsof / apt install lsof. The old netstat -tlnp (package net-tools) still works but is no longer installed by default.
Check that it worked
Common problems
| Problem | Cause | Fix |
|---|---|---|
| The Process column is empty | You are not root. | Run with sudo. |
| The port shows nothing, but the app says "Address already in use" | Another IP/IPv6 binding, or the port was busy only a moment (TIME_WAIT). | Check ss -ltnp without a filter; wait a few seconds; set SO_REUSEADDR in your app. |
The process is systemd (PID 1) | Socket activation: systemd listens and starts the service on the first connection (for example ssh.socket, cockpit.socket). | systemctl list-sockets; stop/disable the .socket unit. |
The process is docker-proxy | A container published the port. | docker ps --filter publish=PORT; stop it or change -p. |
| The port is listening, but other hosts can not connect | Bound to 127.0.0.1, or the firewall blocks it. | Check the Local Address; open the port: see "How to open a port in the firewall". |
A custom port does not start on RHEL: Permission denied | SELinux allows a service only its known ports. | semanage port -a -t http_port_t -p tcp 8081 (type depends on the service). |
Go further
- Command pages: ss, lsof, fuser, systemctl.
- Next how-tos: Test if a remote port is open, Open a port in the firewall, Start, stop and restart a service, Kill a process that hangs, List open network connections.
- Full guides: Nginx (port 80/443 conflicts), Docker (published ports).
- Learn the basics: RH124 — Check ports and services.
1Why does ss -ltnp show no process names for some ports?
You are not root; only root may see other users' processes. Use sudo.
2The listening process is systemd. What does that mean?
Socket activation — a .socket unit holds the port and starts the service on demand.