Skip to main content
Navigation
HomeTechnical ReferenceJournalGitHubGitHub
Sidebar — toggle document categories via the logo
Categories

Find the Process Listening on a Port

Objective

Determine which process is listening on a specific network port.

Prerequisites

  • Shell access to the Linux host.
  • Permissions to inspect network sockets and process information (typically root for unprivileged processes).

Procedure

  1. Use ss to list sockets bound to the port:

    ss -tlnp | grep ':<port>'
  2. If ss is unavailable, use netstat:

    netstat -tlnp | grep ':<port>'
  3. Extract the process ID from the output and inspect the process:

    ps -fp <pid>
  4. For UDP ports, replace -t with -u:

    ss -ulnp | grep ':<port>'

Verification

  • Confirm the PID in the ss or netstat output matches the expected service.
  • Verify the service is functional using its native health check or by connecting to the port.