Nmap or gtfo
When setting up a new server for a Rails application, it is a good idea to see what ports are open in order to configure appropriate firewall rules.
An open source tool called ‘nmap‘ comes in real handy for just such a thing!
After installing nmap (
$ sudo apt-get install nmap on Ubuntu,) running a basic scan against a remote host is simple:
$ nmap [ip of remote host]
$ nmap 192.168.0.1
The output looks like this:
Starting Nmap 5.00 ( http://nmap.org ) at 2011-03-28 20:39 MDT
Interesting ports on yourserver.yourdomain.com (192.168.0.1):
Not shown: 993 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
135/tcp filtered msrpc
... [more open ports]
Nmap done: 1 IP address (1 host up) scanned in 26.05 seconds
Now we can proceed to lock down the irrelevant ports.