Create a new Mac Administrator account using Single User Mode

Andy

Administrator
Creative Team
User ID
1
Joined
7 Jan 2019
Messages
1,121
Reaction score
57
Points
48
If you ever need to recreate admin account on your Mac, this is the quickest and safest way to do it without breaking your Mac:
  1. Boot into Single User Mode by pressing ⌘ + S before you hear the Apple chime.
  2. Mount the drive by typing /sbin/mount –uw / then enter.
  3. Remove the Apple Setup Done file by typing rm -v /var/db/.AppleSetupDone then enter.
  4. Reboot by typing reboot then enter.
  5. Complete the setup process, creating a new admin account.
This will force macOS to redo the initial first account creation, and doing so will not affect the current user profiles (they will remain intact) – so, if you prefer to make them as admin later, you can do that as well by logging in using the newly created admin account, then go to System Preferences, then Users & Groups, select the existing user, and tick “Allow user to administer this computer.

I tested on macOS 10.14 Mojave and it worked:

ark:db andy$ pwd
/var/db
ark:db andy$ ls -al .AppleSetupDone
-r-------- 1 root wheel 0 Apr 4 2017 .AppleSetupDone
ark:db andy$ uname -a
Darwin ark.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
ark:db andy$

If you have any questions or comments, please feel free to post down below. Cheers!
 
This does not work for me.

Every time I do this, I complete the account creation and after I fill out the page where it asks for my full name, the account name, password, and password hint, it tells me it can not create an account with the name I gave it. Then it just freezes and I have to hard reboot the mac. Also this has happened on 3 different computers, 3 different models.

What should I do?
 
This does not work for me.

Every time I do this, I complete the account creation and after I fill out the page where it asks for my full name, the account name, password, and password hint, it tells me it can not create an account with the name I gave it. Then it just freezes and I have to hard reboot the mac. Also this has happened on 3 different computers, 3 different models.

What should I do?
Hi Alex,

Did you try to create using the name that previously known by the system? If so, please try creating a different name (totally unique).

Cheers
Andy
 
Hello, I tried this on a MacBook air: macOS Big Sur and it didn't work.

Help?
 
Are you using the new M1 MacBook Air?
Does it look like this?


When I boot the Mac into Single User Mode it says the root drive is mounted in read-only mode, and when I try to mount it in read-and-write mode
it says permission denied.

Also something interesting in image 3. They moved the file
 

Attachments

  • image.jpg
    image.jpg
    1.4 MB · Views: 438
  • image.jpg
    image.jpg
    1.3 MB · Views: 433
  • ezgif.com-gif-maker.gif
    ezgif.com-gif-maker.gif
    349.3 KB · Views: 776
Last edited:
Does it look like this?

When I boot the Mac into Single User Mode it says the root drive is mounted in read-only mode, and when I try to mount it in read-and-write mode
it says permission denied.

Also something interesting in image 3. They moved the file
No, that MacBook doesn't appear to be an M1, from what you say, it sounds like you already made it into the single-user mode, just make sure that you type this command to mount the root drive in read-write:
Code:
/sbin/mount –uw /
 
No, that MacBook doesn't appear to be an M1, from what you say, it sounds like you already made it into the single-user mode, just make sure that you type this command to mount the root drive in read-write:
Code:
/sbin/mount –uw /
I have been doing that command but it says permission denied. It only says the drive has been mounted to read only, not read and write.


do I have to unmount and then remount it?
 
Try changing your Secure Boot option to "Medium Security" or "No Security" if you are on a computer with a T2 chip.

And if it's still doesn't work, try the directions below:
Bash:
csrutil authenticated-root disable
sudo mount -uw /Volumes/Macintosh\ HD\ 1
sudo /System/Library/Filesystem/apfs.fs/Contents/Resources/apfs_systemsnapshot -s "SnapshotName" -v /Volumes/Macintosh\ HD\ 1
sudo /System/Library/Filesystem/apfs.fs/Contents/Resources/apfs_systemsnapshot -r "SnapshotName" -v /Volumes/Macintosh\ HD\ 1

If you're curious:
Code:
✘ andy@mm  /System/Library/Filesystems/apfs.fs/Contents/Resources  ./apfs_systemsnapshot
apfs_systemsnapshot: This utility is used to tag snapshots for boot and to declare new ones.
NOTE: ARV must be disabled before this tool can be used.
apfs_systemsnapshot usage: apfs_systemsnapshot [-r snapname] [-s snapname] -v <mount point>
-r: Tag specified snapshot as the one to root from on the next boot
-s: Create snapshot with the specified name
-v: Mount point on which to operate
✘ andy@mm  /System/Library/Filesystems/apfs.fs/Contents/Resources 
 
Try changing your Secure Boot option to "Medium Security" or "No Security" if you are on a computer with a T2 chip.

And if it's still doesn't work, try the directions below:
Bash:
csrutil authenticated-root disable
sudo mount -uw /Volumes/Macintosh\ HD\ 1
sudo /System/Library/Filesystem/apfs.fs/Contents/Resources/apfs_systemsnapshot -s "SnapshotName" -v /Volumes/Macintosh\ HD\ 1
sudo /System/Library/Filesystem/apfs.fs/Contents/Resources/apfs_systemsnapshot -r "SnapshotName" -v /Volumes/Macintosh\ HD\ 1

If you're curious:
Code:
✘ andy@mm  /System/Library/Filesystems/apfs.fs/Contents/Resources  ./apfs_systemsnapshot
apfs_systemsnapshot: This utility is used to tag snapshots for boot and to declare new ones.
NOTE: ARV must be disabled before this tool can be used.
apfs_systemsnapshot usage: apfs_systemsnapshot [-r snapname] [-s snapname] -v <mount point>
-r: Tag specified snapshot as the one to root from on the next boot
-s: Create snapshot with the specified name
-v: Mount point on which to operate
✘ andy@mm  /System/Library/Filesystems/apfs.fs/Contents/Resources 

ok I will try
 
Hello, Andy, are you still here? It doesn't work for me. I forgot the password, i tried all the solutions i can, Single User mode, Recovery Mode, all doesn't work for me. When running command "mount -uw /", it gets error messages
apfs_vfsop_mount:1171: Updating mount from /dev/disk1s5 to read/write mode is not allowed
mount_apfs: volume could not be mounted: Operation not permitted
mount: / failed with 77

any ideas about this?
 
Hello, Andy, are you still here? It doesn't work for me. I forgot the password, i tried all the solutions i can, Single User mode, Recovery Mode, all doesn't work for me. When running command "mount -uw /", it gets error messages
apfs_vfsop_mount:1171: Updating mount from /dev/disk1s5 to read/write mode is not allowed
mount_apfs: volume could not be mounted: Operation not permitted
mount: / failed with 77

any ideas about this?
Hi @Jacob,

It seems like the issue you're facing could be related to the T2 Security Chip in your Mac. Here are some steps you can try:
  • Secure Boot Settings: Boot into Recovery Mode (by holding Command + R on startup), go to 'Utilities' > 'Startup Security Utility'. Try setting Secure Boot to 'No Security' and allow booting from external media.
  • Disabling System Integrity Protection: In Recovery Mode, open Terminal and type csrutil disable to disable System Integrity Protection. This step is crucial for modifying system files in Single User Mode.
  • Mounting the Drive: After making these changes, restart your Mac in Single User Mode and try the mount -uw / command again.
Remember to re-enable System Integrity Protection and reset Secure Boot settings to their original state once you're done.

Let me know if this helps or if you encounter any further issues.

Cheers,
@Andy
 
 Short URL:
Back
Top