title: How to sudo on a computer using ssh inside a bash script
body: <p>I'm trying to run a bash script that has:</p>
  
  <pre><code>ssh -l &lt;username&gt; &lt;compname&gt; 'sudo yum -y install expect'
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>sudo: sorry, you must have a tty to run sudo
  </code></pre>
  
  <p>on some computers but on others the process runs smooth. How can I prevent this?</p>