Let's think about it this way for a second
Nmap (Network Mapper) is a tool that scans/discovers devices, open ports, and running services on a network — letting you find out 'which ports are open on my server, what services are running' before an attacker does. Vulnerability scanners (OpenVAS, Nessus) go deeper, cross-referencing against the known CVE (Common Vulnerabilities and Exposures) database to find version-specific vulnerabilities.
Let's connect this to a real-world scenario
Running nmap -sV target-ip shows you all of the target's open ports and service versions — if any unnecessary ports are open, you can close them right away (this connects to the ufw section of the Linux tutorial). Scanning a system/network that isn't yours without permission can be a legal offense — only use this on your own servers or in an authorized penetration testing engagement.
Let's look at it together
# Scan a target's open ports and service versions
# WARNING: only run against systems you own or have written permission to test
nmap -sV 192.168.1.1
# Common output:
# PORT STATE SERVICE VERSION
# 22/tcp open ssh OpenSSH 8.9
# 80/tcp open http nginx 1.24.0Be able to read open ports/services from an Nmap scan result and identify which ports are unnecessary.Try it in 5 minutes
Install nmap on your own VM/WSL (the one you set up in the Linux tutorial) and scan localhost (127.0.0.1) — since it's your own machine, this is fully authorized.
A quick word of caution
Scanning or testing a system that isn't yours without written permission is a legal offense in most countries — only practice in your own lab environment, an authorized bug bounty, or a CTF platform.