Ubuntu and Open ports
For security reasons you may want to check the open ports on your machine and validate that applications using them. To scan your open ports you can use the following command:
sudo nmap -sV localhost
Namp will scan the machines open ports using the “-sV” parameter will also display the applications using the open ports and their version. Once you execute the command you should get a list similar to what I have here:
PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.2.0 22/tcp open ssh OpenSSH 5.1p1 Debian 6ubuntu2 (protocol 2.0) 80/tcp open http Apache httpd 2.2.12 ((Ubuntu)) 3306/tcp open mysql MySQL 5.1.37-1ubuntu5.1
You should go through the list and if there are any applications which you don’t recognize you can always Google their name and see if you want them to be using the open ports or not.
You could also use netstat to see your open ports. For instance:
sudo netstat -tap
would return similar results.