The Mac OS X Root Account

An odd situation just cropped up; I've been working with an Apple TV unit and wanted to enable the root account. On most Macs that's not a problem; under Leopard you simply open up “Directory Utility” and select the Enable Root User item from the Edit menu. But I didn't have Directory Utility or even a graphical interface on the Apple TV; there had to be another way.

Normally, given a locked root account, I'd run the passwd command to unlock the account and set a password. Two problems cropped up — first, the passwd program wasn't installed on the Apple TV. That problem was quickly resolved. Unfortunately, the passwd program wouldn't change the password. Even more confusing, when I looked for the frontrow user in the /etc/passwd file, it wasn't there - even though I was able to log in as frontrow. Obviously the information I needed was in the mysterious NetInfo database.

The nidump passwd . command revealed the missing frontrow user; details were obtained with the niutil -read . /users/frontrow command:

-sh-2.05b# niutil -read . /users/frontrow name: frontrow shell: /bin/bash home: /Users/frontrow gid: 501 authentication_authority: ;basic; passwd: n5CAdSx90bkPs realname: frontrow hint: sharedDir: Public uid: 501 picture: /Library/User Pictures/Sports/Bowling.tif _writers_passwd: frontrow _writers_tim_passwd: frontrow _writers_picture: frontrow _writers_hint: frontrow _writers_realname: frontrow

The root user, on the other hand, had less information:

bash-2.05b# niutil -read . /users/root name: root passwd: * uid: 0 gid: 0 change: 0 expire: 0 realname: System Administrator home: /var/root shell: /bin/sh _writers_passwd: root

It appeared that two of those fields: authentication_authority and passwd, were probably relevant. I used the niutil -createprop . /users/root authentication_authority \;basic\; to create the authentication_authority entry and the niutil -createprop . /users/root passwd n5CAdSx90bkPs command to create an initial password (since changed; that's the default “frontrow” password for the frontrow account). Once that was done, I was able to su to root (after copying over the su command, of course). I changed the password (passwd command), and that was that.

Search

Static links

RSS Feed RSS Feed

About this site

Our host

Dynamic links

None