Open Directory and MAC Addresses

There are a number of items that get logged into Mac OS X Server with only the unique identifier of the MAC address. Sometimes it helps to find the name based on the MAC address. If you are in an environment using trusted binding you can use Open Directory to do so. To determine the name of a computer based on the MAC address from Open Directory, you can run the following from dscl:
dscl /LDAPv3/ -readall /Computers RecordName macAddress | grep -A 1 $MAC

Allow ARD Access into an ARD Server

When a computer has ARD open, by default you cannot log into it using Remote Desktop from another host.  To fix this, use the following command:
defaults write /Library/Preferences/ AdminConsoleAllowsRemoteControl -bool false
And then run the kickstart -restart -agent command from /System/Library/CoreServices/ARD
/System/Library/CoreServices/ARD’ -restart -agent

Positional Parameters and Packaging

When packaging it is worth note that Apple reserves some positional paremeters for your scripts. These are defined at They include:
  • $1: Path to the package
  • $2: Path to the destination.
  • $3: Installation volume.
  • $4: Root directory

Headless Xserve Setup

New Xserves are shipped with video cards. Much to the chagrin of many administrators and the humor of many older UNIX administrators, the Xserves were not being shipped with a graphics card for a couple of years and now many don’t come with dongles. In many cases you will come across one of these server that need to be set up. During this time this was an upgrade that many administrators did not know they would need to purchase if they did not wish to perform a headless installation. Luckily, Apple has provided us with numerous ways around this issue. One of the best features of Mac OS X Server is that the when you boot to a CD or DVD SSH and a client for the Mac OS X Server Setup Assistant are automatically running on the system. You can use Setup Assistant to complete the installation that was started at the factory. Likewise, Mac OS X will run in a similar fashion, allowing administrators access through SSH when booted to a CD. Most Xserves are setup with static IP addresses. However, computers crash. For this reason it is a good idea to setup a DHCP reservation for the MAC address of your Xserve. When you use a DHCP reservation you will tell the DHCP server that if a host with your Mac address requests an IP address it will always be given the same IP. This is similar to assigning a manual IP address to servers. How do you find the system on the network. Bonjour browser can be useful for this. The Setup Assistant will search the network for systems that are waiting for this portion of the installation to be complete. The password to log into an Xserve when it is booted to the CD is the first eight digits of the server’s serial number. If you are installing on an older Xserve, the serial number may be “12345678.”. /System/Library/ServerSetup/sa_srchr IP_Address You can also boot to a Fibre Channel port. Once the server has been installed, you should be able to tap in using Apple Remote Desktop and SSH provided you did not disable this at installation. For headless systems you will typically use ARD, SSH or Timbuktu for the bulk of your administration. Luckily, Metadata Controllers do not require much work. However, for Xsan administration you may find that you use Xsan Admin more often than you use the desktop or SSH for configuration.

Reset the Admin or Root Password in Mac OS X

Forgot the admin password in Mac OS X? Well, Apple let’s you boot computers into what is known as Single User Mode. To boot a Mac into Single User Mode, boot the machine holding down Command-S. Once the system boots up, you should see a command prompt. Here, run fsck: fsck -fy Then mount the file system: mount -uw / Then reset the password using the passed command passwd <username> For example, if the user is root: passwd root When prompted, provide the desired administrative password.