Yes -- my bad, and good spot.
I've just tested on Monterey and the above works perfectly (after fixing the mistake you pointed out!). It's most likely that you haven't got the visudo
line quite right. Is username
your actual username or have you changed it for privacy reasons?
Easiest check is to open a new Terminal window (when you use sudo
and authenticate you don't need to reauthenticate in that Terminal window for a few minutes -- a new window/session gets round that) and try
sudo tmutil enable
...and if you are prompted for a password the entry in the /private/etc/sudoers.d/tmutil
file is wrong.
For comparison, my "short username" is nigel
and a working line is:
nigel ALL=NOPASSWD: /usr/bin/tmutil enable, /usr/bin/tmutil disable, !/usr/bin/tmutil enable *, !/usr/bin/tmutil disable *
If you're worried about going deeper in a public Forum, DM me.