title: How to start SSH on a chroot Linux
body: <p>I managed to initiate Linux on my Android phone through the terminal and even start the SSH service and tested it using ConnectBot. However, this is a manual operation. I was thinking more of an automated way of doing this.</p>
  
  <p>I used this Linux mechanism: <a href="http://mitchtech.net/android-backtrack-chroot/" rel="nofollow">http://mitchtech.net/android-backtrack-chroot/</a></p>
  
  <p>My main issue I believe is that I'm trying to do some steps before and after <code>chroot</code> is done, which didn't seem to work on an Android app:</p>
  
  <pre><code>Runtime.getRuntime().exec("su");
  
  //Mount the image
  Runtime.getRuntime().exec("startbt");
  
  //chroot into Linux
  Runtime.getRuntime().exec("bt");
  
  //From inside chroot, start the ssh service
  Runtime.getRuntime().exec("/etc/init.d/ssh start");
  </code></pre>
  
  <p>This also did not seem to work:</p>
  
  <pre><code>Runtime.getRuntime().exec("su &amp; startbt &amp; bt &amp; /etc/init.d/ssh start");
  </code></pre>
  
  <p>I'm guessing again this is an issue what is interpreted as inside or outside the chroot. My main quest eventually is to start the SSH service automatically, not necessarily through an Android app.</p>