title: How to make ssh to kill remote process when I interrupt ssh itself?
body: <p>In a bash script I execute a command on a remote machine through ssh. If user breaks the script by pressing Ctrl+C it only stops the script - not even ssh client. Moreover even if I kill ssh client the remote command is still running...</p>
  
  <p>How can make bash to kill local ssh client and remote command invocation on Crtl+c?</p>
  
  <p>A simple script:</p>
  
  <pre><code>#/bin/bash
  ssh -n -x root@db-host 'mysqldump db' -r file.sql
  </code></pre>