What is the command to display a list of open ports on a Debian server?
I tried netstat -a | egrep 'Proto|LISTEN' but I would like something more specific that actually lists the port number.
|
What is the command to display a list of open ports on a Debian server? I tried |
||||
|
|
-l will list listening ports, -p will also display the process, -n will show port numbers instead of names. Add -t to only show TCP ports. |
|||||
|
|
Check the man page for |
|||
|
|
|
You can do:
or simply:
which will give you all listening sockets on the system. |
|||||
|
|
What almost everybody wants (TCP and UDP) is I use it every day, maybe every hour. The 'lsof' hack is more portable (works on Solaris too), but on Debian it's not an essential package, you have to install it. |
|||||
|
|
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. |
|||||||
|