I have a script where I'm trying to change user (from root) on boot. In /etc/rc.d/rc.local, I've changed it to cd into the script dir and execute it. It all works except for when it tries to execute:
sudo -u newuser ./myscript.sh
I get an error message:
sorry, you must have a tty to run sudo
So I went and looked in my /etc/sudoers file, and it is already set to !requiretty, which should turn that off. I have also tried alternatives such as gksudo, but apparently RHEL 6.5 only supports basic sudo.
I know the script works because I can execute it myself from terminal, it's just when I try and execute it from a boot script.