Its always good to know open ports on the server to secure the server from the hackers, refer to the following steps to check the open ports on the server.
Login in to the server as a root user and run the command.
nmap -sT -O localhost
Some time above command throws the following error message because nmap is not installed on the server.
We can install the nmap command by using the yum.
yum install nmap* -y
Now the run the following command again.
nmap -sT -O localhost
It will show you all the open ports on the server