>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
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
Note: you'll need root privs (or help from your friendly sysadmin)
to install it.
Darren Tucker. (dtucker at the domain zip dot com dot au)
A programmer is a device for converting caffeine into source code.