title: Linux - Pass password inside script shell
body: <p>I have trouble to pass a password automatically in my script. This is how it looks like when I do it manually:</p>
  <pre><code>sshfs -o nonempty user@sftp.server.com:/ /home/administrator/data
  </code></pre>
  <p>I am now forced to enter the password for <code>sshfs</code>:</p>
  <pre><code>password
  </code></pre>
  <p>I try to automate that in a script and pass the password like this to standard input:</p>
  <pre><code>#!/bin/bash
  
  echo &quot;password&quot; | sudo -S sshfs -o nonempty user@sftp.server.com:/ /home/administrator/data
  </code></pre>
  <p>When I run the script, I am still forced to enter the password. What am I doing wrong?</p>