Install Nmap on Ubuntu 20.04

Nmap is a command line tool which allows scan network and perform security audit. This tool provides ability to find what devices are connected to the network, what services are available and what operating systems are running on these devices, which ports are open, etc.

This tutorial shows how to install Nmap on Ubuntu 20.04.

Install Nmap

Update the package lists:

sudo apt update

Next, run the following command to install Nmap:

sudo apt install -y nmap

Once installation is completed, we can check Nmap version:

nmap --version

Testing Nmap

Run nmap command and give the IP address of a network device as argument:

nmap 192.168.0.151

Command prints which ports are open and what services are running on that device:

Nmap scan report for 192.168.0.151
Host is up (0.0019s latency).
Not shown: 999 filtered ports
PORT   STATE SERVICE
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 4.84 seconds

You can also scan all local network. For example, the following command scans local network where address is 192.168.0.0/24:

nmap 192.168.0.0/24

Uninstall Nmap

If you want to completely remove Nmap and related dependencies, execute the following command:

sudo apt purge --autoremove -y nmap

Leave a Comment

Your email address will not be published. Required fields are marked *