You are not logged in.
according to Wiki, backlight can be set by
echo 5 > /sys/class/backlight/acpi_video0/brightnessbut only as root. What change to do with visudo to allow user to set value?
Last edited by dabbi2000 (2012-02-03 08:13:22)
Offline
You need to run the following command:
echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightnessor
sudo bash -c "echo 5 > /sys/class/backlight/acpi_video0/brightness"Offline
The standard way to do that using sudo would be with tee. But you certainly don't want to grant special permissions to tee. I think you would need to create a script:
#!/bin/bash
echo 5 > /sys/class/backlight/acpi_video0/brightnessStore it in /usr/bin, make it writable by root only, and configure sudoers to allow this script.
Keep in mind I'm no security guru. There may be serious considerations with this method that I'm not aware of.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
thx everyone, I will go with the /usr/bin script way since I want to refrain from installing sudo
Offline
You need sudo to use the script method as I described it. The idea is to put a line in sudoers allowing the average user to use sudo only with the script:
%users <hostname>=(ALL) /usr/bin/<scriptname>However, you could probably also make the script setuid.
It bears repeating that I am no security expert and you should take my suggestions with a grain truckload of salt.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
I want to refrain from installing sudo
Then why are you talking about using visudo?
Offline
visudo changes the /etc/sudoers file, sudo is a whole different thing!
Offline
visudo changes the /etc/sudoers file, sudo is a whole different thing!
Let me ask you a question: Which app do you think is the most likely candidate to be using the /etc/sudoers file?
Offline
ok, got it. sudo uses /etc/sudoers. Thought it was a symlink hack of somekind, stupid me. Still I think I am correct that using sudoers directly is the more correct Arch way, doing it manually...
Offline
you could solve it with permissions. In /etc/rc.local put :
chmod go+rw /sys/class/backlight/acpi_video0/brightnessOffline
thx rwd, your suggestion works like a charm, feels better than editing the sudoers file
Last edited by dabbi2000 (2012-02-05 07:22:12)
Offline