Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I enable root user? 10.5

FAQ http://support.apple.com/kb/HT1528
is oblique, and I think, incomplete.
I enter enable and create password according to instructions, but no mention is made what happens after to allow me root access. I notice that a new user is created, but login requires both a name and a password.
I need to access hosts file in terminal and no matter how I try to login, I am not allowed access.

G5 2.7, G4 867 Mirror door, iMac G5 20" 1.25GB, G3 iBook, MacBook 2.4, Mac OS X (10.5.2), A couple iPhones - more than a few deleted posts during iPhone debacle :-)

Posted on Feb 17, 2009 4:20 PM

Reply
32 replies

Feb 17, 2009 4:33 PM in response to Kurt Triffet

Hi Kurt,

I found this in the Apple Help viewer... might help.

Enabling the root user
The root user, or superuser, is a special user account in Mac OS X that has read and write privileges throughout the file system. By default the root account is not active.

IMPORTANT: The root user can edit and delete important system files not available to normal users. To prevent damaging the system by moving or deleting important files, use extreme caution while working in the root account.

To enable the root user:
Open Directory Utility, located in the Utilities folder in the Applications folder.
Open Directory Utility
Click the lock to make changes. You will need to enter an administrator name and password.
Choose Edit > Enable Root User.
Enter a secure password for the root user, then enter it again in the Verify field, and click OK.
Creating secure passwords
The root user should be used only for specific administration or monitoring tasks. After completing a task as the root user, log out of Mac OS X and log back in using a normal user account.

To ensure the security and stability of your system, disable the root user when you are not using it.



Carolyn 🙂

Feb 17, 2009 4:34 PM in response to Kurt Triffet

the article you mention provides full details how to log in as root. Quoting from the article:

How to log in as root

Use these steps for Mac OS X 10.2 or later:

1. If you are logged in, choose Log Out from the Apple menu.
2. If you are logging in from a list of usernames with pictures, click Other.
3. In the Name field, type: root
4. In the Password field, type the password you defined in the steps above.


However, if all you need is to the hosts file you can do it from terminal using sudo. you don't need to activate the root user to do it.

For example, to edit it using vi you enter

sudo vi /etc/hosts

Of course, you can use a different command line editor like pico.

Or if you prefer GUI you can download Text Wrangler and edit the file using that. it allows saving as a root.

Feb 17, 2009 4:45 PM in response to V.K.

We must be looking at different articles, don't see all that under 10.5 oat all. Scrolled all the way around.

This was what I found:

<<How to enable the root user
Mac OS X 10.5 or later

From the Finder's Go menu, choose Utilities.
Open Directory Utility.
Click the lock in the Directory Utility window.
Enter an administrator account name and password, then click OK.
Choose Enable Root User from the Edit menu.
Enter the root password you wish to use in both the Password and Verify fields, then click OK.
Note: If you are troubleshooting an issue that prevents you from logging in as an administrator, follow the steps in this article to enable the root user.>>


The sudo command works fine, the other still doesn't even though I enabled it.

Feb 17, 2009 4:56 PM in response to Kurt Triffet

that quote was directly from the link in your post. you just had to scroll down a bit.

It sounds like you are not familiar with vi so maybe you should use a GUI editor like textwarangler. download and install it. start text wrangler. then open /etc folder (use go menu) and drag the hosts file onto text wrangler in the dock.

Oh, to quit vi enter :q in terminal

Feb 17, 2009 5:14 PM in response to Kurt Triffet

Kurt Triffet wrote:
Must have been waaaay down 🙂

So I cannot edit directly in Terminal? ]

you can but you need some familiarity with command line editors. if you are not familiar with any it's easier to use a GUI editor. textWrangler is the only one I know that allows saving files owned by root.
Use bbedit for most code-related, but will try textwrangler.

Feb 17, 2009 5:22 PM in response to V.K.

Sorry all, this is really confusing. Simply trying to enter 3 new IPs into hosts file.
Have a critcal web page on Dev site I need to get to and have this roadblock in front of me.
To recap:
-Can use terminal and enter hosts file via sudo iv, but cannot add or edit anything in Terminal.
-Installed textwrangler, but instructions not clear how to find the directory and edit it, then replace.

Feb 17, 2009 5:36 PM in response to Kurt Triffet

Kurt Triffet wrote:
Sorry all, this is really confusing. Simply trying to enter 3 new IPs into hosts file.
Have a critcal web page on Dev site I need to get to and have this roadblock in front of me.
To recap:
-Can use terminal and enter hosts file via sudo iv, but cannot add or edit anything in Terminal.

yes, you can but you need to know how to use a command line editor.
-Installed textwrangler, but instructions not clear how to find the directory and edit it, then replace.


start text wrangler. enter command shiftg in finder. in the resulting popup enter /etc
This will open the /etc folder
locate the file hosts in that folder and drag it to the Text wrangler icon in the dock.
edit the file and save.

Feb 17, 2009 7:13 PM in response to Kurt Triffet

There is a far, far, far, far easier way to edit the hosts file than the way you have been going about it that does not involve setting up a root login account.

Log in to any user account. Under Finder's Go menu, select Go to Folder... . Then enter /etc in the field. You will see the hosts file in the Finder window. Drag it to the Desktop to make a copy of it. Edit the copy with TextEdit or your favourite text editor. Save it back to the Desktop. Then drag it back to the /etc folder. You will be asked to confirm if you want to overwrite the original file, and you will be prompted to authenticate with admin username and password. Then use Disk Utility to repair permissions.

Done.

How do I enable root user? 10.5

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.