yes. I found elsewhere that the commands should be
cd /Volumes/Macintosh\ HD/var/db/
and
rm .ApplesSetupDone
I did these commands in Terminal and restarted
but it never boots into a setup screen.
Just boots into the same & only account on this iMac, that is still a standard account.
Just to be clear, the Recovery Assistant off the USB OCLP v1.0.1 is the same
as the Recovery Assistant, as if no USB key was plugged in, correct?
cd /var/db/
and
rm .AppleSetupDone. <---- Not .ApplesSetupDone!!
Another method, but the one above should work.
You had a typo in the rm command!!
I found this on the net, never had to use it, so you're on your own. But it looks good. Worth a try I think.
Fix missing admin account
It turns out the the answer lies in 2 commands.
launchctl, and
passwd. Launchctl loads, and unloads daemons/agents and generally controls launchd. In our case we need the launchctl command to load and startup
Open Directory in Single User Mode. With Open Directory functional we can enable the Root account and provide a password using the passwd command. At this point we can logout of Single User Mode, login to macOS as Root, fix the user account that was damaged, log out of Root, login using the repaired admin user account, and finally disable the Root account.
HERE’S HOW IT’S DONE
- Shut Down the computer. I don’t know why, but I never seem to be able to get this to work by just restarting. The next command only seems to work if the computer is shut down.
- Hold down the Command + s while you turn on the machine. Also I recommend a WIRED keyboard for this. I have found that wireless keyboards can be hit and miss with this since some of them need driver software to work and since we are trying to boot into Single User Mode the drivers haven’t been loaded. Hold the CMD+S keys down until the screen goes black & a bunch of white type starts scrolling up the screen. You can let go at this point and eventually you will get to a screen that looks like this.
- Type /sbin/fsck -fy at the prompt. This is an optional step that checks the directory structure of the disk. While it is optional there is really no reason to skip it. Your screen should look like this.
- Type /sbin/mount -uw / at the prompt. This step mounts your hard drives. Be sure to type a space between the mount and the -uw. Also there is a space between the -uw and the /. Also -UW is not the same as -uw. Your screen should look like this.
- Type launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist at the prompt.This command gets Open Directory loaded up. Please note: your web browser may show this line as if there’s a carriage return after the word type. Your web browser is just formatting my text. Everything from the L in launch all the way to the T in plist should be on one line with a space between the words launchctl and load, and another space between load and /. Your screen should look like this.
- Type passwd root at the prompt. This command actually enables the Root account and changes the password. you will be prompted for a new password twice. for this demo I used 1234 since I knew I would be disabling Root as soon as I was done. Your screen should look like this.
- Type exit at the prompt. This command logs you out of Single User Mode and boots the machine normally. Your machine will look like this when you type exit, and like this when it has rebooted into multiuser mode.
- Click on Other and log in as Root. Your screen should look like this.
At this point you can turn off parental controls, add new users, or do whatever other fixes you need to do.
HERE IS HOW TO UNDO IT
Obviously it is
VERY dangerous to leave a Root User account functional on you Mac. So with that in mind here is how you can disable the Root account.
- Open System Preferences. You can get your system preferences by clicking on the system preferences program in the applications menu, or by pulling down on the Apple menu (or if you like me, by clicking in your dock). Your screen should look like this.
- Click on Users & Groups. When the system preferences loads up, you need to click on users and groups which is in the first column and usually the fourth or fifth one down from the top. The system preferences looks like this.
- Authenticate (If You Need To): There is a pretty good chance you’re going to need authenticate. In order to do so you will need to click the padlock in the lower left-hand corner and provide a user ID that has administration privileges and a password. Your screen should look something like this.
- Click on Login Options: Now that you’re authenticated you need to click on the login options. You’ll find login options about 1 inch above the padlock you just clicked. The logging options look like this.
- Click on Join: After you click on login options you’ll notice that the right side of the window has changed. At the bottom there is a small button that says join. When you click the join button a new panel will slide down from the top of the window. Your screen should look something like this.
- Click on Open Directory Utility: Inside the new panel that dropped down from the top of the network system preferences, you’ll see a large button that says Open Directory utility. When you click the Open Directory utility button a new program called Open Directory utility launches. Your screen should look something like this.
- Authenticate Again: You’ll notice that at the bottom of this new window there is another padlock. Click on it again, and enter in an administration user ID and password. Your screen should look something like this.
- Go to the Edit menu & click on Disable Root User: Finally we can disable the root user. We do this by going over to the edit menu and pulling down to the menu option that says disabled root user. Here’s a close-up of the pertinent menu.
WRAPPING IT UP
With the root user once again safely disabled, your Mac should be back to its normal. I believe that this exact same procedure should work all the way back to OS X 10.7. Prior to that, I’m not positive that the launchctl command is needed.