“user is not in the sudoers file. This incident will be reported.”
An issue that I run into for quite some time under Mac OSX 10.6 (but also 10.5) – Snow Leopard and Leopard – was
“user is not in the sudoers file. This incident will be reported.”
I received this message when conducting operations in Terminal such as installing things from command-line or changing entries in /etc/hosts/
Regardless of my username/password combo having Administrator rights I continued to receive this note.
Just recently I fixed this “is not in sudoers file” problem by going through these steps:
1) Logout of your current account
2) Login as root
2a) Obviously you need to be able to “switch/change users”, if you don’t have this option, either go here or conduct these steps:
- Choose Apple menu > System Preferences, and click Accounts.
- If some settings are dimmed, click the lock icon and type an administrator name and password.
- Click Login Options.
- Select “Enable fast user switching.”
3) Being logged in as root (you will need to recall your root password! – if you cannot or don’t have one, Google how to setup a root password) you open Terminal
4) In Terminal you enter
echo ‘the-user-name-that-is-giving-you-the-trouble ALL=(ALL) ALL’ >> /etc/sudoers
* obviously you will want to replace the-user-name… bit with your own username.
for instance, to give you an example:
echo ‘mike ALL=(ALL) ALL’ >> /etc/sudoers
Now you can quit and relogin as your regular user (e.g. mike) and run any sudo operation using your regular user name and password combo.