|
Linux HowTo's -
Beginner Linux HowTo's
|
|
Written by dexxtreme dexxtreme
|
|
Saturday, 24 May 2008 05:21 |
|
To list all open network ports on your machine, run netstat -lnptu. Here is a breakdown of the parameters:
l - List all listening ports
n - Display the numeric IP addresses (i.e., don't do reverse DNS lookups)
p - List the process name that is attached to that port
t - List all TCP connections
u - List all UDP connections
In this example, there are a number of open ports. For example, you can see:
print server (lpd on port 515)
rsync server (rsyncd on port 873)
database server (mysqld on localhost port 3306)
web server (httpd on port 80)
dns server (named on port 53)
openssh (sshd on port 22)
syslog (syslog-ng on port 514)
snmp (snmpd on port 161)
dhcp server (dhcpd on port 67)
tftp server (in.tftpd on port 69)
time server (ntpd on port 123)
several services related to importing an NFS filesystem
You can also change the "l" to an "a" to list both listening and active ports.
You can also use netstat to show the current routing table by running netstat -rn:

|
|
Last Updated ( Sunday, 25 May 2008 01:09 )
|