Mark Knecht wrote:

Hi,
  I'm trying to get my mythfrontend box to allow a user to shut the
machine down without the use of a keyboard. We are only using remote
controls. suso doesn't seem to be an option because it requires a
password. (AFAICT)

Is there some other way that I could make this work?

2 options:

1. Sudo can be setup to allow some commands to be run without a password. I think this entry in /etc/sudoers should work:

mythtv ALL = NOPASSWD: /sbin/shutdown

I have not tested this, so if something goes wrong, you'll have to try and figure out "man sudoers".

2. Create a setuid (chmod 4711 /sbin/shutdown_by_anyone.sh) shell script that runs shutdown. Be sure to export the PATH, and unset LD_PRELOAD and LD_LIBRARY_PATH variables at the very beginning of the script. Also make sure the interpreter line is "/bin/bash --". This doesn't fix all of the security holes with setuid shell scripts, just the most common and easiest to fix...

-Richard

--
gentoo-user@gentoo.org mailing list

Reply via email to