VERY URGENT- killing a netstat ESTABLISHED session

VERY URGENT- killing a netstat ESTABLISHED session

Post by joeh » Wed, 04 Aug 1999 04:00:00



Besides guessing which one in the process table, what is the most
certain way to kill a session which
appears in the output of 'netstat' ?  I would like to write a routine to
catch this session and
kill it (cron entry)
Very critical- please advise
Thanks
Joe

--

access to a news server; thanks!
Disclaimer: opinions expressed my own and not representative of my employers

 
 
 

VERY URGENT- killing a netstat ESTABLISHED session

Post by joeh » Wed, 04 Aug 1999 04:00:00


For example,
I have this netstat output:

tcp        0      0  naswan.pop3           user.agro2.dp.ua.1201  CLOSE_WAIT
tcp        0      0  naswan.pop3           dal-tgn-tke-vty7.1221  ESTABLISHED

You want to ping, you want to you use snoop
Can't trace these guys
Who is ua???


> Besides guessing which one in the process table, what is the most
> certain way to kill a session which
> appears in the output of 'netstat' ?  I would like to write a routine to
> catch this session and
> kill it (cron entry)
> Very critical- please advise
> Thanks
> Joe

--

access to a news server; thanks!
Disclaimer: opinions expressed my own and not representative of my employers

 
 
 

VERY URGENT- killing a netstat ESTABLISHED session

Post by Mike Marsha » Wed, 04 Aug 1999 04:00:00



>Besides guessing which one in the process table, what is the most
>certain way to kill a session which
>appears in the output of 'netstat' ?

Use lsof... here's a line from netstat on a machine with
lots of established connections. This is a connection from
someplace using port 1473... lsof shows that process 9894 is
responsible...

netstat -n -a | grep EST
                                .
                                .
                                .
130.127.28.32.80     206.105.239.124.1473  8576   1607  9112      0 ESTABLISHED
                                .
                                .
                                .

hubcap# lsof | grep 1473
httpd      9894 www-daem    3u  inet 0x621baed8  0t1409442     TCP
  hubcap.clemson.edu:80->bay-124-b6.codetel.net.do:1473 (ESTABLISHED)

-Mike

 
 
 

VERY URGENT- killing a netstat ESTABLISHED session

Post by datavanquishe » Wed, 04 Aug 1999 04:00:00



> For examWho is ua???

ua is for Ukraine, dp is a name of the sity- Dnepropetrovsk. Have no idea what
agro2 is- sounds like a name of the company or bank to me
HIH
Sergey
 
 
 

VERY URGENT- killing a netstat ESTABLISHED session

Post by t.. » Thu, 05 Aug 1999 04:00:00



>Besides guessing which one in the process table, what is the most
>certain way to kill a session which appears in the output of
>'netstat' ?  I would like to write a routine to catch this session
>and kill it (cron entry)

Lsof ("list open files") can identify a process using a particular
socket. With a bit of care you can identify a single process. For
example, I have a connection from port 1023 -> ssh(22):


sshd    11954 root    5u  inet  68988       TCP 192.168.1.1:ssh->192.168.1.100:1023 (ESTABLISHED)

To terminate that SSH session, you could kill PID 11954. I don't know
of any clean way to kill a single session of a multithreded server
(anyone?)

You can get lsof from ftp://vic.cc.purdue.edu/pub/tools/unix/lsof.
It supports pretty much every Unix flavour I've ever seen (including
Solaris).

Note: you'll need root privs (or help from your friendly sysadmin)
to install it.

        -Daz.
--
Darren Tucker.          (dtucker at the domain zip dot com dot au)
A programmer is a device for converting caffeine into source code.

 
 
 

1. netstat showing TCP connection established but is definitely not

Hi,

What circumstances could cause netstat to show that a TCP connection
is ESTABLISHED to a remote machine (not necessarily running Solaris),
where in actual fact there is definitely no such connection, because
the other machine is not showing any such connection or in fact is
switched OFF or unplugged from the network?
Basically I have a daemon that accept TCP connections on a fixed (non
privileged) port and every now and then it gets into a state where it
can't accept any more connections and netstat shows these non-existent
connections.
Maybe something to do with how I'm closing the socket/setting linger
options, I've tried a few things but to no avail (seeing as the
problem is almost impossible to reproducce).

Only observed so far on SunOS 5.8

Thanks

Dylan

2. Newbie help with Matrox Mystique

3. Connects, establishes a PPP Session, and then ........ nothing.

4. Installing Elcon Nt1 Unit under LINUX - HELP ME PLIZZ :-)

5. iptables restart, existing sessions, and ESTABLISHED,RELATED rules

6. What's ELF?

7. Problem establishing telnet session into Linux system (Mandrake 7.2)

8. Sound via X

9. Establishing a dialup ppp session to a service provider using dip -

10. Problems establishing an ftp session

11. ct command to establish session

12. Programaticaly establish PPP session

13. ct command to establish session