Sometimes you need to know what your server is serving.
That is, what applications or programs are running on the server that are accessed over the network and what port are they listening on.
I’m used to netstat on Windows, lets give that a try
[[email protected] hassconfig]# netstat -a -bash: netstat: command not found
OK, so lets
Which first result gives me
It seems on CentOS7 the classic netstat has been replaced by the iproute2 suite. Thanks slm.
So we now have a list of CentOS 7 networking commands
How to view just listening ports using ss
which gives me
And in the excellent article i can see the command i need
[[email protected] hassconfig]# ss -4 state listening Netid Recv-Q Send-Q Local Address:Port Peer Address:Port tcp 0 128 *:8123 *:* tcp 0 50 *:microsoft-ds *:* tcp 0 50 *:netbios-ssn *:* tcp 0 128 *:ssh *:* tcp 0 100 127.0.0.1:smtp *:*
This tells me on IPv4 my server is listening on ports 8123, 445 (microsoft-ds), 139 (netbios-ssn), 22 (ssh) and (probably) 25 (smtp) on the loopback interface.