I am running some scripts as part of pre/post deploy using DeployHQ, I need to be able to call the script on one line and for there to be no feedback from the terminal so I want to pass the password into the sudo command (instead of sudo asking for the password at the time of use)
I am trying to get sudo
to work with stdin
by doing something like;
echo my_password | sudo -S chown -R my_user:www-data /srv/www/my_site/public_html/
But what is getting returned is;
[sudo] password for my_user:
Sorry, try again.
[sudo] password for my_user:
sudo: 1 incorrect password attempt
The password in question is correct and when the command is ran without -S
and the user is prompted for the password is works.
Could someone point out what I am doing wrong?
Just to clarify - I want there to still be a password, just one that I can pass in.