Operating System - HP-UX
1827293 Members
3144 Online
109717 Solutions
New Discussion

Re: Who started the scoket connection?

 
SOLVED
Go to solution
Russell Boyd
Occasional Advisor

Who started the scoket connection?

HP-UX 11
netstat -a gives you the local and foreign ip/scoket information.

How do you know which user (assuming that it was indeed a user who started the process) instigated a particular scoket connection?

Russell
He who does not slow down at the sight of a police car is probably parked!
5 REPLIES 5
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Who started the scoket connection?

You can find the corresponding process by using "lsof". Once you know the process you would know who the user was.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Russell Boyd
Occasional Advisor

Re: Who started the scoket connection?

whereis, which, man and find do not come up with an lsof command. Where is it found at?

Russell
He who does not slow down at the sight of a police car is probably parked!
Jeff Schussele
Honored Contributor

Re: Who started the scoket connection?

Hi Russell,

It's not in the HP core fileset.
Can be had from an HP porting site - like:

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

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sridhar Bhaskarla
Honored Contributor

Re: Who started the scoket connection?

lsof does not come bundled with HP-UX OS. But it is a famous tool. You can get it from the HP's porting site.

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

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

Re: Who started the scoket connection?

indeed lsof will tell you which process is associated with a given socket. however, I don't think it can tell you if that process initiated the connection, or if the connection was initiated by the remote.

you might make some (reasonably good) guesses based on whether or not there is a local LISTEN socket bound to the same local port number.

the other wrinkle in knowing who started the connection is that the socket can be handed-off from one process to another, not necessarily via fork().
there is no rest for the wicked yet the virtuous have no pillows