We can use the following command to check the open ports in the Linux server but make sure that nmap module is installed on the server and if its not installed than first install nmap module by using the command "yum install nmap -y"
nmap -sT -O localhost
The above command will show you the following result.
nmap -sT -O localhost
The above command will show you the following result.
Code:
[[email protected]~]# nmap -sT -O localhost Starting Nmap 5.51 ( http://nmap.org ) at 2013-06-29 12:28 BST Nmap scan report for localhost (127.0.0.1) Host is up (0.000034s latency). rDNS record for 127.0.0.1: localhost.localdomain Not shown: 984 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 25/tcp open smtp 53/tcp open domain 80/tcp open http 106/tcp open pop3pw 110/tcp open pop3 143/tcp open imap 443/tcp open https 465/tcp open smtps 993/tcp open imaps 995/tcp open pop3s 3000/tcp open ppp 3306/tcp open mysql 8443/tcp open https-alt 10001/tcp open scp-config