Check open ports
Thursday, March 13th, 2008Are there any open ports that shouldn’t be open? Check with:
sudo netstat -tupl
Results in something like:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:mysql *:* LISTEN 5077/mysqld
tcp 0 0 localhost:ipp *:* LISTEN 5001/cupsd
udp 0 0 *:32768 *:* 5324/avahi-daemon:
udp 0 0 *:bootpc *:* 5875/dhclient
udp 0 0 *:mdns *:* 5324/avahi-daemon:
Kill the process that is using the port
kill (PID here)
List open files:
lsof -i
where the -i makes it list internet files.