• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Check Open Ports

November 9, 2016

If you’re running a Linux server, here’s one way of checking as to which ports are open to the public. You can use netstat for that purpose. Netstat is a command-line network utility tool that displays network connections for tcp, routing tables, and a number of network interfaces. It’s available on Linux, MacOS and Windows.

In Linux and MacOS, type the following via the Terminal.

netstat -tupln
#
# -l = only services which are listening on some port
# -n = show port number, don't try to resolve the service name
# -t = tcp ports
# -u = udp ports
# -p = name of the program
#

netstat -tupln # # -l = only services which are listening on some port # -n = show port number, don't try to resolve the service name # -t = tcp ports # -u = udp ports # -p = name of the program #

If you’re in Windows, open up Powershell and type in:

netstat -ano | find "LISTENING"
# or
netstat -o 5

netstat -ano | find "LISTENING" # or netstat -o 5

Don’t be surprised as to what your computer is doing.

Filed Under: Linux, Mac Tagged With: netstat, open ports

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023