Customize The User Template on your Mac Leopard and Snow Leopard systems

2011/09/03 | By | Reply More

If you’re like me then you probably strive to provide a consistent user  experience across multiple systems. This helps in facilitating training and minimizing troubleshooting time. I do this on macs by modifying the default account so each new user account created on a system has a standardized environment which is designed for my organizations needs.

At the heart of this practice is a default set of user data, carefully designed around the needs of the group and applied to each account when it’s first created. For Windows that data is typically stored in C:Documents and SettingsDefault User, while Unix systems have traditionally used /etc/skel. Mac OS X keeps its user template deep within the /System hierarchy, but while finding it can be difficult, customizing it to your needs is quite easy.

Start with a new account created specifically for this purpose. Choose the system preferences, dock items, browser bookmarks, server shortcuts, and application settings appropriate to your user base, leaving out anything you can instead control via Open Directory’s managed preferences. If you install individual applications or fonts on a per-user level, include those in ~/Applications and ~/Library/Fonts (where the tilde represents the user’s home directory).

Once you’ve finished, open Keychain Access from the /Applications/Utilities folder and delete the “login” keychain (both references and files when prompted)  so new users will get their own keychain file created for them. You’ll also want to delete the cache files stored in ~/Library/Caches, clear out the “Recent Items” from the Apple menu, and (if you’ve used the Terminal) discard the ~/.bash_history file.

Now log out of the template, and log in to an Admin account. From here, you’ll be clearing Apple’s existing user template and copying your new template user in its place. In Leopard, that work can’t be done using the sudo command, and instead must be performed as the root user, meaning you run the risk of doing serious damage if you don’t understand what you’re typing. If you’re at
peace with that, just open the Terminal, and very carefully type:
su –

After prompting you for a password, this will let you assume the role of root, the Unix “superuser”. This allows you to modify and delete any file on the machine.
rm -r /System/Library/User Template/English.lproj/*
This removes everything inside the English-speaking template folder. If you’re utilizing another language, you’ll need to change this to the appropriate template.
cp -R /Users/TEMPLATE/* /System/Library/User Template/English.lproj/
In the command above, replace TEMPLATE with the  actual name of the template account you’ve created. This copies your prepared user environment into the template location. After which you can:
exit

Now, when you add a new user account, it’ll be created with your customizations already in place. You can then delete the original account from the install you built it on, but be sure to back up the home directory. The process can be repeated on multiple machines, deployed on your server, or incorporated into a system image, all using the same template.

Tags:

Category: Uncategorized

Leave a Reply

%d bloggers like this: