title: how to ssh onto a host without password using java
body: <p>Im currently using a java application to run commands on a unix box by invoking an instance of the bash as follows --</p>
  
  <pre><code>proc = Runtime.getRuntime().exec("/bin/bash", null, wd);
  </code></pre>
  
  <p>and Im executing commands on the  box by Printwriter as follows --</p>
  
  <pre><code>PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())), true);
  </code></pre>
  
  <p>Now, as a requirement I need to ssh onto another host, invoke an instance of that host's bash and run some commands. If this can be done without having to enter the password, it would be great. If not, how do I make the application to enter the 'password' at the right time? Reading the output of the shh command and based on that, writing out the password does not seem appealing.</p>
  
  <p>Any pointers on the above would be of great help.</p>
  
  <p>Regards
  p1nG</p>