Saturday, March 11, 2006

Netstat - Ports and Programs running

If you want to check the number of ports your system is listenning
to from foreign hosts and the programs used by it.

[root@mybox conf]# netstat -apln --inet

Active Internet connections (servers and established)

Example : This will list,

tcp------0------0--* -----LISTEN---------4806/master

tcp------0------0--* -----LISTEN---------5008/smbd


Also Try,

#lsof -i

This will list:

-Running Commands
-User running the command
-PID of the Program
-Internet Protocol Version used- eg IPv4, IPv6
-Name of the Program