That ss -ltnpe trick is pretty handy. I’ve definitely wasted time wondering what was holding a port. Does this work the same way when the service is running inside a more complex Docker setup?
Who owns that port? One ss flag answers it without sudo
2 Comments
@[Itay] Mostly, with two cases where it changes. With Docker's default userland proxy, the host socket belongs to docker-proxy, so ss -ltnpe shows docker.service as the cgroup and docker ps names the container. That's the case I hit. If the daemon runs with userland-proxy disabled, there may be no listening socket on the host at all, because the port is forwarded by NAT rules, so ss can come back empty while the port is still reachable. There, docker ps --format '{{.Names}}\t{{.Ports}}' is the check. With --network host the container's own process holds the socket, so -e should show the container's scope instead of docker.service. I haven't tested those two on my machine; they come from Docker's docs
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
a free and growing library of copy-paste bash scripts with plain-English explanations. No logins, no paywalls, just scripts that work. I post a new one every week on YouTube & TikTok @BashSnippets. Show less
More From BashSnippets
Related Jobs
- Software Support Analyst IMark43 · Full time · Charleston, WV
- IT Services Senior Manager/Cloud Computing Support LeadASM Research, An Accenture Federal Services Company · Full time · Springfield, IL
- Software Development Engineer, Prime Video SportsAmazon · Full time · Springfield, IL
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!