Back to the main page

Auto[mount|fs] with 389 Directory Server

NFS Server

For this writing, the ZFS appliance hosts users' home directories.
# showmount -e zfs-storage | grep /export/home
/export/home              (everyone)

AutoFS standalone configuration

This is example of standalone AutoFS configuration on some server. The main AutoFS file is /etc/auto.master and it refers to another file /etc/auto.zfs-storage (this is Indirect Map which is used when mounting more filesystems with common path name prefix, like /home)
# cat /etc/auto.master
/var/autofs/zfs-storage         /etc/auto.zfs-storage

# cat /etc/auto.zfs-storage | grep home
home        -vers=3,tcp     zfs-storage:/export/home

389-ds Schema

The Autofs schema comes with default 389-ds installation and it's defines in 389-ds:/etc/dirsrv/slapd-389-ds/schema/60autofs.ldif

Configuration of 389-ds

Simulate stand alone autofs configuration by creating OU (automountMap) that has "automount" entry. This can be done via GUI, follow screenshots for creation OU (auto.master) and cn (/home).

[zare@389client ~]$ ldapsearch -LLL -x -h 389-ds -b "dc=business,dc=com" objectclass="automountmap"
dn:  ou=auto.master,ou=automount,dc=business,dc=com 
ou:  auto.master 
objectClass: top
objectClass: organizationalunit
objectClass: automountmap

dn:  ou=auto.home,ou=automount,dc=business,dc=com 
ou:  auto.home 
objectClass: top
objectClass: organizationalunit
objectClass: automountmap

[zare@389client ~]$ ldapsearch -LLL -x -h 389-ds -b "dc=business,dc=com" objectclass="automount"
dn:  cn=/home,ou=auto.master,ou=automount,dc=business,dc=com 
automountInformation:  ldap:ou=auto.home,ou=automount,dc=business,dc=com 
cn: /home
objectClass: top
objectClass: automount

dn:  cn=*,ou=auto.home,ou=automount,dc=business,dc=com 
automountInformation:  -fstype=nfs,rw,bg,intr,hard,nfsvers=3,tcp,noacl zfs-storage:/export/home/& 
cn: *
objectClass: top
objectClass: automount

Client configuration


To test, as root list info about configured automounter maps.
[root@389client /]#  automount -m 
autofs dump map information
global options: none configured
Mount point: /home
  type: ldap
  map: ldap:ou=auto.home,ou=automount,dc=business,dc=com
  * | -fstype=nfs,rw,bg,intr,hard,nfsvers=3,tcp,noacl zfs-storage:/export/home/&
Another test is to SSH to a system.
zare@389client:~$ pwd

zare@389client:~$ df -h | grep home
                      2.0T  2.0T   98G  96% /home/zare

zare@389client:~$ mount | grep home
zfs-storage:/export/home/zare on /home/zare type nfs (rw,intr,hard,nfsvers=3,tcp,noacl,sloppy,addr=10.x.x.x)

Password-less login

Thre is option to configure 389-ds to store users' public SSH keys. This work may not be needed in this case, since if a user has public keys in the file /home/<username>/.ssh/authorized_keys then user should be able to do password-less login.

Back to the main page