How to kill all ssh processes

Oh you murderer, but let me assist:

kill -9 `ps -eo pid,args | grep "ssh " | grep -v "grep" | cut -c1-6`

This kills all ssh processes. I use this often to kill all my ssh tunnels. It works in Mac OS X Lion as well as Ubuntu/Debian Linux.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>