On certain occasions, it may be necessary to configure settings on a Mac which has not yet gone through Apple’s Setup Assistant. This process usually involves enabling the root account and setting a password for it, since no user accounts with admin rights exist yet. For more details on how to do this on macOS Catalina, please see below the jump.
To enable the root account and set a password for it, use the procedure described below:
1. Start up the Mac into single-user mode.
2. Mount the boot drive’s writable volume using the following command:
/sbin/mount -uw /System/Volumes/Data
3. Launch the opendirectoryd process using the following command:
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
4. Enable the root account using the following command:
passwd root
5. Set a password for the root account when prompted.
6. Reboot the Mac using the following command:
reboot
Once rebooted and back at Setup Assistant, you can open the Terminal by pressing the following keys on the keyboard:
CTL + OPTION + CMD + T
Once Terminal opens, run the following command to switch to using the root user account:
su root
When prompted, enter the password you had earlier set for the root account.
Once your need for using the root account has ended, I strongly recommend disabling the root user account. Apple has a KBase article which describes how to disable the root account, available via the link below: