The poster of this [HowTo] does not take responsibility for damages after applying changes to the settings. You use the below on your own responsibility. The kdesu section is intended exclusively for KDE users.
DISCLAIMER:
BEWARE OF THE UNSPEAKABLE HORRORS WHICH MAY INFEST YOUR SYSTEM AS YOU HAVE ONLY YOURSELF TO BLAME. ANY DAMAGES TO YOUR SYSTEM - DIRECTLY OR INDIRECTLY INCLUDING BUT NOT LIMITED TO - MALWARE INFECTION - ACCIDENTAL REMOVAL OF SYSTEM FILES OR SYSTEM MALFUNCTION IS YOUR RESPONSIBILITY.
Issue
The sudo prompt (GUI and terminal) require you to enter the root password each time.
Main bypass guide
Set nano temporary as default editor for visudo and edit sudoers file:
sudo -i
export EDITOR=nano
visudo
Add at end of file:
@includedir /etc/sudoers.d
Save the changes. Changes are applied immediately.
Set nano as visudo default editor. Create file:
sudo nano /etc/sudoers.d/02-visudo-editor
with code
## Set nano as default editor
Defaults env_reset
Defaults editor=/usr/bin/nano, !env_editor
Skip password prompt for current user. Remember to use your UID instead of user_name. Create file:
sudo nano /etc/sudoers.d/01-skip_auth
with code
## Skip password prompt for current user
Defaults:user_name !authenticate
Save the changes. Changes are applied immediately.
Create a new Polkit rule in your favorite editor as root:
in /etc/polkit-1/rules.d/49-nopasswd_global.rules add/change:
/* Allow members of the wheel group to execute any actions
* without password authentication, similar to "sudo NOPASSWD:"
*/
polkit.addRule(function(action, subject) {
if (subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
Ensure that you are a member of the wheel group:
groups
IF NOT, then add yourself:
sudo usermod --append --groups wheel user_name
Reboot to apply the above settings
KDE additional bypass guide (follow after applying the above guide)
Set sudo as the default tool for kdesu command. Create file ~/.config/kdesurc with content:
I agree especially the polikit part…
If the ultimate intention is to have full access to everything without needing a password, then changing the UID/GID of the user to be 0 (zero) would be the definitive answer
So yea my advice would be to explicitly configure each command to be allowed to be used without password when using sudo in separate configs, but this howto is not about that part…
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
## Same thing without a password
#%wheel ALL=(ALL) NOPASSWD: ALL
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL
Since I switched to Linux less than 2 months ago I have developed an intensifying aggression control issue toward my PC, I am keep trying to stop myself smashing my 100 Eur keyboard into pieces when the system is keep asking a root/admin pass over and over again while I am in the “same process” that I have initiated seconds or a min ago… Especially because my root pass is not 1234 kind…
Maybe you should reconcile what you are doing because root access is something that is rarely needed under normal operation…
That’s why the need for a password, to kindly wake you up about the action you are trying to perform…