Operating System - HP-UX
1748223 Members
4524 Online
108759 Solutions
New Discussion

Re: find open-ports in HP-UX

 
Jenny John
Advisor

find open-ports in HP-UX

How can i find out open-ports in HP-UX OS apart from /etc/services ??

2 REPLIES 2

Re: find open-ports in HP-UX

standard way would be:

 

netstat -af inet

 

or

 

netstat -anf inet

 

to see without DNS and port name lookup

 

If you want to see which processes have the port open you will need lsof:

 

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.84/

 

and then use "lsof -i"

 

 


I am an HPE Employee
Accept or Kudo
James R. Ferguson
Acclaimed Contributor

Re: find open-ports in HP-UX


@Jenny John wrote:

How can i find out open-ports in HP-UX OS apart from /etc/services ??


The 'etc/services' file has nothing to do with a port being open or not.  The 'sevices' file simply gives a name to a port number together with the protocol (TCP/UDP) that is associated with the service.

 

As Duncan noted, either 'netstat' or (better yet) 'lsof' will show "open" ports --- those handling incoming or outgoing connections.

 

Regards!

 

...JRF...