Will this get rid of all the data on my macbook pro (high sierra)?
-
30-05-2021 - |
質問
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."
解決
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.
他のヒント
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.