3

To what exactly do I need to change sudoers file to prevent asking for password when I change system time zone?

This is the command I am going to run:

sudo systemsetup -settimezone timezone

I know I need to change it, but I feel uncomfortable changing sudoers on my own due to not knowing exactly what I am doing.

5

Was brave enough to do it myself. For future readers, add:

yourusername ALL=(ALL) NOPASSWD: /usr/sbin/systemsetup

after

## User privilege specification
##
root ALL=(ALL) ALL
%admin  ALL=(ALL) ALL
  • You should also add running "sudo visudo" first – Neo Dec 5 '18 at 19:45
2

To enable passwordless sudo for all admin users on the machine:

  1. Run sudo visudo
  2. Change the line reading %admin ALL=(ALL) ALL to %admin ALL=(ALL) NOPASSWD ALL
  3. Save changes (press Escape, type :wq! at the command prompt and hit enter).
0

issue

sudo visudo

and assure file contains these lines ( replace yourusername )

root ALL=(ALL) ALL
%admin ALL=(ALL) ALL
yourusername  ALL=(ALL) ALL

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .