{"id":6814,"date":"2021-06-09T18:13:06","date_gmt":"2021-06-09T18:13:06","guid":{"rendered":"https:\/\/linuxways.net\/?p=6814"},"modified":"2021-06-09T18:13:06","modified_gmt":"2021-06-09T18:13:06","slug":"how-to-install-nmap-on-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-install-nmap-on-centos-8\/","title":{"rendered":"How to Install Nmap on CentOS 8"},"content":{"rendered":"<p>Nmap is an open-source network scanner and security auditing utility. The system and network administrators can use Nmap for several useful tasks like for port scanning, administration, network inventory, security auditing, etc. It can collect a wealth of information like OS version, MAC address, running services, and much more. Nmap can monitor a single host or a large network comprising of several hosts.<\/p>\n<p>In an earlier post, we covered the <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-nmap-on-ubuntu-20-04\/\">installation of Nmap on Ubuntu<\/a> OS. In today\u2019s post, we will cover the installation of Nmap on a CentOS machine. We will install it using these methods:<\/p>\n<ul>\n<li>Installation via Yum Package Manager<\/li>\n<li>Installation via Snap Package Manager<\/li>\n<\/ul>\n<p><strong>Note<\/strong>: We have demonstrated the installation procedure on <strong>CentOS 8 <\/strong>machine<strong>.<\/strong><\/p>\n<h2>Installing Nmap via Yum Package Manager<\/h2>\n<p>The first method we will explain is using the yum package manager for installing Nmap. At the time of writing, the Nmap version available in the yum default repository is <strong>7.70<\/strong>. To install Nmap using the yum package manager, use these steps:<\/p>\n<p>1. Open the Terminal in your CentOS machine. Press the Windows key and then search the Terminal program using the search box that appears.<\/p>\n<p>2. Now execute the command below in order to install Nmap:<\/p>\n<pre>$ sudo yum install nmap<\/pre>\n<p>If prompted, hit <strong>y<\/strong> to continue.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1035\" height=\"398\" class=\"wp-image-6815\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-87.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-87.png 1035w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-87-300x115.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-87-1024x394.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-87-768x295.png 768w\" sizes=\"auto, (max-width: 1035px) 100vw, 1035px\" \/><\/p>\n<p>After the installation of Nmap is completed, you will see the output as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"516\" height=\"245\" class=\"wp-image-6816\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-88.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-88.png 516w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-88-300x142.png 300w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/p>\n<p>3. Now to verify the installation of Nmap and to view the version that is installed, execute the command below:<\/p>\n<pre>$ nmap --version<\/pre>\n<p>The following output indicates the Nmap version 7.70 is successfully installed on our CentOS machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"70\" class=\"wp-image-6817\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-89.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-89.png 450w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-89-300x47.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/p>\n<h2>Installing Nmap via Snap Package Manager<\/h2>\n<p>In the second method, we are going to cover how to use the snap package manager to install Nmap. At the time of writing, the Nmap version available via snap package manager is <strong>7.91<\/strong>. To install Nmap using the snap package manager, use these steps:<\/p>\n<p>1. You should first enable the EPEL repository using the command below:<\/p>\n<pre>$ sudo yum install epel-release<\/pre>\n<p>Enter sudo password and press <strong>y<\/strong> if prompts you with <strong>y\/N<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"377\" class=\"wp-image-6818\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/enable-epep-repository-2.png\" alt=\"enable EPEP repository\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/enable-epep-repository-2.png 820w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/enable-epep-repository-2-300x138.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/enable-epep-repository-2-768x353.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/p>\n<p>2. You can now use the yum command to install snapd as follows:<\/p>\n<pre>$ sudo yum install snapd<\/pre>\n<p>Enter sudo password and press <strong>y <\/strong>if it prompts you with <strong>y\/N<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"819\" height=\"420\" class=\"wp-image-6819\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/installing-snapd-2.png\" alt=\"installing snapd\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/installing-snapd-2.png 819w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/installing-snapd-2-300x154.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/installing-snapd-2-768x394.png 768w\" sizes=\"auto, (max-width: 819px) 100vw, 819px\" \/><\/p>\n<p>3. After installing snapd, you will have to enable the snapd.socket:<\/p>\n<pre>$ sudo systemctl enable --now snapd.socket<\/pre>\n<p>4. Then you will need to create a symlink.<\/p>\n<pre>$ sudo ln -s \/var\/lib\/snapd\/snap \/snap<\/pre>\n<p>This will enable the classic snap support.<\/p>\n<p>5. You can now install Nmap:<\/p>\n<pre>$ sudo snap install nmap<\/pre>\n<p>Once Nmap is installed, you should see the following similar output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"67\" class=\"wp-image-6820\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-90.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-90.png 642w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-90-300x31.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/p>\n<p>6. Now to verify the installation of Nmap and to view the version that is installed, execute the command below:<\/p>\n<pre>$ nmap --version<\/pre>\n<p>The following output indicates the Nmap version 7.91 is successfully installed on our CentOS machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"402\" height=\"70\" class=\"wp-image-6821\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-91.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-91.png 402w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-91-300x52.png 300w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p>To display the help screen along with all the options for the Nmap command-line utility, use the below command:<\/p>\n<pre>$ nmap --help<\/pre>\n<h2>Uninstall Nmap<\/h2>\n<p>If you want to remove Nmap from your system, you can do so using the following methods:<\/p>\n<p>If you have installed Nmap using the <strong>yum package manager<\/strong>, you can uninstall it as follows:<\/p>\n<pre>$ sudo yum remove nmap<\/pre>\n<p>If you have installed Nmap using the <strong>snap package manager<\/strong>, you can uninstall it as follows:<\/p>\n<pre>$ sudo snap remove nmap<\/pre>\n<p>By following either of the methods described above, you can easily and quickly install Nmap on your CentOS machine. Nmap is a handy utility for network scanning and security auditing. Nmap contains variety of options for scanning remote hosts. Visit the <a href=\"https:\/\/linuxways.net\/de\/centos\/15-mostly-used-nmap-commands-for-scanning-remote-hosts\/\">15 Mostly Used Nmap Commands for Scanning Remote Hosts.<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Nmap is an open-source network scanner and security auditing utility. The system and network administrators can use Nmap for several useful tasks like for port scanning, administration, network&hellip;<\/p>","protected":false},"author":1,"featured_media":7120,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,201],"class_list":["post-6814","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-8","tag-nmap"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/6814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=6814"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/6814\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/7120"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=6814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=6814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=6814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}