Macos – “You are not in the sudoers file” error after running sudo command

macossudoterminal

I tried using a sudo command on my iMac to create a bootable version of Ubuntu, but when I run the command by pressing enter, I got the warning that the command might screw up my system, which I ignored.

I then received a message:

you are not in the sudoers file, the incident will be reported

and my Terminal window was then rendered useless, with the usual $ not appearing so that I could type my commands.

What in the world is "sudoers", why is this happening and how can I put a stop to it?

Best Answer

sudoers is the file that specifies which users are allowed to sudo.

You need to run sudo from an account that is Administrator of your Mac, not a regular user account. Change the association in System Preferences.