1833051 Members
2443 Online
110049 Solutions
New Discussion

Re: port number

 
SOLVED
Go to solution
Shivakumar_3
Advisor

port number

Hello everybody,
Is there any command or anyway for getting the port number of HP-UX11i server?Please help me out.
11 REPLIES 11
GGA
Trusted Contributor
Solution

Re: port number

hello
what do u mean ?
u have /etc/services where all ports are defined

u can look with netstat -a which ports are open ...
look at man netstat
regards gga
Joseph Loo
Honored Contributor

Re: port number

hi,

do u mean ports of services, e.g. telnet ftp, http, e.g? if so, please refer to /etc/services for the standard ports.

regards.
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: port number

however, if u mean ports your server are listening or established:

# netstat -an|grep -i listen

# netstat -an|grep -i estab

regards.
what you do not see does not mean you should not believe
RAC_1
Honored Contributor

Re: port number

netstat -an
lsof -i tcp
lsof -i udp
There is no substitute to HARDWORK
Bharat Katkar
Honored Contributor

Re: port number

Hi,
HAve a look at:

/etc/services
/etc/protocols
# netstat -a
# rpcinfo
# man services
# man protocols

That should help.
Regards,

You need to know a lot to actually know how little you know
Adisuria Wangsadinata_1
Honored Contributor

Re: port number

Hi,

Check this file : /etc/services
This is a file for all registered port in HP-UX, the one with mark means the port is blocked and the one with unmark means the port is used as per normal.

More details, check the man page :

# man services

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Borislav Perkov
Respected Contributor

Re: port number

Hi,

netstat -an
If the ports are shown in names you can find them in /etc/services.

Here is the link for lsof
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.76/
lsof -i tcp
lsof -i udp

Regards,
Borislav
Senthil Prabu.S_1
Trusted Contributor

Re: port number

netstat can help you to find it out.


Following link gives a list of ports on any unix machines;
http://www.iana.org/assignments/port-numbers

This holds good for HP-UX as well. So look at this link to find all port numbers and relavant services.
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Victor BERRIDGE
Honored Contributor

Re: port number

Hi,

You have the answers to your request now, I would just add /etc/services is a valid source only if the Sysadm has kept it up to date...
So dont trust only this file but double check with netstat and lsof...
And if you add new services, dont forget to update /etc/services.


All the best
Victor
Rory R Hammond
Trusted Contributor

Re: port number

ports listed in /etc/services does not mean that they are being used. Ports NOT listed in /etc/services does not mean they are NOT being used.

It depends on what ports the various listener are looking for. /etc/services is a nice way for us humans to put name to number.

If I understand your question. I would suggest that you look at port scanner like nmap

http://www.insecure.org/nmap/
There are a 100 ways to do things and 97 of them are right
Arunvijai_4
Honored Contributor

Re: port number

Shiv, you can use the following ..
1) /etc/services
2) netstat -na
3) lsof

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"