How to check open port numbers in CentOS?

You can use the following command in CentOS to check the open port numbers:

  1. Utilize the netstat command:
  2. Show all open network ports that are in listening state.
  3. This command will display all active TCP and UDP ports that are in the LISTEN state.
  4. Utilize the command “ss”:
  5. list all TCP connections with listening ports, displaying process names and numeric values
  6. This command will list all currently listening TCP and UDP ports, and display related detailed information.
  7. Use the lsof command:
  8. List open files that are Internet connections.
  9. This command will list all open network connections and listening ports, displaying relevant detailed information.

All commands above need to be executed with root privileges in order to obtain complete port information.

bannerAds