ss is replacing netstat, how can I get it to list ports similarly to what I am used to?
A recent version of ss
should also display UDP listeners in that way. You can limit to UDP with ss -unlp
.
I have tried a recent Debian version where ss --version
reports ss utility, iproute2-ss140804
and that does work.
On A Red Hat 5 system with ss utility, iproute2-ss061002
it doesn't. You do get more info there using ss -aunp
although that also shows connected ports.
You can also try:
ss -apu state unconnected 'sport = :1812'
Related videos on Youtube
azzid
Updated on September 18, 2022Comments
-
azzid over 1 year
I've been trying to modernise my way with Linux by, for one thing, ditching netstat for ss. I looked up my favourite command line flag for netstat in the ss man pages, and was very glad to find that
netstat -lnp
is more or less the same command asss -lnp
. Or so I thought...# ss -lnp | grep 1812
Turns up nothing, but
# netstat -lnp | grep 1812 udp 0 0 0.0.0.0:1812 0.0.0.0:* 11103/radiusd
does. A fact that made that particular troubleshooting unnecessarily harder.
Now I'm trying to understand how I should have used ss to verify that the daemon was listening.
Can someone please explain?
EDIT:
# ss --version ss utility, iproute2-ss090324 # ss -aunp | grep radi UNCONN 0 0 *:50482 *:* users:(("radiusd",11103,11)) UNCONN 0 0 127.0.0.1:18120 *:* users:(("radiusd",11103,9)) UNCONN 0 0 *:1812 *:* users:(("radiusd",11103,6)) UNCONN 0 0 *:1813 *:* users:(("radiusd",11103,7)) UNCONN 0 0 *:1814 *:* users:(("radiusd",11103,10)) # ss -lnp | grep radi #
-
Admin over 9 yearsDoes
radiusd
show at all inss
?
-
-
Navin over 6 yearsOdd, none of these commands work on a Raspberry Pi with ss version
ss140804
. However, they work perfectly on Fedora with ss versionss170501
. I guess that's what happens when I use three year old software :( -
wurtel over 6 yearsThat's why I wrote "A recent version ..." :-)