brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: ss -tulpn lists every listening port with its process, the first security audit

Security
~/tips/tip-security-ss-tulpn-listening-ports

sudo ss -tulpn

Lists open ports and the programs behind them, the starting point for an exposure review.

Before I add a firewall rule, I want to know which services listen at all.

sudo ss -tulpn
sudo ss -tlnp | grep -v -e '127.0.0.1' -e '\[::1\]'

-t and -u select TCP and UDP, -l only listening sockets, -n keeps numbers instead of names and -p shows the process. The second line drops lines containing 127.0.0.1 or [::1], which leaves most services that other machines can reach. Other loopback addresses such as 127.0.0.53 still show up.

Without sudo the process column stays empty for other users’ programs. Ports published by Docker often show up as docker-proxy. Docker publishes them through its own iptables rules, which ufw does not filter, so check them here instead of trusting the firewall status.

Further reading: ss manual page

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link