1314
Comment: converted to 1.6 markup
|
3010
The "autofs5" packages are dummies these day, suggest to use the "autofs" packages
|
Deletions are marked like this. | Additions are marked like this. |
Line 6: | Line 6: |
You need to have {{{["AUTOFS4"}}}] compiled as a module in your kernel config (see {{{/usr/share/doc/autofs/README.Debian}}}):{{{ $ grep AUTOFS /boot/config-`uname -r` }}} Install the {{{autofs}}} and {{{nfs-common}}} packages.{{{ $ apt-get install nfs-common autofs $ vim /etc/auto.master }}} {{{/var/autofs/net}}} is very handy to get rid of {{{host:/path}}} lines in {{{/etc/fstab}}}. Make sure what your NFS server is working, then just do :{{{ $ cd /var/autofs/net/yourserver/yourexport |
The Jessie standard kernel ships with autofs module needed for automounting. Install the {{{autofs,autofs-ldap}}} packages and optionally {{{nfs-common}}}. {{{ $ apt-get install autofs autofs-ldap |
Line 17: | Line 13: |
== Autofs on LDAP == | == Autofs mapping entries on LDAP == |
Line 19: | Line 15: |
Actually, the autofs ldap backend supports three (3) different schema styles to store its automountmaps in an ldap. You can verify this by reading {{{/etc/default/autofs #common ldap mappings}}}. = Adding schema to OpenLDAP using cn=config = The schema file provided by the autofs-ldap package {{{/etc/ldap/schema/autofs.schema}}} needs to be converted to ldif format when using the new cn=config backend for openldap (instead of slapd.conf). Create a file {{{/tmp/schema_convert.conf}}} with the following content {{{ include /etc/ldap/schema/core.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/autofs.schema }}} Create a temporary ldif output directory and run slaptest to generate autofs.ldif {{{ # mkdir /tmp/ldif_output # slaptest -f schema_convert.conf -F /tmp/ldif_output }}} Modify the resulting file in {{/tmp/ldif_output/cn=config/cn=schema/cn={2}autofs.ldif}} {{{ dn: cn=autofs,cn=schema,cn=config .. cn: autofs .. <remove all lines from structuralObjectClass: olcSchemaConfig onwards> }}} The result should look like this: https://launchpadlibrarian.net/55451730/autofs.ldif If you like to, you may copy it over to {{{/etc/ldap/schema/autofs.ldif}}}. Finally add the ldif to your config database: {{{ # ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/autofs.ldif }}} = Store mappings on the ldap = |
|
Line 34: | Line 60: |
To utilise this from the client you should install the autofs-ldap package, then tell auto.master how to lookup the mappings: {{{# auto.master file |
Create a file {{{autofs-data.ldif}}} with the above content and add it to the ldap: {{{ # ldapadd -D cn=admin,dc=example,dc=com -W -f autofs-data.ldif }}} Activate ldap lookup for autofs maps in {{{/etc/nsswitch.conf}}} {{{ automount: files ldap }}} Configure {{{/etc/default/autofs}}} with proper URI,SEARCHBASE and schema mapping definition. You can also use ldap on a directory basis and maintaining other directories via files as usual: {{{ # auto.master file |
Line 38: | Line 74: |
If not using anonymous binds on the ldap you need to edit {{{/etc/autofs_ldap_auth.conf}}}, too. == References == * https://help.ubuntu.com/community/AutofsLDAP * http://sadiquepp.blogspot.com/2009/02/how-to-configure-autofs-maps-in-ldap.html |
Getting automounter maps from LDAP
AutoFS Client Setup
The Jessie standard kernel ships with autofs module needed for automounting. Install the autofs,autofs-ldap packages and optionally nfs-common.
$ apt-get install autofs autofs-ldap
Autofs mapping entries on LDAP
Actually, the autofs ldap backend supports three (3) different schema styles to store its automountmaps in an ldap. You can verify this by reading /etc/default/autofs #common ldap mappings.
Adding schema to OpenLDAP using cn=config
The schema file provided by the autofs-ldap package /etc/ldap/schema/autofs.schema needs to be converted to ldif format when using the new cn=config backend for openldap (instead of slapd.conf). Create a file /tmp/schema_convert.conf with the following content
include /etc/ldap/schema/core.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/autofs.schema
Create a temporary ldif output directory and run slaptest to generate autofs.ldif
# mkdir /tmp/ldif_output # slaptest -f schema_convert.conf -F /tmp/ldif_output
Modify the resulting file in
dn: cn=autofs,cn=schema,cn=config .. cn: autofs .. <remove all lines from structuralObjectClass: olcSchemaConfig onwards>
The result should look like this: https://launchpadlibrarian.net/55451730/autofs.ldif If you like to, you may copy it over to /etc/ldap/schema/autofs.ldif. Finally add the ldif to your config database:
# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/autofs.ldif
Store mappings on the ldap
To store eg. auto.home maps on LDAP you can use the following format (user and home mapping shown):
dn: uid=auser,ou=People,dc=example,dc=com uid: auser uidNumber: 1044 gidNumber: 501 gecos: A. User,,, homeDirectory: /home/auser loginShell: /bin/bash dn: cn=auser,ou=auto.home,dc=example,dc=com objectClass: automount cn: auser automountInformation: -rw,soft,intr,quota homeserver:/export/home/&
Create a file autofs-data.ldif with the above content and add it to the ldap:
# ldapadd -D cn=admin,dc=example,dc=com -W -f autofs-data.ldif
Activate ldap lookup for autofs maps in /etc/nsswitch.conf
automount: files ldap
Configure /etc/default/autofs with proper URI,SEARCHBASE and schema mapping definition. You can also use ldap on a directory basis and maintaining other directories via files as usual:
# auto.master file /home ldap:ou=auto.home,dc=example,dc=com
If not using anonymous binds on the ldap you need to edit /etc/autofs_ldap_auth.conf, too.
References
See Also: