title: how to make SSH command execution to timeout
body: <p>I have a program like this:</p>
  
  <pre><code>ssh -q harigm@8.19.71.238 exit
  echo "output value  --&gt;$?"
  </code></pre>
  
  <p>In the above code, I am trying to SSH to the remote server, and tries to check if I can connect or not.
  I have few servers, which is password less is activated and few servers for which passwords are still not yet deactivated.
  So my concern, if there is a password, it will get stuck in the same screen asking for the password and it will be there for infinite time, without Exit logic.</p>
  
  <p>Question : How to implement the timers for the above code, and if it stays in the same screen asking for the password. and exit with some error code</p>
  
  <p>2) When I execute the above code, i get the following error codes: </p>
  
  <pre><code>127 -- &gt; I guess its for success
  225 -- &gt; for any error.
  </code></pre>
  
  <p>are there any other error codes other than above?</p>