Verifying your firewall by port scanning
After your firewall is configured, you may wish to check that you haven't unintentionally left any unnecessary open doors. A good way to do this is to initiate a scan from another machine that will tell you what open ports it discovered on your server. Only ports associated with services that you want to make publicly accessible should be found.
Getting ready
We will be using two machines in this recipe. One will be the scanner machine and the other will be the server we want to scan.
Nmap is a great and widely available port scanner. Let's start by installing it on the scanner machine. You can install it from the repositories of most Linux distributions, from ports on BSD and from Homebrew on OS X. You can also download an installer for Windows from http://nmap.org/download.html.
How to do it...
Perform the following steps to verify your firewall by port scanning:
On your scanner machine, open up a terminal window and type the following command (here,...