How to Scan Open Ports on a Remote Server in Linux

September 3, 2025 / Servers, Hosting & Email

In this article, we will explain how to scan open ports on a remote server in Linux.

With Linux, we can identify which services or ports are open on the remote server and whether they are accessible. It helps in troubleshooting connectivity issues, verifying firewall rules, and maintaining server security.

Linux offers multiple tools to perform port scans successfully.

Why Scan Open Ports? 

Port scanning helps you:

  1. Verify which services are open and accessible.
  2. Identify misconfigurations and security vulnerabilities.
  3. Troubleshoot connection issues.
  4. Confirm firewall rules are working correctly.

Scanning open ports using nmap

‘nmap’ (Network Mapper) is the most popular tool for network discovery and port scanning.

  1. Install nmap (if not already installed):
    sudo apt install nmap        # On Ubuntu/Debian 
    sudo yum install nmap        # On CentOS/RHEL
  2. To scan the basic port, use the command below:
    nmap <remote-server-ip>
  3. To scan a specific port range, execute the following:
    nmap -p 20-100 <remote-server-ip>
  4. To scan for service and version detection, use the following command:
    nmap -sV <remote-server-ip>

Scanning ports using netcat (nc)

‘netcat’ is a multipurpose networking tool that can also be used to check for open ports.

  1. To check a single port, run the following:
    nc -zv <remote-server-ip> 22
  2. To scan a range of ports, use the subsequent command, and you can mention the range as given below:
    nc -zv <remote-server-ip> 20-100

Scanning ports using ss or telnet

‘ss’ or ‘telnet’ can be used for quick checks without installing extra tools:

  1. Using telnet (for a single port):
    telnet <remote-server-ip> 80

    If the connection succeeds, the port is open.

  2. Example command for ss (optional):
    ss -tn 'sport = :80'

Example Output (Nmap)

Starting Nmap 7.93 ( https://nmap.org ) at 2025-09-03 
Nmap scan report for 192.168.1.10 
Host is up (0.0020s latency). 
Not shown: 996 closed ports
PORT STATE SERVICE 
22/tcp   open  ssh 
80/tcp   open  http 
443/tcp  open  https

Security Considerations

The following security factors should be considered:

  1. Always scan with authorisation to avoid breaching security policies.
  2. Use these scans often to check for unintentional open ports and close unnecessary ones.
  3. Combine port scanning with firewall configuration (ufw, firewalld, iptables) for stronger protection.

This way, you can scan open ports on a remote server in Linux using tools like ‘nmap’, ‘netcat’, or ‘telnet’. Among these, ‘nmap’ provides the most detailed and useful results. Regular scans help improve server security and troubleshooting. For more such informative articles, do visit our KB section regularly.

Testing network security and monitoring open ports on Linux servers?
A Linux VPS Hosting solution gives you the control needed to manage network services, secure exposed ports and maintain a reliable server environment.

Scanning server ports done? Learn How to scan your email and website for viruses using cPanel

Spread the love