Score:1

Turning off all password prompts for specific user

cn flag
Dan

I'm looking to turn off all password authentication prompts for a specific user (let's say Steve) on my Ubuntu 21.04 machine.

I added the line steve ALL=(ALL) NOPASSWD: ALL using sudo visudo and that removed the need to authenticate Steve's password when using sudo commands. However, I still get password authentication prompts when using GUI applications such as Ubuntu Software.

Is there a way to turn these prompts off just for Steve? I still want the other accounts to receive the prompts.

hr flag
Possibly something like this: [How do I prevent PolicyKit from asking for a password?](https://askubuntu.com/questions/98006/how-do-i-prevent-policykit-from-asking-for-a-password). You'd probably want `Identity=unix-user:steve` rather than `Identity=unix-group:admin`. Disclaimer - I haven't tried it.
Dan avatar
cn flag
Dan
@steeldriver That worked perfectly thanks for the help. Do you want to leave it as an answer so I can mark the question as closed?
hr flag
Feel free to add your own answer since you've actually verified it - I was guessing about the details
Score:0
cn flag
Dan

Thanks to steeldriver's comment and user55572's answer for this answer.


Replace steve with your own user name.

  1. Open a terminal.

  2. Run sudo usermod -aG sudo steve

  3. Run sudo gedit /var/lib/polkit-1/localauthority/50-local.d/disable-passwords.pkla

  4. Add

    [Do anything you want]
    Identity=unix-user:steve
    Action=*
    ResultActive=yes
    
  5. Save the file and close

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.