个人工具
登录
查看“UbuntuHelp:AutofsLDAP”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:AutofsLDAP”的源代码
来自Ubuntu中文
←
UbuntuHelp:AutofsLDAP
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/AutofsLDAP}} {{Languages|UbuntuHelp:AutofsLDAP}} == Introduction == Automount is the modern way to mount directories over a network. It is far easier to manage and is more economic in bandwidth. In this howto, autofs will be configured through an LDAP directory: in that way, we have a centralised configuration and make maximum use of the LDAP that has been setup. Great, isn't it? == Installation == First of all, automount is composed of two parts: a kernel module and user land utilities. Kernels in modern GNU/Linux distributions are compiled with support for automount. You just have to install the user land utilities: install the following packages <code><nowiki>autofs-ldap ldap-utils</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). If you plan to only use flat files configuration, you do not need to install the <code><nowiki>autofs-ldap </nowiki></code> package: installation is described in [[UbuntuHelp:Autofs|Autofs]] howto. == Configuration == Configuring LDAP automount consists of several parts: * configure openldap server to load the autofs-ldap schema * entering LDAP entries for defining mountpoints * entering LDAP entries for defining directories * defining on the client to use LDAP for automount configuration === On the server === Tell the slapd daemon to load <code><nowiki>/etc/ldap/schema/autofs-ldap.schema</nowiki></code>: <pre><nowiki> sudo nano /etc/ldap/slapd.conf </nowiki></pre> and add the line <pre><nowiki> #Schema and objectClass definitions include /etc/ldap/schema/autofs.schema </nowiki></pre> The <code><nowiki>autofs.schema</nowiki></code> line must be inserted after <code><nowiki>core.schema</nowiki></code> and <code><nowiki>cosine.schema</nowiki></code> Finally restart the slapd service: <pre><nowiki> sudo /etc/init.d/slapd restart </nowiki></pre> === Populating LDAP === In the LDAP directory, you have to enter two kinds of entries: * entry that defines the mountpoint * entry that defines the directory under a mountpoint Here is an example of LDAP entries based on the [[UbuntuHelp:OpenLDAPServer|OpenLDAPServer]] installation. <pre><nowiki> dn: ou=admin,dc=example,dc=com ou: admin objectClass: top objectClass: organizationalUnit dn: ou=automount,ou=admin,dc=example,dc=com ou: automount objectClass: top objectClass: organizationalUnit dn: ou=auto.master,ou=automount,ou=admin,dc=example,dc=com ou: auto.master objectClass: top objectClass: automountMap dn: cn=/home,ou=auto.master,ou=automount,ou=admin,dc=example,dc=com cn: /home objectClass: top objectClass: automount automountInformation: ldap:ou=auto.home,ou=automount,ou=admin,dc=example,dc=com --timeout=60 --ghost dn: ou=auto.home,ou=automount,ou=admin,dc=example,dc=com ou: auto.home objectClass: top objectClass organizationalUnit dn: cn=lionel,ou=auto.home,ou=automount,ou=admin,dc=example,dc=com cn: lionel objectClass: top objectClass: automount automountInformation: -fstype=nfs,rw,hard,intr,nodev,exec,nosuid,rsize=8192,wsize=8192 nfs.example.com:/export/home/lionel </nowiki></pre> === On the client === On the client, you only have to add the LDAP map to the automount entry of <code><nowiki>/etc/nsswitch.conf</nowiki></code>. Edit your <code><nowiki>/etc/nsswitch.conf</nowiki></code> and add the line: <pre><nowiki> automount: files ldap </nowiki></pre> The package <code><nowiki>ldap-utils</nowiki></code> has to be configured. Edit <code><nowiki>/etc/ldap/ldap.conf</nowiki></code>: <pre><nowiki> BASE dc=example,dc=com URI ldap://ldap.example.com </nowiki></pre> == Launch == autofs looks in the LDAP directory for the automountMap. You just have to launch <code><nowiki>autofs</nowiki></code>: <pre><nowiki> sudo /etc/init.d/autofs start </nowiki></pre> == Test == Just check with a mount that automount has been started correctly: <pre><nowiki> mount | grep automount automount(pid5058) on /home type autofs (rw,fd=4,pgrp=5058,minproto=2,maxproto=4) </nowiki></pre> [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:AutofsLDAP
。