Enabling The Root User on Linux and Mac OS X

Mac OS X and certain distributions of Linux do not have the root user enabled by default. You can use the “sudo” command to assume root privileges when you need it, but this inconvenient at best. So, enable the root user:

Mac OS X

Open the “Directory Utility” from inside “Utilities”, which is in your “Applications” folder. Click the lock icon in the bottom-left of the window and enter your admin password when prompted.

Enabling the Root Account in Mac OS X's Directory Utility

Enabling the Root Account in Mac OS X's Directory Utility

From the “Edit” menu, select “Enable Root User”. Enter a password for the root account to use, and then click OK. If you need to disable it, repeat the process, selected “Disable Root User” from the “Edit” menu.

Linux

In order to enable the root account in Linux, issue the following command in a terminal window:

sudo passwd root

This will essentially use super-user privileges from sudo to set a new password for the root account. In order to disable the root account again, issue the command:

sudo password -l root

Becoming Root

Now you’ve enabled your root account, whenever you’re in a terminal window, you will be able to issue the command:

su root

This will start a new shell with you logged in as root.

This entry was posted in Server Admin and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>