I already edited sudoers file and sudo doesn't ask me for the password.

The problem is with Gnome that still displays the prompt.

Is there a way to leave the confirmation dialog, just remove the password thing? I'm not interested in paswordless login, password on login and after screen saver should stay, I just don't want to have to enter it every time I run a GUI app that requires "sudo".

BTW, it's pretty hard to search for this thing. I find either authentication on system (GUI) start, or sudo, this in Windows is called "UAC prompt", how is it called in Linux? I know the terms "privileges elevation", "run elevated" and such, but they are unrelated to, what I believe is a part of GNOME, right?

UPDATE: I tried creating a file /localauthority.conf.d/49-nopasswd.rules

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

It did nothing. I am in sudo group, but the password prompt appears as before. Of course I also did sudo service polkit restart.

  • In the specific case of synaptic, sudo synaptic is wrong anyway. If you need to call synaptic with root permissions, call synaptic-pkexec. This involves PolicyKit taken care of the necessary permissions. Despite that, the window prompting of the password will still appear. I think it is possible to get right of that setting permissions in PolicyKit. Which can be super tricky and openly speaking, I have very little experience doing that. But the take away here hopefully is: it is not sudo and the sudoers file only which takes care of permissions. PolicyKit is an important part, too.
    – noisefloor
    Feb 5 at 10:43
  • You could have a look here for collecting some information about PolicyKit and some possible configurations: wiki.archlinux.org/title/Polkit#Bypass_password_prompt
    – starkus
    Feb 5 at 10:58
  • @starkus Look, I updated the question, I tried to use the documentation to create a bypass password rule, but it doesn't seem to work. I have slightly different directory structure in my system, but it's probably irrelevant, or is it?
    – Harry
    Feb 5 at 11:43
  • @noisefloor Yes, I was using synaptic-pkexec. However "sudo synaptic" also works and doesn't even ask for the password ;) Why is it wrong to use sudo here?
    – Harry
    Feb 5 at 11:45
  • Using sudo in combination with a GUI program can mess up your desktop / system if the worst comes to the worse. May not happen, but certainly can happen, as file ownerships and due to that permissions may be misset. pkexec is more advanced with regards to that and certainly should be used if the option is there - like for synaptic.
    – noisefloor
    Feb 5 at 12:56


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.