1 |
Mark Knecht wrote: |
2 |
|
3 |
>Hi, |
4 |
> I'm trying to get my mythfrontend box to allow a user to shut the |
5 |
>machine down without the use of a keyboard. We are only using remote |
6 |
>controls. suso doesn't seem to be an option because it requires a |
7 |
>password. (AFAICT) |
8 |
> |
9 |
> Is there some other way that I could make this work? |
10 |
> |
11 |
> |
12 |
> |
13 |
|
14 |
2 options: |
15 |
|
16 |
1. Sudo can be setup to allow some commands to be run without a |
17 |
password. I think this entry in /etc/sudoers should work: |
18 |
|
19 |
mythtv ALL = NOPASSWD: /sbin/shutdown |
20 |
|
21 |
I have not tested this, so if something goes wrong, you'll have to try |
22 |
and figure out "man sudoers". |
23 |
|
24 |
2. Create a setuid (chmod 4711 /sbin/shutdown_by_anyone.sh) shell script |
25 |
that runs shutdown. Be sure to export the PATH, and unset LD_PRELOAD |
26 |
and LD_LIBRARY_PATH variables at the very beginning of the script. Also |
27 |
make sure the interpreter line is "/bin/bash --". This doesn't fix all |
28 |
of the security holes with setuid shell scripts, just the most common |
29 |
and easiest to fix... |
30 |
|
31 |
-Richard |
32 |
|
33 |
-- |
34 |
gentoo-user@g.o mailing list |