This article is one part in a multi-part series about how to have centralized logins and home directories with Mac OS 10.6 using an Ubuntu 9.10 server, LDAP & Automounter. You can find the parent article here.
Important Note: Unless stated otherwise, all the commands in this procedure should be run as root. To become root from a typical admin user, just type sudo su and enter your password. You can also just stay the regular user and put the word sudo in front of every command. I’m using to a root prompt and that drives me crazy, so I just su to root.
It turns out that along with slapd.d instead of slapd.conf and ldif files instead of schema files, the latest version of slapd also has a completely different schema structure for automount information. If you try to use the old syntax (dn: ou=auto.master,ou=Automount,dc=edu,dc=example,dc=org) ldapadd complains that this syntax is no longer supported and to use the new automountKey syntax. Alright… Where is THAT documented? I scoured the web and found nothing, not even on the LDAP documentation site. I got so desparate I started reading the RFC — and it didn’t help! Then I stumbled up this web page. It seemed to know what it was talking about, but I was still confused. I sent out a tweet that I was still confused with LDAP. Can you believe that Rajeev Karamchedu (the author of the aforementioned web page) started following me on Twitter only a few hours earlier! (He had seen me speak before, saw me on one of the people he follows on Twitter and just started to follow me. An hour or so later I’m tweeting about LDAP problems. He reached out. Not only did he help me debug my problem, he actually did a video skype session with me during which he turned his laptop around and did a whiteboard lecture on why what he did worked! SERIOUS KUDOS TO RAJEEV KARAMCHEDU FOR THE FINAL PIECE TO THIS PUZZLE!
You need to create the LDAP equivalents to /etc/auto_master and /etc/auto_home.
1. First, make sure the Mac client is configured to look in LDAP for its automount information. Make sure that the only uncommented line in the /etc/auto_master file on the Mac is the following:
This tells it to look in LDAP for any automounter information it needs.
2. Decide what directory will be mounted under /home
For example, in my configuration, nfsserver:/biglun/smbhome/curtis will be mounted whenever anyone asks for /home/curtis on a Mac client.
3. Create the file /tmp/auto.ldif and put the following into it, substituting the appropriate values in the last line:
You can test automounter without using an LDAP login. First, after you’ve made this configuration, you need to reboot the Mac. (You can also just type automount -vc, but I saw that not work for me once or twice, so I just say reboot.) Login and cd to /home/valid-directory. It should mount that directory automatically for you. If that doesn’t work, then something is wrong.
Now that you have the automounter information in LDAP, the final step is to create a test user so you can test the setup.
----- Signature and Disclaimer -----
Written by W. Curtis Preston (@wcpreston). For those of you unfamiliar with my work, I've specialized in backup & recovery since 1993. I've written the O'Reilly books on backup and have worked with a number of native and commercial tools. I am now Chief Technical Architect at Druva, the leading provider of cloud-based data protection and data management tools for endpoints, infrastructure, and cloud applications. These posts reflect my own opinion and are not necessarily the opinion of my employer.