LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-05-2003, 06:43 PM   #1
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
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?
 
Old 03-05-2003, 10:01 PM   #2
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Do these persist?

What other applications are running? Was your browser open?
 
Old 03-06-2003, 08:15 PM   #3
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Original Poster
Rep: Reputation: 57
No they go away eventually but I just want to know if there is a command to stop a specific connection.
 
Old 03-07-2003, 03:09 PM   #4
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
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.
 
Old 05-15-2003, 05:31 PM   #5
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
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.
 
Old 05-17-2003, 01:48 AM   #6
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp confusion/want active connections servnov Linux - General 2 09-26-2004 01:48 PM
passive+active connections and fxp+glftpd NonSumPisces Linux - Newbie 0 08-27-2004 01:39 PM
Active network connections crabboy AIX 1 08-04-2004 03:14 PM
iptables, nmap and active ftp connections Bug Linux - Security 3 06-14-2004 01:14 PM
GUI for active connections twistedpair Linux - Networking 3 03-30-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration