By default root user is disabled on Mac, you need to follow below steps in order to enable/disable or change password for root user on Mac.
1. From top left hand side, choose Apple menu > System Preferences, then click Users & Groups (or Accounts).
2. Click the lock icon , then enter an administrator name and password.
3. After you unlock the lock. Click Login Options, right next to home icon.
4. Now Click Join (or Edit), right next to Network Account Server. Now Click Open Directory Utility.
5. Click lock icon in the Directory Utility window, then enter an administrator name and password.
6. From the menu bar in Directory Utility: Choose Edit > Enable Root User, then enter the password that you want to use for the root user. You can enable/disable/change password for root user from here.
7. Now go to Terminal and switch user to root and test.
Rajas-MacBook-Pro: Rajput$ su root
Thank you!! If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Google or Facebook. Refer the links below.
Also click on "Subscribe" button on top right corner to stay updated with latest posts. Your opinion matters a lot please comment if you have any suggestion for me.