OpenBSD: Install nmap Network Port Scanner Security Tool

How do I install nmap network security and auditing tool under OpenBSD operating system?

Tutorial details
Difficulty Easy (rss)
Root privileges Yes
Requirements OpenBSD
Time N/A
Nmap (Network Mapper) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts.


Use pkg_add command to install software package called nmap under OpenBSD operating system. First, you must set the PKG_PATH environment variable as follows:

export PKG_PATH=`uname -r`/packages/`machine -a`/

Type the following pkg_add command to install nmap tool. The -v flag was used to give a more verbose output. This option is not needed but it is helpful for debugging and was used here to give a little more insight into what pkg_add is actually doing under OpenBSD:
# pkg_add -v nmap
Sample outputs:

nmap-6.01: ok


To find out nmap version, enter:
# nmap --version
Sample outputs:

Nmap version 6.01 ( )
Platform: i386-unknown-openbsd5.2
Compiled with: liblua-5.1.5 openssl-1.0.0f libpcre-8.30 libpcap-(OpenBSD libpcap) nmap-libdnet-1.12 ipv6
Compiled without:

To scan a host or an IP address, enter:
# nmap -A -v
# nmap -A -v
# nmap
Sample outputs:

Fig.01: Sample nmap output

See top 30 nmap command examples that introduce a user to the nmap command line tool to scan a host and/or network, so to find out the possible vulnerable points in the hosts. You will also learn how to use Nmap for offensive and defensive purposes.

🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • mohammad Sep 22, 2020 @ 16:01


Leave a Reply

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

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @