sudoers.d Not Working
sudoers.d Not Working
On my Porteus, root can adjust brightness with:
$ echo 9000000 > /sys/class/backlight/intel_backlight/brightness
On Mint, this works to make brightness adjustable by non-root users.
Fails on Porteus:
$ sudo visudo -f /etc/sudoers.d/brightness
Paste into editor:
ALL ALL = (ALL) NOPASSWD: /usr/bin/tee /sys/class/backlight/intel_backlight/brightness
$ echo 9000000 > /sys/class/backlight/intel_backlight/brightness
bash: /sys/class/backlight/intel_backlight/brightness: Permission denied
How to fix?
THX
$ echo 9000000 > /sys/class/backlight/intel_backlight/brightness
On Mint, this works to make brightness adjustable by non-root users.
Fails on Porteus:
$ sudo visudo -f /etc/sudoers.d/brightness
Paste into editor:
ALL ALL = (ALL) NOPASSWD: /usr/bin/tee /sys/class/backlight/intel_backlight/brightness
$ echo 9000000 > /sys/class/backlight/intel_backlight/brightness
bash: /sys/class/backlight/intel_backlight/brightness: Permission denied
How to fix?
THX
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
sudoers.d Not Working
Menu > Preferences > System Settings > Power Management > Brightness
Works for me and I always signon as guest.
Works for me and I always signon as guest.
- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
sudoers.d Not Working
don't you need to preface that with sudo? ie:
Code: Select all
$ sudo echo 9000000 > /sys/class/backlight/intel_backlight/brightness
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
sudoers.d Not Working
the purpose of sudoers.d is to create custom security rules.ncmprhnsbl wrote: ↑31 Aug 2018, 22:38don't you need to preface that with sudo? ie:Code: Select all
$ sudo echo 9000000 > /sys/class/backlight/intel_backlight/brightness
https://www.digitalocean.com/community/ ... and-centos
It can be used to give non-root users write-access to a file, so they don't have to sudo. The sudoers.d rule for that is:
Code: Select all
ALL ALL = (ALL) NOPASSWD: /usr/bin/tee /sys/class/backlight/intel_backlight/brightness
- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
sudoers.d Not Working
i've never seen it described that way... i would say: it gives all non-root users write-access to a file, so they don't have to supply a password when using sudo.
what you're suggesting would mean that sudoers/sudoers.d is parsed every time a command is given to check if a file or binary is allowed, as opposed to when sudo is invoked..
unless i'm completely wrong .. :O
i can't comment on what goes on in Mint..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
sudoers.d Not Working
your description is prolly more correct.
i was under the impression various rules can be created, not just the one you described.
anyways, still not working.
THX
i was under the impression various rules can be created, not just the one you described.
anyways, still not working.
THX
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
sudoers.d Not Working
Code: Select all
sudo tee /sys/class/backlight/intel_backlight/brightness <<< 50
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
sudoers.d Not Working
it asks me for passwordbrokenman wrote: ↑01 Sep 2018, 17:51Working for me as guest. Confirm this worksCode: Select all
sudo tee /sys/class/backlight/intel_backlight/brightness <<< 50
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
sudoers.d Not Working
Yes that is its job, but does it work once you enter the password? If so then we can move to the sudo without password problem.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
sudoers.d Not Working
ok, yes, it works with guest password.Working for me as guest. Confirm this worksCode: Select all
sudo tee /sys/class/backlight/intel_backlight/brightness <<< 50
Only asks for password on first try. Subsequent calls don't ask for password. Seems to have a time-limit.
But it likes 5000000. 50 would be black

Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
sudoers.d Not Working
If you want sudo to run any command as guest without requiring a password (which I dont recommend) you can add this to your sudoers file.
So from a root console:
Type: visudo
Hit insert key
paste above at last line in using SHIFT + INSERT
Hit escape key
Type: \:x (don't type the backslash it is just to disable the smile from appearing. Just type colon x)
Now you should be able to change your brightness without a password.
You can find your maximum brightness which most certainly is not 5 million:
Code: Select all
guest ALL=(ALL) NOPASSWD: ALL
Type: visudo
Hit insert key
paste above at last line in using SHIFT + INSERT
Hit escape key
Type: \:x (don't type the backslash it is just to disable the smile from appearing. Just type colon x)
Now you should be able to change your brightness without a password.
You can find your maximum brightness which most certainly is not 5 million:
Code: Select all
cat /sys/class/backlight/intel_backlight/max_brightness
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
sudoers.d Not Working
But i don't want to do that. I only want all users to adjust brightness without a password.
This didn't work for me:
Code: Select all
ALL ALL = (ALL) NOPASSWD: /usr/bin/tee /sys/class/backlight/intel_backlight/brightness
nope, it's about 13 million
# cat /sys/class/backlight/intel_backlight/max_brightness
12750000
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
sudoers.d Not Working
Why can't they use this approach?

sudoers.d Not Working
hi Ed! Cuz i'm trying not to run Power Manager. Consumes a lot of RAM

Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
sudoers.d Not Working
Wow, That's about the brightness of a star!nope, it's about 13 million
So just change the file permissions if you want guest to write to it.
Code: Select all
chmod 666 /sys/class/backlight/intel_backlight/brightness
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.