How can I change the defaults for new accounts in Mac OS X?

Basically, I want change the skeleton of the OS X user account, in order to do the following with every new user that I create on this local machine:

  • A custom set of Dock icons
  • Some data already in their Documents folder
  • Some aliases on the desktop to some remote resources (smb, mainly)
  • Screen saver and lock settings set up.

I don't need any of these to be locked down by policy, I just want to configure a few of them for easier access. There's a possibility of having an OS X directory server at some point, but I can't rely on it being possible/available.


IIRC OS X's equivalent of the linux /etc/skel is

/System/Library/User\ Template/English.lproj

As long as your customizations are stored in the user's home folder, then placing them here should make them be copied along with the rest of the defaults when you create a new user. All you have to do is find the config file that controls what you want to set as the default, then copy the pre-configured version over the default in that directory.

EDIT

Thanks to Gordon Davisson for the addition.

Note that the template folder is owned by root, and any additions you make should be as well. So, if (for example) you wanted to copy your account's Dock preferences into the template, you'd use

sudo cp ~/Library/Preferences/com.apple.dock.plist /System/Library/User\ Template/English.lproj/Library/Preferences

For the dock, you need not only the .plist file as mentioned already, but also the com.apple.dock.db file, so you probably want

sudo cp ~/Library/Preferences/com.apple.dock.* /System/Library/User\ Template/English.lproj/Library/Preferences

You will also want to play with the defaults read and defaults write commands, which allow you to see what exactly is included in a preference file before copying it. If you don't want to copy the entire preferences file, you can selectively write values. If the destination file does not exist, it will be created. For example, this command will create the finder plist file with just this one preference:

defaults write /System/Library/User\ Template/English.lproj/Library/Preferences/com.apple.finder ShowPathBar -bool YES