How to enable the root user in OS X

How to enable the root user

OS X Lion (10.7) and later

1.From the Apple menu choose System Preferences.

2.From the View menu choose Users & Groups.

3.Click the lock and authenticate as an administrator account.

4.Click Login Options.

5.Click the "Edit" or "Join" button at the bottom right.

6.Click the "Open Directory Utility" button.

7.Click the lock in the Directory Utility window.

8.Enter an administrator account name and password, then click OK.

9.Choose Enable Root User from the Edit menu.

10.Enter the root password you wish to use in both the Password and Verify fields, then click OK.

OS X, Apple

Resetting the root password on a Solaris server

I had to use the following step to reset a the root password on a Solaris system the other day. You will need physical access to the system to use these steps.

  1. Press Stop-A on the console or Ctrl-] and send brk from a remote console connection to access the Open Boot PROM (OBP).
    NOTE : If you are using TeraTerm-Pro, you send a break from the menu.
  2. Insert a bootable Solaris CD/DVD and boot into single-user mode with boot cdrom -s
    If a JumpStart boot server is located on the system’s subnet, and the system was properly configured for JumpStart, you may instead boot over the network into single-user mode with boot net -s
  3. Make a mount point within the /tmp file system by typing mkdir /tmp/mnt
  4. Mount the root partition of your boot disk in /tmp/mnt
    e.g. #> mount /dev/dsk/c0t0d0s0 /tmp/mnt

    NOTE : To check the device name use the format command.

  5. Edit /etc/shadow with TERM=vt100 vi /tmp/mnt/etc/shadow
  6. Remove the encrypted part of the root password (the second field; fields are separated by colons), save, and exit.
  7. Unmount the file system with umount /tmp/mnt
  8. Reboot the system and assign a new password at a shell prompt with the passwd command.

If you are unable to run vi above, you can edit /etc/shadow using the ed editor.

# ed /tmp/mnt/etc/shadow
s/:………….:/::/ (Note: there are 13 dots in the second field)