using dscl and automount to change OS X users home directory

I have 2 iMacs at home and wanted to cross mount /Users home directories to each other so my family can log into either and have their environment.

Using dscl and automount it's easy.

Good pointers for automount/autofs and dscl (not really good but better than nothing) help.

On the machine that you want to automount directories on, execute:

dscl -change Local/Default/Users/kate NFSHomeDirectory /Users/kate /home/kate

dscl will change the home directory of kate from the normal /Users/kate to /home/kate. This step readies for the use of the automounter.

Edit /etc/auto_home to look like:

#
# Automounter map for /home
#
+auto_home # Use directory service
kate dining-room.local:/Users/kate

This snippit will automagically mount the home directory on the dining-room machine onto the local /home/kate directory (it uses bonjour for host resolution and nfs for mounting).

After a bit of time ... poof the directory will be there when kate logs in locally (already created a local account for kate).

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options