1

I tried changing the administrator's short name and the admin user ended up turning into a standard one. Now I can't log in with the administrator username and password if I want to make changes to the laptop. Someone suggested the below solution a while ago. I just have one question before trying it though. Is Will doing this erase all the data on my laptop? I have no way of knowing when the last backup was (if there even was any).

The solution:

"If it's not already, make sure your Macbook pro has an up-to-date backup.

Then follow these steps:

Shut down your Macbook pro Power up your Macbook Pro and immediately press and hold the Command + S keys Keep the keys down until you see the text on the screen Now enter the following command:

/sbin/fsck -fy

and press enter

Next enter the following command:

/sbin/mount -uw /

and press enter

Now enter the following command:

rm /var/db/.AppleSetupDone

and press enter

Finally, enter the reboot command

and press enter

Your Macbook pro should reboot and you can log in normally, after which point the Setup Assistant will launch. Now you need to create a new admin user. Don't worry, your other user accounts should be intact. NOTE: You should choose a new user name for this admin account.

Once you're back up and running you can go to Apple > System Preferences > Users & Groups and select the Allow user to administer this computer checkbox for the 'grant' user."

2
  • If you can log as any user, then you can use sudo for admin tasks, like changing user to admin. Nov 20, 2020 at 0:00
  • Moving forward, if you want to change the admin account, the first step is to use it to make a second admin account, in the OS, as opposed to making the second one after the fact using the Setup Assistant. Both ways get you to the same place, it just depends on how comfortable you are plonking around in single user mode. Good luck.
    – chiggsy
    Dec 2, 2020 at 4:06

2 Answers 2

1

No, you are simply removing one file that bookmarks a setup process has been done. Any data loss will be a result of something else (coincidence or running other commands) if you happen to lose data.

Good luck getting a new account created.

0
1

You can also set a password for the root user in single user mode:

fsck -fy /     *(optional: if you unmount cleanly you don't have to do this)
mount -uw /
launchctl load /system/library/launchdaemons/com.apple.opendirectoryd.plist
passwd root    *enter a password here. Nothing will show on the screen as you type. Press enter and enter the password again.
exit           *Proceed startup process

And then you can login to the root account and do things that require privileges.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .