title: Error "sudo: no tty present and no askpass program specified" while using with sshpass
body: <p>I want to write a script in which I need to get the content of a file from different machine <code>192.168.0.2</code> without enterging the password so I used <code>sshpass</code> with the following command : </p>
  
  <pre><code>sshpass -p "password" ssh -o StrictHostKeyChecking=no user@192.168.0.2 " ls /root/path/of/file"
  </code></pre>
  
  <p>Output : </p>
  
  <pre><code>ls: cannot access '/root/path/of/file': Permission denied
  </code></pre>
  
  <p>I get it because I sidn't login as a <code>root</code> user. So I tried : </p>
  
  <pre><code>sshpass -p "password" ssh -o StrictHostKeyChecking=no user@192.168.0.2 "sudo ls /root/path/of/file"
  </code></pre>
  
  <p>Output : </p>
  
  <pre><code>sudo: no tty present and no askpass program specified
  </code></pre>
  
  <p>What should I do?</p>