Lost Admin Access

It seems I have lost administrator access to my macbook pro. This happened after I tried to change my username in System Preferences > User Names & Groups. I pressed the unlock icon, entered my password, then changed my username. However the username did not change after doing this. It stayed the same and I have lost the administrator access... I tried following suggestions in the community to press command + S but it's not working and my Filevault is turned off

MacBook Pro 15″, macOS 10.13

Posted on Nov 4, 2023 4:52 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 4, 2023 5:29 PM

Here is an Apple article with the instructions for correctly changing the user account name:

Change the name of your macOS user account and home folder - Apple Support


If you do not have another admin macOS user account, then you can try using the information in this article to trick macOS into running Setup Assistant so you can create a new admin user account:

Restarting Setup Assistant to create Admin user - Apple Community


It is very important to know the version of macOS you are using since the procedure to trick macOS into running Setup Assistant can vary depending on the OS. In fact I believe the instructions are for macOS 10.15 - 13.x, but can be modified for older versions of macOS since the only difference it the path & mount point used. It is impossible to do this procedure if you are running macOS 14.x Sonoma.


If you are using Sonoma and don't have another macOS admin user account, then you will need to erase the Mac, reinstall macOS & restore from a backup.


It is always best to provide both the exact model of the Mac and version of macOS being used since it can speed up the process a bit.


Similar questions

3 replies
Question marked as Top-ranking reply

Nov 4, 2023 5:29 PM in response to olanrewaju73

Here is an Apple article with the instructions for correctly changing the user account name:

Change the name of your macOS user account and home folder - Apple Support


If you do not have another admin macOS user account, then you can try using the information in this article to trick macOS into running Setup Assistant so you can create a new admin user account:

Restarting Setup Assistant to create Admin user - Apple Community


It is very important to know the version of macOS you are using since the procedure to trick macOS into running Setup Assistant can vary depending on the OS. In fact I believe the instructions are for macOS 10.15 - 13.x, but can be modified for older versions of macOS since the only difference it the path & mount point used. It is impossible to do this procedure if you are running macOS 14.x Sonoma.


If you are using Sonoma and don't have another macOS admin user account, then you will need to erase the Mac, reinstall macOS & restore from a backup.


It is always best to provide both the exact model of the Mac and version of macOS being used since it can speed up the process a bit.


Nov 5, 2023 5:08 PM in response to olanrewaju73

The easiest method is to boot into Single User Mode using Command + S. Once the text stops scrolling by on the screen you should see a command prompt with the "#" symbol. If you don't see this, the press the "Return" key which should then cause it to appear on an empty line so you can type on it. Follow the instructions on the screen to enter two command which should be the following IIRC:

fsck  -fy

mount  -uw  /



Now you will need to delete a file which tells macOS whether or not the system has already been configured. Use the following command:

rm  -i  /var/db/.AppleSetupDone


You will be prompted to confirm it is Ok to delete the specified file. Now type:

reboot


This will restart the Mac which should boot into Setup Assistant as if it has a fresh install of macOS. Go through the setup process to create a new admin user account. Once logged in, you can use the instructions I provided in the last post to correctly modify the original macOS user account name.




It is also possible to modify the instructions in the other previously linked instructions to use Recovery Mode to do the same thing. You will need to follow the instructions in that article for Recovery Mode up until the command you use in the Terminal app. You will need to use a modified version of the command, so use the following command in the Terminal which uses a slightly different path to the file since High Sierra does not have a "Data" volume like macOS 10.15+ (note that I'm using the double quotes option since it makes things simpler):

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




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.

Lost Admin Access

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