title: Passing multiple commands over sshpass
body: <p>Here is my need
  I need to login to a server and execute a command as root. </p>
  
  <p>This is what I wrote :</p>
  
  <pre><code>sshpass -p "password" ssh -t user@ip "hostname &amp; sudo su - root &amp; vmquery -rn 0 -bx | grep -i scratch | wc -l"
  </code></pre>
  
  <p>The problem is VMQUERY command is not executing as root. Any solution will be helpful</p>