Qadry
unixcop Admin

How to Install and Use Nmap on Ubuntu

Introduction

Nmap is a very popular free and open-source network security tool and port scanner. It designed to perform security scans and discover hosts on a network by sending different packets to them and then analyzing their responses.

Nmap was named “Security Product of the Year” by Linux Journal, Info World, LinuxQuestions.Org, and Codetalker Digest. featured in twelve movies, including The Matrix Reloaded, Die Hard 4, Girl With the Dragon Tattoo, and The Bourne Ultimatum.

Installing Nmap On Ubuntu

For installing Nmap on your Ubuntu system, you have to go through the steps described below:

1: Update your Linux Ubuntu 21.04

Before installing Nmap on your Ubuntu system, you need to update it with the following command:

$ sudo apt-get update

The update process will take a few seconds to complete. You might also need to provide the password of your root user account before proceeding with the update.

2: Install Nmap on Ubuntu 21.04

Now, you can install Nmap on your Ubuntu 21.04 system by executing the following command:

$ sudo apt-get install nmap

3: Verify the Installation of Nmap

You can verify the installation of Nmap on your Ubuntu system by checking its version with the command shown below:

$ nmap --version

4: Check out the Man Pages of Nmap on your Ubuntu System

Optionally, before getting started with Nmap on Ubuntu 21.04, you can view its man pages with the command shown below:

$ man nmap

The man pages of Nmap shown in the following image:

5: Check out the Help Pages of Nmap on your Ubuntu

Additionally, you can even view the help pages of Nmap by executing the command shown below:

$ nmap --help

The help pages of Nmap shown in the following image:

Using Nmap

Here some examples of how to use Nmap to scan a system remotely. Replace IP 192.168.122.46 in the examples below with the hostname or IP address of the system that you like to scan.

Check for open ports

sudo nmap -sS 192.198.122.46

Let Nmap guess the operating system of the target

sudo nmap -O --osscan-guess 192.168.122.46

Check which services are run on the target

sudo nmap -sV 192.168.122.46

Removing Nmap from Ubuntu

At any point in time, if you feel like removing Nmap from your Ubuntu 21.04 system, then you can run the two commands shown below one after the other:

$ sudo apt-get purge nmap
$ sudo apt-get autoremove

Conclusion

By going through the procedure described in this article, one can easily install Nmap on a Ubuntu system. You can also free up your system’s space any time by uninstalling this tool from your system by the removal method shared with you in this article.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

x