How to check the open ports status on CentOS 7?
On CentOS 7, you can use the following command to view the status of open ports:
sudo firewall-cmd --list-ports
This will display all ports and their statuses for the current firewall configuration. If you want to check the status of a specific port, you can use the following command:
sudo firewall-cmd --query-port=PORT/PROTOCOL
Please replace “PORT” with the port number you want to query, and replace “PROTOCOL” with the protocol you want to query (such as tcp or udp). This will return “yes” or “no” to indicate whether the port is open in the firewall.