Operating System - HP-UX
1753506 Members
4964 Online
108794 Solutions
New Discussion юеВ

Re: To find what ports are used

 
SOLVED
Go to solution
Faizer
Advisor

To find what ports are used

How do I know what ports are used in the HP UX11.11.system.
Where are the ports to be used defined in the system. specially for the OS.
best regards
Faizer
11 REPLIES 11
Sridhar Bhaskarla
Honored Contributor
Solution

Re: To find what ports are used

Hi Faizer,

/etc/services is a file that will have the ports defined in it. But there is no guarantee that it will have all the ports. It is a good practice to add the ports in it but many times applications do not follow it.

You can find all the TCP ports opened on the system using "netstat -an |grep "LISTEN"" command. Without 'n' the above command will display the names of the ports as defined in /etc/services file. inetd brokers quiet a few Operating System services. You can turn them off in /etc/inetd.conf. You will need to restart inetd with {inetd -c} to get them into affect. The inetd services that you cannot turn off can be restricted using /var/adm/inetd.sec file. It is a good idea to replace standard telnet/ftp/remsh/rcp commands with ssh/scp/sftp that you can download from software.hp.com site.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bill Hassell
Honored Contributor

Re: To find what ports are used

Ports are documented in /etc/services.This file is used to associate a symbolic name with a port and protocol. The existence of a port name in services does not enable the port. This is done primarily in /etc/inetd.conf and HP-UX, like many flavors of Unix, enables most of the ports by default. For security, it is best to turn off everything in /etc/inetd.conf by commenting them (a # in front of the service line) and rereading the inetd.conf file with inetd -c.

While this may seem drastic, the majority of services are archaic legacy services and should only be enabled when a specific need is determined for the protocol. Now turning off everything means that telnet and ftp are disabled...you'll only be able to communicate with the system through the console and serial or modem ports. So you may wish to turn on telnet for now. However, the better solution os Secure Shell or ssh protocol to replace telnet. To completely replace telnet, you'll need ssh clients for PCs and other platforms to communicate with your HP-UX box.


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: To find what ports are used

Oracle uses port 1521 for the database, port 9000-9001 for forms and reports.

Does not document it anywhere. Makes no note or reserveration in /etc/services

netstat -an or -rn will give you idea whats in use.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.70/
lsof will let you look harder but you'll need to manuall set suid on the binary after seeing an install error.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Berlene Herren
Honored Contributor

Re: To find what ports are used

The port numbers are divided into three ranges: the Well Known Ports,
the Registered Ports, and the Dynamic and/or Private Ports.

The Well Known Ports are those from 0 through 1023.

The Registered Ports are those from 1024 through 49151

The Dynamic and/or Private Ports are those from 49152 through 65535

For more info on these ports, see http://www.iana.org/assignments/port-numbers

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Fabio Ettore
Honored Contributor

Re: To find what ports are used

Hi,

on HP-UX:
# netstat -an
for used ports

/etc/services
for port definition about all applications

Best regards,
Ettore
WISH? IMPROVEMENT!
Keith Buck
Respected Contributor

Re: To find what ports are used

First, I'll say that the HP-UX operating system can run without many ports open to the world at all. These can be limited by turning off services, an ipfilter host-based firewall, and/or the hardware firewalls in your DMZ.

Now, to answer the question you actually asked, see the HP-UX Networking Ports Reference Guide here:

http://docs.hp.com/hpux/onlinedocs/5187-4242/5187-4242.html

Hope that helps.

Also, please don't forget to assign points to the folks who have been helpful to you.

-Keith
Steven Sim Kok Leong
Honored Contributor

Re: To find what ports are used

Hi,

To check which are the listening ports currently on your server:

# netstat -an | grep LISTEN

For defining ports,

# vi /etc/services

Hope this helps. Regards.

Steven Sim Kok Leong
Ravi_8
Honored Contributor

Re: To find what ports are used

Hi

#netstat -an

/etc/services file will be containing list of ports and services which uses those ports
never give up
Faizer
Advisor

Re: To find what ports are used

Hi Keith
I am unable to find the documnet at this link
http://docs.hp.com/hpux/onlinedocs/5187-4242/5187-4242.html