I added this user:
$ adduser --system --home /no/home --no-create-home --group --disabled-password --disabled-login testuser
User added to group:
$ adduser testuser testgroup
Added lines for sudoers (visudo):
testuser ALL=(ALL) NOPASSWD: ALL %testgroup ALL=(ALL:ALL) NOPASSWD: ALL
When I try to run a bash script with the following contents:
#!/bin/sh sudo -u testuser /usr/bin/php /usr/local/bin/script.php
But when I run this script, I get an error in the log:
sudo: no tty present and no askpass program specified
Edit: requiretty not in the sudoers file.
linux bash tty sudo
Tim mishutin
source share