LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Killing Active Connections (https://www.linuxquestions.org/questions/linux-general-1/killing-active-connections-48476/)

Crashed_Again 03-05-2003 06:43 PM

Killing Active Connections
 
This is a real newbie question but I can't figure out how to do it. When I run netstat -a I see the active connections. How would you terminate one of those connections?


tcp 0 0 192.168.0.100:34887 unknown.Level3.net:http ESTABLISHED
tcp 0 0 192.168.0.100:34888 unknown.Level3.net:http ESTABLISHED
tcp 0 0 192.168.0.100:34479 64.12.24.137:5190 ESTABLISHED
tcp 0 0 192.168.0.100:34886 unknown.Level3.net:http ESTABLISHED
tcp 0 0 192.168.0.100:34883 unknown.Level3.net:http ESTABLISHED
tcp 0 0 192.168.0.100:34894 216.151.201.137:http ESTABLISHED
tcp 0 0 192.168.0.100:34893 216.151.201.137:http ESTABLISHED
tcp 0 0 192.168.0.100:34906 65.122.104.1:ircd ESTABLISHED

I don't know what those "unknown.Level3.net:http" connections are. Obviously it is an http connection but I want to kill them.

How is it done?

nxny 03-05-2003 10:01 PM

Do these persist?

What other applications are running? Was your browser open?

Crashed_Again 03-06-2003 08:15 PM

No they go away eventually but I just want to know if there is a command to stop a specific connection.

nxny 03-07-2003 03:09 PM

The only way you can kill a connection is by killing the pid that is owning/using the socket that the connection goes through.

netstat -ntlapee

( as root ) will display the PID/program name that owns the socket.

See netstat man page for more info.

micxz 05-15-2003 05:31 PM

I wonder how to kill, processes without a pid? Is this possible? killing the actual connecting rather than the program at which the connection is using?

xx.xxx.xxx.xx:smtp xx.xxx.xxx.xx:7844 TIME_WAIT -

Sometimes I see no pid.

nxny 05-17-2003 01:48 AM

If you dont see a PID, you may have to do some guesswork looking at the TCP ports at the local and remote IPs . In your case it looks like a TCP connection to your SMTP server from a temporary port in a remote machine. Restart your SMTP server and it will be gone, if you just want to play with it. Generally speaking, if you start doing this to kill connections that are usually kept alive, you'd be engaged all day :)


All times are GMT -5. The time now is 01:07 AM.