Quantcast
Channel: GoLinuxHub
Viewing all articles
Browse latest Browse all 392

How to get a list of open ports in Linux?

$
0
0
So you have set up a very secured server but still don't you want to cross check if the machine is really
secured and your server has not been compromised by anyone. If is always better to regularly scan your system with open ports and list of connected machines.

For this blog I will show you the command to get a list of open ports in any machine

nmap command can be used to do the same. You can download in RedHat machine using yum

 # yum install nmap


Once installed verify the package

 # rpm -qa | grep nmap
 nmap-5.51-2.el6.i686


Syntax

 # nmap <address>

 # nmap localhost
 Starting Nmap 5.51 ( http://nmap.org ) at 2013-05-03 12:39 IST
 Nmap scan report for localhost (127.0.0.1)
 Host is up (0.0000080s latency).
 Other addresses for localhost (not scanned): 127.0.0.1
 Not shown: 981 closed ports
 PORT     STATE SERVICE
 22/tcp   open  ssh
 25/tcp   open  smtp
 80/tcp   open  http
 111/tcp  open  rpcbind
 631/tcp  open  ipp
 1935/tcp open  rtmp
 3306/tcp open  mysql
 5222/tcp open  xmpp-client
 5269/tcp open  xmpp-server
 5802/tcp open  vnc-http-2
 5902/tcp open  vnc-2
 5989/tcp open  wbem-https
 6002/tcp open  X11:2
 7070/tcp open  realserver
 7443/tcp open  oracleas-https
 7777/tcp open  cbt
 8443/tcp open  https-alt
 9090/tcp open  zeus-admin
 9091/tcp open  xmltec-xmlmail 


Here as you can see I got a long list of opened ports on my machine.

Go ahead and try the same on your machine.


Viewing all articles
Browse latest Browse all 392

Latest Images

Trending Articles



Latest Images