特殊:Badtitle/NS100:AutofsLDAP:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的3个中间版本) | |||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:AutofsLDAP}} | {{Languages|UbuntuHelp:AutofsLDAP}} | ||
== Introduction == | == Introduction == | ||
Automount is the modern way to mount directories over a network. It is far | 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 LDAP directory: in that way, we have a centralised configuration and | 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 == | == Installation == | ||
First of all, automount is composed of two parts : kernel module and user land utilities. Kernels in modern GNU/Linux distributions are compiled with support for automount. You just have to install user land utilities : install the following packages <code><nowiki>autofs-ldap ldap-utils</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). | 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]] howto. | 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 == | == Configuration == | ||
Configuring LDAP automount consists of several parts: | Configuring LDAP automount consists of several parts: | ||
第29行: | 第29行: | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Populating LDAP === | === Populating LDAP === | ||
In the LDAP directory, you have to enter two | 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]] installation. | Here is an example of LDAP entries based on the [[UbuntuHelp:OpenLDAPServer|OpenLDAPServer]] installation. | ||
<pre><nowiki> | <pre><nowiki> | ||
dn: ou=admin,dc=example,dc=com | dn: ou=admin,dc=example,dc=com | ||
第54行: | 第54行: | ||
objectClass: automount | objectClass: automount | ||
automountInformation: ldap:ou=auto.home,ou=automount,ou=admin,dc=example,dc=com --timeout=60 --ghost | 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 | dn: cn=lionel,ou=auto.home,ou=automount,ou=admin,dc=example,dc=com | ||
第59行: | 第64行: | ||
objectClass: top | objectClass: top | ||
objectClass: automount | objectClass: automount | ||
automountInformation: -fstype=nfs,rw,hard,intr,nodev,exec,nosuid,rsize=8192,wsize=8192 | automountInformation: -fstype=nfs,rw,hard,intr,nodev,exec,nosuid,rsize=8192,wsize=8192 nfs.example.com:/export/home/lionel | ||
</nowiki></pre> | </nowiki></pre> | ||
=== On the client === | === On the client === | ||
On the client, you only have to add LDAP map to the automount entry of <code><nowiki>/etc/nsswitch.conf</nowiki></code>. Edit | 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> | <pre><nowiki> | ||
automount: files ldap | automount: files ldap | ||
</nowiki></pre> | </nowiki></pre> | ||
The package <code><nowiki>ldap-utils</nowiki></code> | The package <code><nowiki>ldap-utils</nowiki></code> has to be configured. Edit <code><nowiki>/etc/ldap/ldap.conf</nowiki></code>: | ||
<pre><nowiki> | <pre><nowiki> | ||
BASE dc=example,dc=com | BASE dc=example,dc=com | ||
第72行: | 第77行: | ||
</nowiki></pre> | </nowiki></pre> | ||
== Launch == | == Launch == | ||
autofs | autofs looks in the LDAP directory for the automountMap. You just have to launch <code><nowiki>autofs</nowiki></code>: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo /etc/init.d/autofs start | sudo /etc/init.d/autofs start | ||
</nowiki></pre> | </nowiki></pre> | ||
== Test == | == Test == | ||
Just check with a mount that automount | Just check with a mount that automount has been started correctly: | ||
<pre><nowiki> | <pre><nowiki> | ||
mount | grep automount | mount | grep automount |
2010年5月19日 (三) 21:38的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/AutofsLDAP }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/af | • {{#if: UbuntuHelp:AutofsLDAP|Afrikaans| [[::AutofsLDAP/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ar | • {{#if: UbuntuHelp:AutofsLDAP|العربية| [[::AutofsLDAP/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/az | • {{#if: UbuntuHelp:AutofsLDAP|azərbaycanca| [[::AutofsLDAP/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/bcc | • {{#if: UbuntuHelp:AutofsLDAP|جهلسری بلوچی| [[::AutofsLDAP/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/bg | • {{#if: UbuntuHelp:AutofsLDAP|български| [[::AutofsLDAP/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/br | • {{#if: UbuntuHelp:AutofsLDAP|brezhoneg| [[::AutofsLDAP/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ca | • {{#if: UbuntuHelp:AutofsLDAP|català| [[::AutofsLDAP/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/cs | • {{#if: UbuntuHelp:AutofsLDAP|čeština| [[::AutofsLDAP/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/de | • {{#if: UbuntuHelp:AutofsLDAP|Deutsch| [[::AutofsLDAP/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/el | • {{#if: UbuntuHelp:AutofsLDAP|Ελληνικά| [[::AutofsLDAP/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/es | • {{#if: UbuntuHelp:AutofsLDAP|español| [[::AutofsLDAP/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/fa | • {{#if: UbuntuHelp:AutofsLDAP|فارسی| [[::AutofsLDAP/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/fi | • {{#if: UbuntuHelp:AutofsLDAP|suomi| [[::AutofsLDAP/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/fr | • {{#if: UbuntuHelp:AutofsLDAP|français| [[::AutofsLDAP/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/gu | • {{#if: UbuntuHelp:AutofsLDAP|ગુજરાતી| [[::AutofsLDAP/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/he | • {{#if: UbuntuHelp:AutofsLDAP|עברית| [[::AutofsLDAP/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/hu | • {{#if: UbuntuHelp:AutofsLDAP|magyar| [[::AutofsLDAP/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/id | • {{#if: UbuntuHelp:AutofsLDAP|Bahasa Indonesia| [[::AutofsLDAP/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/it | • {{#if: UbuntuHelp:AutofsLDAP|italiano| [[::AutofsLDAP/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ja | • {{#if: UbuntuHelp:AutofsLDAP|日本語| [[::AutofsLDAP/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ko | • {{#if: UbuntuHelp:AutofsLDAP|한국어| [[::AutofsLDAP/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ksh | • {{#if: UbuntuHelp:AutofsLDAP|Ripoarisch| [[::AutofsLDAP/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/mr | • {{#if: UbuntuHelp:AutofsLDAP|मराठी| [[::AutofsLDAP/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ms | • {{#if: UbuntuHelp:AutofsLDAP|Bahasa Melayu| [[::AutofsLDAP/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/nl | • {{#if: UbuntuHelp:AutofsLDAP|Nederlands| [[::AutofsLDAP/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/no | • {{#if: UbuntuHelp:AutofsLDAP|norsk| [[::AutofsLDAP/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/oc | • {{#if: UbuntuHelp:AutofsLDAP|occitan| [[::AutofsLDAP/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/pl | • {{#if: UbuntuHelp:AutofsLDAP|polski| [[::AutofsLDAP/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/pt | • {{#if: UbuntuHelp:AutofsLDAP|português| [[::AutofsLDAP/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ro | • {{#if: UbuntuHelp:AutofsLDAP|română| [[::AutofsLDAP/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/ru | • {{#if: UbuntuHelp:AutofsLDAP|русский| [[::AutofsLDAP/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/si | • {{#if: UbuntuHelp:AutofsLDAP|සිංහල| [[::AutofsLDAP/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/sq | • {{#if: UbuntuHelp:AutofsLDAP|shqip| [[::AutofsLDAP/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/sr | • {{#if: UbuntuHelp:AutofsLDAP|српски / srpski| [[::AutofsLDAP/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/sv | • {{#if: UbuntuHelp:AutofsLDAP|svenska| [[::AutofsLDAP/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/th | • {{#if: UbuntuHelp:AutofsLDAP|ไทย| [[::AutofsLDAP/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/tr | • {{#if: UbuntuHelp:AutofsLDAP|Türkçe| [[::AutofsLDAP/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/vi | • {{#if: UbuntuHelp:AutofsLDAP|Tiếng Việt| [[::AutofsLDAP/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/yue | • {{#if: UbuntuHelp:AutofsLDAP|粵語| [[::AutofsLDAP/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/zh | • {{#if: UbuntuHelp:AutofsLDAP|中文| [[::AutofsLDAP/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/zh-hans | • {{#if: UbuntuHelp:AutofsLDAP|中文(简体)| [[::AutofsLDAP/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP}}/zh-hant | • {{#if: UbuntuHelp:AutofsLDAP|中文(繁體)| [[::AutofsLDAP/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:AutofsLDAP|:AutofsLDAP|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :AutofsLDAP/zh | | {{#ifexist: AutofsLDAP/zh | | {{#ifeq: {{#titleparts:AutofsLDAP|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:AutofsLDAP|1|-1|}} | zh | | }}
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 autofs-ldap ldap-utils
(see InstallingSoftware).
If you plan to only use flat files configuration, you do not need to install the autofs-ldap
package: installation is described in 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 /etc/ldap/schema/autofs-ldap.schema
:
sudo nano /etc/ldap/slapd.conf
and add the line
#Schema and objectClass definitions include /etc/ldap/schema/autofs.schema
The autofs.schema
line must be inserted after core.schema
and cosine.schema
Finally restart the slapd service:
sudo /etc/init.d/slapd restart
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 OpenLDAPServer installation.
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
On the client
On the client, you only have to add the LDAP map to the automount entry of /etc/nsswitch.conf
. Edit your /etc/nsswitch.conf
and add the line:
automount: files ldap
The package ldap-utils
has to be configured. Edit /etc/ldap/ldap.conf
:
BASE dc=example,dc=com URI ldap://ldap.example.com
Launch
autofs looks in the LDAP directory for the automountMap. You just have to launch autofs
:
sudo /etc/init.d/autofs start
Test
Just check with a mount that automount has been started correctly:
mount | grep automount automount(pid5058) on /home type autofs (rw,fd=4,pgrp=5058,minproto=2,maxproto=4)