You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

sudo broken in catalina

After upgrading from Mojave to Catalina, sudo is broken.

Using the admin account (see https://support.apple.com/en-us/HT202035 )

sudu nano /etc/hosts


takes five minutes to prompt for a password, then gives the [admin account name] is not in the sudoers file error message.

In all previous versions of macOS, sudu has worked, given immediate prompts for passwords.

Any advice appreciated.

Posted on Oct 9, 2019 6:38 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 1, 2019 4:04 PM

The problem is not with the read-only partition, but is a problem that has existed since, at least, 2017.

With the upgrade to Catalina, the original sudoers file is replaced by a stock file.

(Verify if you have a directory linked on your desktop saying "Relocated Items", you will find your original file in the "Relocated\ Items/Configuration/private/etc/sudoers" ).


If you comment out the group rules (lines starting with %), the problem should be solved.


More details at https://discussions.apple.com/thread/7906178


Similar questions

11 replies
Question marked as Top-ranking reply

Dec 1, 2019 4:04 PM in response to mat163

The problem is not with the read-only partition, but is a problem that has existed since, at least, 2017.

With the upgrade to Catalina, the original sudoers file is replaced by a stock file.

(Verify if you have a directory linked on your desktop saying "Relocated Items", you will find your original file in the "Relocated\ Items/Configuration/private/etc/sudoers" ).


If you comment out the group rules (lines starting with %), the problem should be solved.


More details at https://discussions.apple.com/thread/7906178


Oct 9, 2019 7:07 PM in response to mat163

The operative is "all previous versions" -- but Catalina is very different. The / file system is a read-only partition now and has a special Data area that keeps the stuff that needs to remain modifiable. See the discussion at https://www.macobserver.com/analysis/macos-catalina-protects-os-read-only-volume/ and many other places (just use your favorite search engine and search for "catalina read only partition".


Might want to look over the Catalina review at ArsTechnica.com also at https://arstechnica.com/gadgets/2019/10/macos-10-15-catalina-the-ars-technica-review/ and the discussion of the read only system volume at Catalina’s read-only system volume


Security considerations have taken over a lot of what used to be OK to modify.


Good luck...

Nov 11, 2019 10:40 AM in response to Lismore-Designs

There should already be an entry for all "admin" users in the "wheel" group to be able to issue "sudo" command.


Perhaps try a "safe" boot and see if that helps.


The problem is the read-only / file system in many/most/all cases.


There is a very limited way to modify / by using something called "synthetic" links -- see "man synthetic.conf" for more info. But all that does is allow you to create links in the /System/Volumes/Data folder to other places in the "read-only" portion of the file system. Not quite the same as having a writable / filesystem. And it requires a reboot to make the change take affect, so not something that is especially convenient.


This sort of fundamental change to the way you use/administer a mac system is really quite a bothersome situation to me and would guess many other people who are used to being able to modify your own system without the OS putting up roadblocks to what you want to change to fit your own preferences. But those days are over it would seem, and I'm guessing maybe it might be time to look into using Mac systems with another operating system in some situations, like Linux or ??? That will be a very sad day, indeed, but certainly a possibility.


Good luck...

Nov 25, 2019 3:15 PM in response to kcwoodfield

kcwoodfield wrote:

How do you change the sudoers file when you aren't a sudoer? Below is what I get when I try to alter /etc/sudoers:

<username> is not in the sudoers file. This incident will be reported.



You don’t.

You need be an admin user.

If you have no admin user, or forgot your admin user login, follow the existing discussions of how to recover from that; you’ll have to break into macOS, and how to do that varies by Mac and by version of macOS.

Jan 15, 2020 2:02 PM in response to abismo

Thanks @abismo, in my case the "Relocated Items" folder had my pre-Catalina sudoers file in it, and it was a matter of manually bringing over the lines I needed into Catalina's via visudo.


Not sure why the Catalina upgrade don't merge that file automatically, I speculate b/c it could be considered a higher risk?


Regardless, thanks for the tip, that sorted me out.

sudo broken in catalina

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.