title: Postgres Tunneling SSH -L In background
body: <p>I'm trying to open an ssh connection to let one server access a remote postgres database. So I followed the instructions in this postgres <a href="http://www.postgresql.org/docs/8.2/static/ssh-tunnels.html" rel="nofollow">help page</a>. </p>
  
  <p>When I run the command: </p>
  
  <pre><code>ssh -L 3333:foo.com:5432 joe@foo.com
  </code></pre>
  
  <p>It connects me automatically to the remote server the same way it would with a regular ssh. At that point my connection works fine. The problem I'm facing is when I close the terminal, the connection is lost so I looked on how to run that same command in the background but with no luck. This is what I tried but it doesn't actually work:</p>
  
  <pre><code>nohup ssh -L 3333:foo.com:5432 joe@foo.com &amp;
  </code></pre>
  
  <p>How can I run the ssh -L tunneling command in the background?</p>
  
  <p>Thanks in advance.</p>