I can not log in after changing the user ID from 501 to 0

Good day to all!

I ask for help! My problem:

Macbook Air, Catalina.

Out of stupidity, without understanding, I changed my ID from 501 to 0 (root) in System Preferences - "Accounts and Users".

As a result, when I try to log into my (the only one on my computer) account, after the standard procedure for entering the user password, I am transferred to a window where it is proposed to enter the Name and Password again.

I’ve gone through all the combinations of names and passwords that I use that have not led to anything.

if I exit this window (left arrow) - I get to the user’s window “other”.

I found a way to solve the problem by deleting the .AppleSetupDone file or by creating another user with admin rights.

But in single - user mode, despite the fact that I am designated as root user, I do not have write and execute permissions.

I tried to set root rights through the dsenableroot command, but there I need a root password that I did not set.

When trying to recover through utilities (cmd + R), nothing came of it:

 reinstall the operating system - "cannot continue installing macOS";

 resetpassword via terminal - lots of text and nothing.

I do not want to erase the data disc.

Please tell me if there are at least some ideas!

MacBook Air 13", macOS 10.15

Posted on Dec 7, 2019 5:54 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 8, 2019 9:36 PM

With Catalina you must boot into Recovery Mode (Command + R) or Internet Recovery Mode (Command + Option + R). Then launch the Terminal app from the Utilities menu.


Run the following command to show the name of your drive's volumes. The default is "Macintosh HD".

mount  |  grep  -i  volumes

This command may show more than just your boot volume, but you should be able to identify the correct item.


Now enter this command and substitute your drive volume if it is different from the default "Macintosh HD" used in my example:

rm  -i  "/Volumes/Macintosh HD/var/db/.AppleSetupDone"


Now you can reboot and have Setup Assistant greet you.

Similar questions

6 replies
Question marked as Top-ranking reply

Dec 8, 2019 9:36 PM in response to vyacheslav77

With Catalina you must boot into Recovery Mode (Command + R) or Internet Recovery Mode (Command + Option + R). Then launch the Terminal app from the Utilities menu.


Run the following command to show the name of your drive's volumes. The default is "Macintosh HD".

mount  |  grep  -i  volumes

This command may show more than just your boot volume, but you should be able to identify the correct item.


Now enter this command and substitute your drive volume if it is different from the default "Macintosh HD" used in my example:

rm  -i  "/Volumes/Macintosh HD/var/db/.AppleSetupDone"


Now you can reboot and have Setup Assistant greet you.

Dec 7, 2019 9:35 AM in response to Akide_Liu

Thank you for your participation!

The whole problem is that I do not have root rights either in the terminal (cmd + R) or in single-user mode.

On my attempt to enter dscl. -read / Users / my username is UniqueID 501, in single-user mode it displays the following:

/System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist: No such file or directory

Operation failed with error: eServerError

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I can not log in after changing the user ID from 501 to 0

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