Note | ||
---|---|---|
| ||
This site is in the process of being reviewed and updated. |
Introduction
Automount allows users to automatically mount shares as needed. Shares may be home directories or public storage. With NFSv4 we can use Kerberos to provide single sign-on access to user shares. In the following examples, we host our home directories on ldap1.example.com and share /home. The file server and Apache Directory do not need to run on the same machine.
Here is the line from /etc/exports that works to export home directories:
Code Block |
---|
/home *.example.com(rw) |
Linux LDAP clients mount the user's home directory at login, using automount and NFSv4. We need to configure the automount maps in ou's for auto.master, auto.home, and auto.misc. We start with a new organizational unit for auto.master:
Code Block |
---|
dn: ou=auto.master,dc=example,dc=com objectClass: top objectClass: automountMap ou: auto.master |
An auto.master entry is identified by 'common name' (cn). The automountInformation attribute instructs automount to look for a map elsewhere in the directory:
Code Block |
---|
dn: cn=/h,ou=auto.master,dc=example,dc=com objectClass: automount automountInformation: ldap:ou=auto.home,dc=example,dc=com cn: /h |
We can also create an auto.master entry for other NFSv4 shared directories:
Code Block |
---|
dn: cn=/share,ou=auto.master,dc=example,dc=com objectClass: automount automountInformation: ldap:ou=auto.misc,dc=example,dc=com cn: /share |
We create the automount entries in LDIF format, save them as auto.master.ldif, and add the entries via an LDAP add operation:
Code Block |
---|
ldapadd -x -D 'uid=admin,ou=system' -W -f auto.master.ldif |
Next, we create a new organizational unit for auto.home:
Code Block |
---|
dn:ou=auto.home,dc=example,dc=com objectClass: top objectClass: automountMap ou: auto.home |
A home directory entry is also identified by cn.
Code Block |
---|
dn: cn=hnelson,ou=auto.home,dc=example,dc=com objectClass: automount automountInformation: ldap1.example.com:/home/hnelson cn: hnelson |
Create auto.home entries for each user in ldif format, save as auto.home.ldif and add the entries to LDAP:
Code Block |
---|
ldapadd -x -D 'uid=admin,ou=system' -W -f auto.home.ldif |
When automounted from a Linux LDAP client, your home directory, ldap1.example.com:/home/hnelson, is mounted on /h/hnelson. Other NFSv4 shares may be entered in LDAP and automounted as needed. The auto.misc organizational unit holds these automount maps, which have the form ou=auto.misc.
We've already created an auto.master entry for /share, as shown above. Now, we create the ou=auto.misc entry:
Code Block |
---|
dn:ou=auto.misc,dc=example,dc=com ou: auto.misc objectClass: top objectClass: automountMap |
Create entries for the NFSv4 shares under ou=auto.misc:
Code Block |
---|
dn:cn=users,ou=auto.misc,dc=example,dc=com objectClass: automount automountInformation: nfs1.example.com:/pub/users cn: users dn:cn=public,ou=auto.misc,dc=example,dc=com objectClass: automount automountInformation: nfs1.example.com:/data/public cn: public |
Save the entries as auto.misc.ldif and add the entries to LDAP:
Code Block |
---|
ldapadd -x -D 'uid=admin,ou=system' -W -f auto.misc.ldif |
When automounted from a Linux LDAP client, your shared directory nfs1.example.com:/data/public is mounted on /share/public.
To test, log in to a Linux LDAP client using an LDAP user name. You should see the appropriate login shell and home directory for the user. To test auto.misc shares, you must access the share by name, for example:
Code Block |
---|
cd /share/public |