title: tmux session closes when ssh terminal closes
body: <p><em><strong>What I am trying to do:</em></strong>
  I am trying to execute couple of bash commands on a remote machine using ssh and I want those commands to finish execution even after ssh-session is closed in the middle of execution.</p>
  
  <p><em><strong>What I have done so far :</em></strong>
  I am using Putty to connect to ssh (one of the reasons of using putty is that one machine is windows and remote machine is mac-os and I need some way to initiate ssh through Python command). I am passing command.txt file and it contains all the commands I want to execute.</p>
  
  <pre><code>putty -ssh start-ts@ip.000.001.101 -m command.txt ( not real ip)
  </code></pre>
  
  <p>command.txt : looks like this :</p>
  
  <pre><code>export PATH=$PATH:/usr/local/bin
  echo $PATH; sleep 1
  tmux -c 'queue.sh'
  sleep 100
  </code></pre>
  
  <p>After connecting to ssh, to make sure that my script/commands continue running on remote machine even after ssh-session is closed on another machine, <strong>I am using 'tmux'</strong></p>
  
  <p><em><strong>But the Problem is :</em></strong> 
  Even after using tmux, processes called by queue.sh terminate as soon as I close ssh-session.</p>
  
  <p>I have also tried </p>
  
  <pre><code>export PATH=$PATH:/usr/local/bin
  echo $PATH; sleep 1
  tmux
  queue.sh
  sleep 100
  </code></pre>
  
  <p>does the same thing.</p>
  
  <p><em><strong>What I also tried :</em></strong> 
  If I just pass following commands using ssh (in command.txt)</p>
  
  <pre><code>export PATH=$PATH:/usr/local/bin
  echo $PATH; sleep 1
  tmux
  </code></pre>
  
  <p>and then manually type queue.sh in tmux terminal, is that case I can close ssh-terminal and remote machine continues execution of processes.</p>
  
  <p><em><strong>Any suggestion ?</em></strong> 
  I want to be able to pass everything though script files and keeping the processes running on remote machine (mac-os) even after closing ssh-session on another machine.</p>
  
  <p>Thanks</p>