Openldap NFS autofs configuration

Openldap NFS autofs configuration


Server IP:


Openldap Server:192.168.7.180

Openldap client:192.168.7.181


autofs schema:

attributetype ( 1.3.6.1.1.1.1.25 NAME 'automountInformation'

DESC 'Information used by the autofs automounter'

EQUALITY caseExactIA5Match

SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )


objectclass ( 1.3.6.1.1.1.1.9 NAME 'automount' SUP top STRUCTURAL

DESC 'An entry in an automounter map'

MUST ( cn $ automountInformation $ objectclass )

MAY ( description ) )


objectclass ( 1.3.6.1.4.1.2312.4.2.2 NAME 'automountMap' SUP top STRUCTURAL


DESC 'An group of related automount objects'

MUST ( ou ) )



autofs ldif file:

dn: ou=admin,dc=test,dc=net

ou: admin

objectClass: top

objectClass: organizationalUnit


dn: ou=automount,ou=admin,dc=test,dc=net

ou: automount

objectClass: top

objectClass: organizationalUnit


dn: ou=auto.master,ou=automount,ou=admin,dc=test,dc=net

ou: auto.master

objectClass: top

objectClass: automountMap


dn: cn=/home,ou=auto.master,ou=automount,ou=admin,dc=test,dc=net

cn: /home

objectClass: automount

automountInformation: ldap:ou=auto.home,ou=automount,ou=admin,dc=test,dc=net --timeout=60 --ghost


dn: ou=auto.home,ou=automount,ou=admin,dc=test,dc=net

ou: auto.home

objectClass: automountMap


dn: cn=liyanwei,ou=auto.home,ou=automount,ou=admin,dc=test,dc=net

cn: liyanwei

objectClass: automount

automountInformation: -fstype=nfs,rw,hard,intr,nodev,exec,nosuid,rsize=8192,wsize=8192 192.168.7.179:/home/liyanwei



1.Server and client install NFS tools:

yum install -y rpcbind nfs-utils


2.Server config:

1).Modify Server NFS Configuration Files:

vim /etc/exports

/home *(rw,async,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)


2).Start Services:

service rpcbind start

service nfs start


3)set to run on startup

chkconfig rpcbind on

chkconfig nfs on


3.client config:

1.edit /etc/sysconfig/autofs,Add the following Settings .

MASTER_MAP_NAME="ou=auto.master,ou=automount,ou=admin,dc=test,dc=net"

TIMEOUT=300

BROWSE_MODE="no"

MOUNT_NFS_DEFAULT_PROTOCOL=4

LOGGING="verbose"

LDAP_URI="ldap://192.168.7.179/"

SEARCH_BASE="ou=automount,ou=admin,dc=test,dc=net"

MAP_OBJECT_CLASS="automountMap"

ENTRY_OBJECT_CLASS="automount"

MAP_ATTRIBUTE="ou"

ENTRY_ATTRIBUTE="cn"

VALUE_ATTRIBUTE="automountInformation"

USE_MISC_DEVICE="yes


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章