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.

  1. Scan remote host 8.8.8.8 for all open port TCP ports:
    $ nmap 8.8.8.8
    
  2. Scan remote host 8.8.8.8 for all TCP and UDP ports:
    $ nmap -sUT 8.8.8.8


  3. Scan remote host 8.8.8.8 TCP port 53:
    $ sudo nmap -p 53
    
  4. Scan remote host 8.8.8.8 UDP port 53:
    $ nmap -sU -p 53 8.8.8.8
    
  5. Scan remote host 8.8.8.8 for open TCP and UDP ports:
    $ nmap -sUT --open 8.8.8.8
    
  6. Scan your local Ubuntu system TCP ports:
    $ nmap localhost
Was this answer helpful? 0 Users Found This Useful (0 Votes)