title: Launch ssh process in the background with Paramiko
body: <h3>What I want</h3>
  
  <p>I would like to ssh to a remote machine, start a process in the background, and retrieve the pid.</p>
  
  <pre><code>mrocklin@notebook:~$ echo hello &amp;    
  [1] 29974
  hello
  </code></pre>
  
  <h3>What I tried</h3>
  
  <p>I would like to do this same thing with Paramiko</p>
  
  <pre><code>In [1]: import paramiko
  In [2]: client = paramiko.SSHClient()
  In [3]: client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  
  In [4]: client.connect('127.0.0.1')
  In [5]: stdin, stdout, stderr = client.exec_command('echo hello &amp;')
  
  In [6]: stderr.read()
  Out[6]: b''
  In [7]: stdout.read()
  Out[7]: b'hello\n'
  </code></pre>
  
  <p>When I do this with a process like <code>sleep</code>, <code>stdout.read()</code> blocks, cementing the fact that this isn't happening in the background.  </p>
  
  <h3>What I really want</h3>
  
  <p>I want to run processes in the background because I want the ability to kill the process based on the PID later if I choose.  Is there a better way to go about launching and killing several processes on a remote machine?</p>