[mythtv-users] How do I use sudo to write to a root-owned file?

Roy Lofthouse lofty69 at gmail.com
Mon Oct 12 09:05:56 UTC 2009


2009/10/12 Chris Adams <rocket at extremelan.net>:
>>> It's much easier to all specific sudo access to a command like tee in
>>> a specific folder than to a whole script...
>>>
>>> simply edit the /etc/sudoers file with the proper configuration
>>
>> Ahhh, I have only ever added a user to the sudoers file. I didn't
>> realize you could control things with that type of granularity in the
>> sudoers file. Perhaps that is the information that would be useful to
>> the OP.
>
> Another note on the granularity; in the sudoers file you can also
> control which parameters are allowed. You can let the mythtv user only
> "sudo tee" stuff to /sys/class/rtc/rtc0/wakealarm. It avoids the
> ability to hose other system files, however unlikely that is.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

here's the line from my sudoers:

mythtv  SERVER = NOPASSWD: /usr/bin/halt -p, NOPASSWD:
/usr/bin/mythshutdown, /sbin/reboot, /sys/class/rtc/rtc0/wakealarm,
/usr/share/mythtv/shutdown

I run a script to shutdown my system as a user.


More information about the mythtv-users mailing list