You are not logged in.
I am using powerpanel to monitor my UPC activities and whatnot. The command pwrstat require me to use sudo. But is there a way for me to work around this process? I was guessing that adding my user to a power group or something would do the trick.
Offline
Are you doing it in a script?
Dirty (and insecure) workaround is
echo password | sudo -S commandLast edited by Roken (2024-04-04 16:33:25)
Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703
/ is the root of all problems.
Offline
No. I am just running on the terminal...
Offline
Is the pwrstatd daemon/service running -- and do you still have the limitations if you explicitly start the service? Also just judging from that, adding your user to the power group "should" give you access to these things.
Offline
Yes. I am running the daemon/service, and yes, I still do need to type sudo in order for me to run the commands. Do I just add my user name to the power group like
sudo useradd –G power user?
Offline
What happens when you do not use sudo?
Offline
What happens when you do not use sudo?
Permission deniedOffline
sudo useradd –G power user
"man usermod", what's the output of "id"?
Permission denied
Is that really all?
Offline
sudo useradd –G power user
"man usermod", what's the output of "id"?
uid=1000(rangke) gid=1000(rangke) groups=1000(rangke)Permission denied
Is that really all?
Yes. Single line of
Permission deniedOffline
You're not in the power group, check the usermod manpage and nb. that you'll have to re-login to apply that.
(Running a nested login shell will do, so you don't have to completely quit the session)
Offline
Is the pwrstatd daemon/service running -- and do you still have the limitations if you explicitly start the service? Also just judging from that, adding your user to the power group "should" give you access to these things.
Isn't adding yourself to the power group kind of dangerous? Being prompted for a password when using something requiring sudo is somewhat of a safety measure.
Arch Linux with Openbox & Tint2
Offline
My preferreed solution to the likely problem would be to put the desired command (which is likely some value polling?) into sudoers as NOPASSWD, but https://wiki.archlinux.org/title/Users_ … sed_groups
Offline