Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can you kill an established TCP connection on Linux?

share|improve this question

migrated from Nov 2 '11 at 20:00

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

kill the process holding open the connection? – Marc B Nov 2 '11 at 17:58

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]". - 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

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 use this command:

/usr/sbin/tcpkill −9 host
share|improve this answer

You must log in to answer this question.