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