What is the command to display a list of open ports on a Debian server?
netstat -a | egrep 'Proto|LISTEN' but I would like something more specific that actually lists the port number.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
I'm a big fan on
netstat -ntlp and
lsof -i, both mentioned already.
A new(er) command to me is ss.
The invocation is like:
It's good to have options, in terms of commands and flags.
TechRepulic has a decent article that you can find here. It has some similar commands as you listed above but also a few variations. I would also highly recommend using nmap to do a port scan of the computer in question so you can see from an external perspective what ports are open and listening.