Help Save Code2care! ๐Ÿ˜ข

I've lost 99% of my revenue to AdBlockers & AI. Your support could be the lifeline that keeps this passion project alive!

Buy Code2care a Coffee QR Code

Scan to Buy Me A Coffee and help me continue coding for you!

How to enable root user on Mac Terminal


The root user is disabled on the Mac by default due to security reasons, one may not need the root user access, as an admin has most of the privileges that would suffice any task you want to perform using the Terminal.

"It's safer to use the sudo command in Terminal instead of enabling the root user. To learn about sudo, open the Terminal app and enter man sudo."

Reference: https://support.apple.com/en-in/HT204012

Steps:

  1. Open Terminal App.
  2. Run the Command:
    sudo passwd root
    
  3. You will be prompted to set a password.
  4. Once set, you can access root user using su - command.
    Code2care@Mac % sudo su -
    Password:
    C2C-Tech-Mac:~ root# 

Note: As it is not advisable to make use of the root user for day-to-day tasks, its better to disable the root user after use with the below command.

sudo passwd -l root
Switch to Root user Mac

You can download this article in various formats for your convenience. Choose from the options below:

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has a Masters Degree in Computer Science with over 15+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright Code2care ยฉ 2024 | Privacy Policy | About Us | Contact Us | Search