Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can you kill an established TCP connection on Linux?

share|improve this question
1  
kill the process holding open the connection? –  Marc B Nov 2 '11 at 17:58
add comment

migrated from stackoverflow.com Nov 2 '11 at 20:00

This question came from our site for professional and enthusiast programmers.

2 Answers

There's a tool called tcpkill. You can usually get it by installing dsniff.

[root@fresh ~]# tcpkill -i eth0 tcp port 22
tcpkill: listening on eth0 [tcp port 22]
share|improve this answer
    
Uhm. Who marked this community wiki ? –  cnicutar Nov 2 '11 at 18:04
    
Apparently you did. There is only 1 revision. And says "[made Community Wiki]". stackoverflow.com/posts/7985103/revisions - weird though, maybe an accidental click on the wiki checkbox? –  chown Nov 2 '11 at 18:46
    
@chown Maybe :) –  cnicutar Nov 2 '11 at 19:02
add comment

tcpkill is the command to research, let's you kill connections to / from a specified host, network or port.

For example, to prevent any connections to the host www.google.com use this command:

/usr/sbin/tcpkill −9 host www.google.com
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.