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]
e.g.
$ 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.
Awesome.
Ok, I tried all this, but the dishwasher still won’t start….
Hahah try rebooting it three times
Yeah this is the trouble with me only having 1 blog. Sometimes it gets real nerdy up in here.