title: Is it safe to type password when scripting commands via ssh?
body: <p>I've seen this handy command to query a distant database from my local machine:</p>
  
  <pre><code>ssh user@server 'mysql -uimauser -pPassWord imadb -e "select * from table"'
  </code></pre>
  
  <p>But I wonder how safe it is?
  Can anyone capture the password? If so how?</p>
  
  <p>I'm aware that this works well too:</p>
  
  <pre><code>ssh user@server 'mysql -uimauser -p imadb -e "select * from table"'
  </code></pre>
  
  <p>But for automation purpose, I would prefer the first solution (if safe of course).
  I've tried to capture the password with ps but I didn't see anything (my knowledge of ps is also very poor).</p>