0

I've given my user root permission to run systemcl via visudo.

# visudo
XXXXXX ALL=NOPASSWD: /bin/systemctl restart shiny-server.service

After logging out and back in, I run the command:

$ /bin/systemctl restart shiny-server.service

And get:

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'shiny-server.service'.
Authenticating as: XXXXXXX
Password:

I'm seeing things on line talking about polkit but I'm not sure if that also needs to be configured along with visudo. What's required here to prevent a password from being required to run the command as a specified user?

Chris
  • 85
  • 1
  • 5

1 Answers1

0

You set up sudo to allow you to run a command without a password, but you didn't actually run the command with sudo!

To fix the problem, run the command with sudo.

sudo /bin/systemctl restart shiny-server.service
Michael Hampton
  • 237,123
  • 42
  • 477
  • 940