Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't skip Authentication Required despite sudoers edit #58

Closed
MLSci opened this issue Dec 26, 2024 · 6 comments
Closed

Can't skip Authentication Required despite sudoers edit #58

MLSci opened this issue Dec 26, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@MLSci
Copy link

MLSci commented Dec 26, 2024

Describe the bug

Usually in situations such as opening apps like the KDE Partition Manager, an Authentication Required pops up and I’ll need to type the password to authenticate as myself. I’m the only person using this computer and would like a way to avoid having to type password every time doing things such as managing disks.

So far I’ve tried sudo visudo to edit sudoers by adding
Defaults timestamp_timeout = -1
Defaults !authenticate
or
%wheel ALL=(ALL) NOPASSWD: ALL
my_name ALL=(ALL) NOPASSWD: ALL at the end,
but none works.

What did you expect to happen?

Ideally, once I log into the desktop session, I’d like to not have to type password again until I log out or reboot. Or at least when authentication is required, I can simply click OK or press enter to confirm I’m the admin like in Windows.

Output of bootc status

Current staged state is native ostree
Current booted state is native ostree
Current rollback state is native ostree

Output of groups

my-name wheel video usershares docker lxd incus-admin libvirt pcp plugdev adbusers nfs

Extra information or context

Operating System: Aurora-DX 41
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.5-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa Intel® HD Graphics 630
@dosubot dosubot bot added the bug Something isn't working label Dec 26, 2024
@m2Giles
Copy link
Member

m2Giles commented Dec 26, 2024

The graphical popup is not sudo but is actually polkit.

You would need to modify the polkit policy.

@MLSci
Copy link
Author

MLSci commented Dec 26, 2024

The graphical popup is not sudo but is actually polkit.

You would need to modify the polkit policy.

Thanks for the info. Mind elaborate a bit? I'm not familiar with polkit..

@castrojo castrojo transferred this issue from ublue-os/bluefin Dec 26, 2024
@ledif
Copy link
Collaborator

ledif commented Dec 27, 2024

Polkit is what controls privilege escalation for applications like KDE Partition Manager. You can create a global polkit rule to allow any user in the wheel group to automatically be granted privileges instead of asking each time.

Create a file named /etc/polkit-1/rules.d/99-nopasswd_global.rules with the following contents:

polkit.addRule(function(action, subject) { 
  if (subject.isInGroup("wheel")) {
    return polkit.Result.YES; 
  } 
});

This should make it so apps like KDE Partition Manager won't ask for a password.

See https://wiki.archlinux.org/title/Polkit#Examples for more examples and info.

@MLSci
Copy link
Author

MLSci commented Dec 28, 2024

Polkit is what controls privilege escalation for applications like KDE Partition Manager. You can create a global polkit rule to allow any user in the wheel group to automatically be granted privileges instead of asking each time.

Create a file named /etc/polkit-1/rules.d/99-nopasswd_global.rules with the following contents:

polkit.addRule(function(action, subject) {
if (subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
This should make it so apps like KDE Partition Manager won't ask for a password.

See https://wiki.archlinux.org/title/Polkit#Examples for more examples and info.

Thanks for the detailed instruction. I always thought sudo is the only way to control privilege escalation. So now polkit has replaced the role of sudo, or .. ? Is this why editing sudoers doesn't work but editing polkit works?

@ledif
Copy link
Collaborator

ledif commented Dec 28, 2024

Although not entirely accurate, you can view sudo as suited for privilige escalation of command-line applications and polkit suited for privilge escalation of GUI applications. This is not completely true, but it can be useful for determining which of the two is probably responsible for the app you're trying to run.

@MLSci
Copy link
Author

MLSci commented Dec 28, 2024

Both sudo and polkit need to be edited to achieve the purpose for all (CLI and GUI) use cases. In the old days sudo alone is sufficient (?) since most apps are CLI apps.

@MLSci MLSci closed this as completed Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants