≡ Menu

Debian / Ubuntu Linux: Install nmap Software For Scanning Network

How do I install nmap command under Debian or Ubuntu Linux based system for testing security of my own network?

Nmap is a command line tool for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques (determine what services the hosts are offering), and TCP/IP fingerprinting (remote host operating system identification).


To install nmap for Debian and Ubuntu Linux based server systems type the following apt-get command:
$ sudo apt-get install nmap
Sample outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 1,643 kB of archives.
After this operation, 6,913 kB of additional disk space will be used.
Get:1 http://mirrors.service.networklayer.com/ubuntu/ precise/main nmap amd64 5.21-1.1ubuntu1 [1,643 kB]
Fetched 1,643 kB in 0s (16.4 MB/s)
Selecting previously unselected package nmap.
(Reading database ... 56834 files and directories currently installed.)
Unpacking nmap (from .../nmap_5.21-1.1ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up nmap (5.21-1.1ubuntu1) ...


To find the nmap version, enter:
# nmap -V
# nmap --version
Sample outputs:

Nmap version 5.21 ( http://nmap.org )
WARNING! nmap scan could get you into legal trouble if you don’t have permission to scan the target systems.

To scan an IP address, enter:
# nmap
Sample outputs:

Starting Nmap 5.00 ( http://nmap.org ) at 2012-11-18 14:41 IST
Interesting ports on
Not shown: 997 closed ports
23/tcp open  telnet
53/tcp open  domain
80/tcp open  http
MAC Address: 74:44:01:40:57:FB (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 1.28 seconds

To scan a range of IP addresses, enter:
# nmap
To scan an entire subnet:
# nmap
More examples:

## Ping only scan ##
nmap -sP
## Scan and do traceroute ##
nmap --traceroute IP-ADDRESS
nmap --traceroute DOMAIN-NAME-HERE
## TCP SYN Scan ##
nmap -sS
## UDP Scan ##
nmap -sU
## IP protocol scan ##
nmap -sO
## Scan port 80, 25, 443 ##
nmap -p 80
nmap -p http
nmap -p 25
nmap -p smtp
nmap -p 443
nmap -p 80,24,443
## Scan port ranges ##
nmap -p 512-1024
## Scan for OS i.e. Operating System Detection ##
nmap -O
nmap -O --osscan-guess
## Scan for application server version ##
nmap -sV

Type the following command to read nmap man page:
# man nmap

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 0 comments… add one }

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , ,