sudoers.d Not Working

Technical issues/questions of an intermediate or advanced nature.
johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

sudoers.d Not Working

Post#16 by johnywhy » 02 Sep 2018, 02:25

brokenman wrote:
02 Sep 2018, 01:31
use the keyboard to change brightness.
i don't seem to have that option. My laptop has a brightness key with only 3 positions: too bright, too bright,and too dim. Not sure if that key does anything in Porteus, will try.
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

sudoers.d Not Working

Post#17 by brokenman » 02 Sep 2018, 11:01

Ok. Use the above command as root to change the file permissions then save the file into your rootcopy folder to overwrite all other layers.

Code: Select all

cp -a --parents /sys/class/backlight/intel_backlight/max_brightness /mnt/sdXy/porteus/rootcopy
After that guest should be able to write to the file without needing sudo.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2495
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

sudoers.d Not Working

Post#18 by ncmprhnsbl » 02 Sep 2018, 11:23

looked into this a bit further:
your /etc/sudoers.d/brightness should work if you use this command:

Code: Select all

$ echo 9000000 | sudo tee /sys/class/backlight/intel_backlight/brightness
from here: https://www.linuxquestions.org/question ... ost5720420
my test:

Code: Select all

# visudo -f /etc/sudoers.d/test
ALL ALL=(ALL) NOPASSWD: /bin/tee /root/test
:x
$echo 100 | sudo tee /root/test
100
#cat /root/test
100
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

sudoers.d Not Working

Post#19 by johnywhy » 02 Sep 2018, 18:01

thx brokenman and ncmprhnsbl! i will try these as soon as i can get back into Porteus Slim alternative? (Post by johnywhy #66308)
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

sudoers.d Not Working

Post#20 by johnywhy » 03 Sep 2018, 09:26

i noticed i can run the power applet without running the power manager.
so i get brightness slider, just for the price of running the panel applet.
not bad!
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

sudoers.d Not Working

Post#21 by johnywhy » 06 Sep 2018, 03:34

brokenman wrote:
02 Sep 2018, 01:31
change the file permissions if you want guest to write to it.

Code: Select all

chmod 666 /sys/class/backlight/intel_backlight/brightness
Great! That worked. tho it would be cool to solve the sudoers issue.

Ed, here's a brightness slider i made that doesn't depend on any background services like Power Manager. Works for me on Porteus 32-bit desktop.
Image

http://murga-linux.com/puppy/viewtopic.php?t=114229

It needs yad, which you can download and convert from here.
http://archive.ubuntu.com/ubuntu/pool/universe/y/yad/

And the user needs write-permission on the brightness file.

Code: Select all

chmod 666 /sys/class/backlight/intel_backlight/brightness
cheers!
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

User avatar
Ed_P
Contributor
Contributor
Posts: 5514
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

sudoers.d Not Working

Post#22 by Ed_P » 06 Sep 2018, 04:12

Interesting. And thanks. :)

You can get yad from Porteus's USM.

Code: Select all

guest@porteus:~$ su
Password: 
root@porteus:/home/guest# usm -i yad

 The following items were found.
 Choose an number to confirm. 
 ctrl+c to quit

1) yad-0.40.0-x86_64-1_slonly.txz
2) phpmyadmin-4.8.2-noarch-1_slonly.txz
3) yadifa-2.2.4-x86_64-1_slonly.txz
#? 
But why can't the user use the keyboard's Alt+F12 or Alt+F11 to raise or lower the brightness of their screen? :%)
Ed

johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

sudoers.d Not Working

Post#23 by johnywhy » 06 Sep 2018, 04:50

ALT-F11 and ALT-F12 seem to affect my Porteus panel and windows. Seems to set z-order or focus or something.

I found yad in the USM. But before downloading, i updated all the repos. Now it no longer comes up in USM search! And i'm getting:

Code: Select all

root@porteus:/home/guest# usm -i yad
find: `/tmp/xdg-runtime-guest/gvfs': Permission denied
 Nothing found for:  yad
Hrm....
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

User avatar
Ed_P
Contributor
Contributor
Posts: 5514
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

sudoers.d Not Working

Post#24 by Ed_P » 06 Sep 2018, 06:00

:%)

I don't have that problem.

Code: Select all

guest@porteus:~$ su
Password: 
root@porteus:/home/guest# usm -u all
slackware was updated 31 seconds ago. Skipping.
 Starting slackwarepatches database update 
Downloading: vercheck.txt  DONE
Downloading: CHECKSUMS.md5  DONE
Downloading: MANIFEST.bz2  DONE
Downloading: PACKAGES.TXT  DONE
Downloading: LIBS.TXT.gz  DONE
File verification was good.
Optimizing manifest
 slackwarepatches  database updated. 

 Starting slacky database update 
Downloading: CHECKSUMS.md5.gz  DONE
Downloading: MANIFEST.bz2  DONE
Downloading: PACKAGES.TXT.gz  DONE
Downloading: LIBS.TXT.gz  DONE
File verification was good.
Optimizing manifest
 slacky  database updated. 

 Starting salix database update 
Downloading: CHECKSUMS.md5  DONE
Downloading: PACKAGES.TXT  DONE
Downloading: LIBS.TXT.gz  DONE
Downloading: OPTIFEST.gz  DONE
 salix  database updated. 

 Starting alien database update 
Downloading: CHECKSUMS.md5.gz  DONE
Downloading: MANIFEST.bz2  DONE
Downloading: PACKAGES.TXT.gz  DONE
Downloading: LIBS.TXT.gz  DONE
File verification was good.
Optimizing manifest
 alien  database updated. 

 Starting ponce database update 
Downloading: CHECKSUMS.md5.gz  DONE
Downloading: MANIFEST.bz2  DONE
Downloading: PACKAGES.TXT.gz  DONE
Downloading: LIBS.TXT.gz  DONE
Optimizing manifest
 ponce  database updated. 

 Starting slackonly database update 
Downloading: CHECKSUMS.md5.gz  DONE
Downloading: MANIFEST.bz2  DONE
Downloading: PACKAGES.TXT.gz  DONE
Downloading: LIBS.TXT.gz  DONE
File verification was good.
Optimizing manifest
 slackonly  database updated. 

 Starting sbo database update 
SLACKBUILDS.TXT.gz
Downloading: SLACKBUILDS.TXT.gz  DONE
 sbo  database updated. 


Downloading: extra-deps.txt  DONE
Downloading: ignore-deps.txt  DONE

root@porteus:/home/guest# usm -i yad

 The following items were found.
 Choose an number to confirm. 
 ctrl+c to quit

1) yad-0.40.0-x86_64-1_slonly.txz
2) phpmyadmin-4.8.2-noarch-1_slonly.txz
3) yadifa-2.2.4-x86_64-1_slonly.txz
#? 1

Package:  yad-0.40.0-x86_64-1_slonly.txz  (168 K) [not installed]
yad: yad (displays graphical dialogs from shell scripts or command line)
yad:
yad: Yad (yet another dialog) is a fork of Zenity with many improvements,
yad: including custom buttons, additional dialogs and a pop-up menu in
yad: the notification area.
yad:
yad: There were two main reasons for this fork.  The first was to remove
yad: dependencies on deprecated libraries like libglade and gnome-canvas.
yad: The second was the slow pace of Zenity development including many
yad: unimplemented enhancement suggestions in the GNOME Bugzilla.
yad:

root@porteus:/home/guest# 

Ed

Post Reply