Kill TCP connections by host/port pattern.
high risk
ss -tnp state established '( dport = :<port> )'List the connections you intend to drop first.tcpkill (from dsniff package) sends RST packets to kill TCP connections matching a filter expression. Used to forcibly terminate stuck connections, drop specific client connections, or test application reconnect behavior without restarting services.
tcpkill host 10.0.0.5Kill all TCP connections to/from 10.0.0.5 · explain & risk-check →tcpkill port 8080Kill all connections on port 8080 · explain & risk-check →tcpkill host 10.0.0.5 and port 5432Kill DB connections from specific host · explain & risk-check →Before using tcpkill in production, verify with `ss -tnp` that you're targeting the right connections — tcpkill uses the same pcap filter syntax as tcpdump, so test the filter with tcpdump first.
Reference text is hand-written and may be incomplete — check man tcpkill for your version. Test destructive commands on a non-production system first.