I had updated my
sudoers file to make some command run with root privileges by default without the need to use
sudo and entering my password. I used the command
sudo visudo and added this line to it:
<my_username> ALL=(ALL) NOPASSWD: <path/to/command --arguments>
But whenever I update macOS, my
sudoers file is reset to its defaults. A folder named
Relocated Items appears on my Desktop and it always includes the following file:
/Users/Shared/Relocated Items/Configuration/private/etc/sudoers. This happens on macOS Catalina, and also on macOS Big Sur.
How can I prevent the
sudoers file resetting to its defaults with every macOS update?