How to perform a port scan on Ubuntu 20.04 step-by-step instructions
Before you begin, make sure that nmap, the port scanner tool is installed on your Ubuntu 20.04 system. To do so open up a terminal window and execute the following command:
$ sudo apt install nmap
Once the nmap port scanner is installed use the following examples to perform some basic port scanning. For more robust information about the nmap port scanner visit our nmap guide.
- Scan remote host
8.8.8.8for all open port TCP ports:$ nmap 8.8.8.8 - Scan remote host
8.8.8.8for all TCP and UDP ports:$ nmap -sUT 8.8.8.8 - Scan remote host
8.8.8.8TCP port 53:$ sudo nmap -p 53 - Scan remote host
8.8.8.8UDP port 53:$ nmap -sU -p 53 8.8.8.8 - Scan remote host
8.8.8.8for open TCP and UDP ports:$ nmap -sUT --open 8.8.8.8 - Scan your local Ubuntu system TCP ports:
$ nmap localhost
