I am trying to allow a specific user to run a specific .sh
file that has a sudo chmod
inside of it.
I have followed this guide: How to allow a command to be executed for a particular user without password with sudoers file?
My sudoers file now looks like this:
the_user ALL=(ALL:ALL) NOPASSWD: /var/www/html/storage/fix_cache_permissions.sh
However, when I run the command:
sh /var/www/html/storage/fix_cache_permissions.sh
it dies with this error:
sudo: no tty present and no askpass program specified
Update
I tried both having sudo inside the .sh
file and outside when running the command. Both results in the same error message.