title: SSH: Send remote command to local background
body: <p>So I have a problem similar to <a href="https://stackoverflow.com/questions/8184717/how-to-send-ssh-job-to-background">how to send ssh job to background</a>.</p>
  
  <p>I have a windows c# program automated to execute tcpdump on a remote linux os using <a href="http://sshnet.codeplex.com/" rel="nofollow noreferrer">http://sshnet.codeplex.com/</a>.  I'm trying to execute tcpdump on the remote linux and leave it running after I disconnect.</p>
  
  <p>I've been doing a lot of debugging using plink, but cannot seem to achieve the desired result.  I've tried:</p>
  
  <pre><code>plink root@10.5.1.1 bash -c "tcpdump -i eth0 -w test.cap"
  </code></pre>
  
  <p>but it holds the sshclient until I ctrl+C (not going to work for automated solution).  I've also tried variations of:</p>
  
  <pre><code>plink root@10.5.1.1 bash -c "tcpdump -i eth0 -w test.cap &amp;"
  </code></pre>
  
  <p>but either the command is not executed at all (test.cap does not exist) or is terminated immediately (test.cap contains 1 line).  During testing, I've left a ping going, so the capture should have  <em>somthing</em>...</p>
  
  <p>The previously mentioned link solves the problem with <strong>screen</strong>, but the remote linux os is not configurable and does not have <strong>screen</strong>.  Any suggestions are welcome.</p>