1752608 Members
4303 Online
108788 Solutions
New Discussion юеВ

Port

 
SOLVED
Go to solution
Amitav
Frequent Advisor

Port

How can i check which ports are opened on my server, and how can can we open/close ports in HP-UX servers..?? Kindly explain along with the cmds...
5 REPLIES 5
Murat SULUHAN
Honored Contributor
Solution

Re: Port

Hi Amitav

netstat will help you

netstat -an | grep LISTEN
netstat -an | grep ESTABLIS

man netstat for details


There is another utility like netstat but also list open files called as lsof. You can get it from following url

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.78/

Best Regards
Murat
Murat Suluhan
Amitav
Frequent Advisor

Re: Port

thanks murat for ur reply, but anyway how can we check or see thru which port my HP-UX server is connected...??
Murat SULUHAN
Honored Contributor

Re: Port

Hi Amitav

netstat -an | grep ESTABLISHED command will assist you to learn about your connections and ports

Please look at following url
http://www.wlug.org.nz/TcpStates

Best Regards
Murat
Murat Suluhan
Ludovic Derlyn
Esteemed Contributor

Re: Port

hi Amitav,

you can use also lsof to know which port is used by which process

for example

lsof -i tcp:22

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 1278 root 5u inet 0xe000000165d66740 0t0 TCP *:22 (LISTEN)
sshd 21752 root 5u inet 0xe0000001712ff3c0 0t79559 TCP xxx.xx.corp.priv:22->xxxxxxx.xxx.corp.priv:1549 (ESTABLISHED)

A good url which can be usefull :

http://www.iana.org/assignments/port-numbers

Regards
L-DERLYN
rick jones
Honored Contributor

Re: Port

Your followup question makes it sound like you are asking about network interface ports (eg rj45 connections on NICs) rather than TCP/UDP port numbers. Is that the case?
there is no rest for the wicked yet the virtuous have no pillows