I want to be able to restart Network Manager without having to enter my password every time. I did sudo visudo and added this line:

%sudo ALL=(ALL) NOPASSWD: /bin/systemctl restart network-manager.service

No luck. It's still prompting me for my password when I try to restart NetMan. Is there a further step I've left out?


This rule should be sufficient to achieve passwordless restart of network manager. However:

  1. Do you run command exactly as you wrote it in sudoers file? For example you can not omit .service part unless your sudo rule looks like this:

    %sudo   ALL=(ALL) NOPASSWD: /bin/systemctl restart network-manager*
  2. Does sudo --list command output includes your command?

  3. Try to put your rule on a last line of sudoers file.

  4. Is target user in sudo group?

    groups $(whoami)
  • 1. I tried the command exactly as written, both prefixed by /bin and not, but it throws up a password dialog no matter how I write it. 2. Yes, it includes my command. 3. Yes, I only have one user on the system which is a member of the sudo group. – Alcuin Arundel Jun 15 '16 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.