Q:

How can a user get write access to "/sys"?

I'd like to know what I need to do to enable a user to modify values in /sys. As it's a sysfs, changing file permissions is not an option (and I don't like to do it on every boot).

A:

You need to use sudo.  If you only want to give them permission to modify a specific value without general sudo access, then you can write a script that updates that particular value, and configure your sudoers file to allow the user permission ONLY to run that script as root.

A:

I found a simple python/dbus/polkit example on the Ubuntuforums and changed the PolicyKit policy file defaults from
<defaults>
  <allow_any>auth_admin_keep</allow_any>
  <allow_inactive>auth_admin_keep</allow_inactive>
  <allow_active>auth_admin_keep</allow_active>
</defaults>

to
<defaults>
  <allow_any>no</allow_any>
  <allow_inactive>no</allow_inactive>
  <allow_active>yes</allow_active>
</defaults>

With this change, an unprivileged user now can communicate with the service (running as root, thus being able to write to /sys) without having to type a password (possible risks?).

