Scan a Host's Open Ports with nmap
Enumerate every open port and running service version on a machine you administer.
01Command
$ nmap -sV -p- 192.168.1.1002What it does
By default nmap only checks the 1000 most common ports, so -p- (short for -p 1-65535) is needed for a full sweep, and -sV asks nmap to fingerprint each open port's service and version. A full all-port scan takes longer; if you just want a quick check of common services, drop -p-. This is the standard way to verify that your own machines only expose the services you expect.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- nmap(1) — Debian manpageEvidence: Debian manpage describes nmap's -sV version detection and -p- to scan ports 1-65535
- nmap(1) — Ubuntu manpageEvidence: Ubuntu manpage documents -sV service/version detection and -p- (all 65535 ports) port specification
Last verified: 2026-09-19 · Category: Network
06Related solutions
One command that prints every interface with its state and IPv4/IPv6 addresses in a short table — the modern, memorable replacement for digging through `ifconfig` or the verbose `ip addr` output.
The classic forgotten-syntax command: `traceroute` shows every router between you and a destination plus the round-trip time of probes to each hop.
Add a UFW rule to permit inbound traffic on a TCP or UDP port, such as SSH on port 22.