特殊:Badtitle/NS100:AutofsLDAP/zh
![]() |
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/AutofsLDAP }} |
![]() |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/af | • {{#if: UbuntuHelp:AutofsLDAP|Afrikaans| [[::AutofsLDAP/zh/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ar | • {{#if: UbuntuHelp:AutofsLDAP|العربية| [[::AutofsLDAP/zh/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/az | • {{#if: UbuntuHelp:AutofsLDAP|azərbaycanca| [[::AutofsLDAP/zh/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/bcc | • {{#if: UbuntuHelp:AutofsLDAP|جهلسری بلوچی| [[::AutofsLDAP/zh/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/bg | • {{#if: UbuntuHelp:AutofsLDAP|български| [[::AutofsLDAP/zh/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/br | • {{#if: UbuntuHelp:AutofsLDAP|brezhoneg| [[::AutofsLDAP/zh/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ca | • {{#if: UbuntuHelp:AutofsLDAP|català| [[::AutofsLDAP/zh/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/cs | • {{#if: UbuntuHelp:AutofsLDAP|čeština| [[::AutofsLDAP/zh/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/de | • {{#if: UbuntuHelp:AutofsLDAP|Deutsch| [[::AutofsLDAP/zh/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/el | • {{#if: UbuntuHelp:AutofsLDAP|Ελληνικά| [[::AutofsLDAP/zh/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/es | • {{#if: UbuntuHelp:AutofsLDAP|español| [[::AutofsLDAP/zh/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/fa | • {{#if: UbuntuHelp:AutofsLDAP|فارسی| [[::AutofsLDAP/zh/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/fi | • {{#if: UbuntuHelp:AutofsLDAP|suomi| [[::AutofsLDAP/zh/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/fr | • {{#if: UbuntuHelp:AutofsLDAP|français| [[::AutofsLDAP/zh/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/gu | • {{#if: UbuntuHelp:AutofsLDAP|ગુજરાતી| [[::AutofsLDAP/zh/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/he | • {{#if: UbuntuHelp:AutofsLDAP|עברית| [[::AutofsLDAP/zh/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/hu | • {{#if: UbuntuHelp:AutofsLDAP|magyar| [[::AutofsLDAP/zh/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/id | • {{#if: UbuntuHelp:AutofsLDAP|Bahasa Indonesia| [[::AutofsLDAP/zh/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/it | • {{#if: UbuntuHelp:AutofsLDAP|italiano| [[::AutofsLDAP/zh/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ja | • {{#if: UbuntuHelp:AutofsLDAP|日本語| [[::AutofsLDAP/zh/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ko | • {{#if: UbuntuHelp:AutofsLDAP|한국어| [[::AutofsLDAP/zh/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ksh | • {{#if: UbuntuHelp:AutofsLDAP|Ripoarisch| [[::AutofsLDAP/zh/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/mr | • {{#if: UbuntuHelp:AutofsLDAP|मराठी| [[::AutofsLDAP/zh/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ms | • {{#if: UbuntuHelp:AutofsLDAP|Bahasa Melayu| [[::AutofsLDAP/zh/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/nl | • {{#if: UbuntuHelp:AutofsLDAP|Nederlands| [[::AutofsLDAP/zh/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/no | • {{#if: UbuntuHelp:AutofsLDAP|norsk| [[::AutofsLDAP/zh/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/oc | • {{#if: UbuntuHelp:AutofsLDAP|occitan| [[::AutofsLDAP/zh/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/pl | • {{#if: UbuntuHelp:AutofsLDAP|polski| [[::AutofsLDAP/zh/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/pt | • {{#if: UbuntuHelp:AutofsLDAP|português| [[::AutofsLDAP/zh/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ro | • {{#if: UbuntuHelp:AutofsLDAP|română| [[::AutofsLDAP/zh/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/ru | • {{#if: UbuntuHelp:AutofsLDAP|русский| [[::AutofsLDAP/zh/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/si | • {{#if: UbuntuHelp:AutofsLDAP|සිංහල| [[::AutofsLDAP/zh/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/sq | • {{#if: UbuntuHelp:AutofsLDAP|shqip| [[::AutofsLDAP/zh/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/sr | • {{#if: UbuntuHelp:AutofsLDAP|српски / srpski| [[::AutofsLDAP/zh/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/sv | • {{#if: UbuntuHelp:AutofsLDAP|svenska| [[::AutofsLDAP/zh/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/th | • {{#if: UbuntuHelp:AutofsLDAP|ไทย| [[::AutofsLDAP/zh/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/tr | • {{#if: UbuntuHelp:AutofsLDAP|Türkçe| [[::AutofsLDAP/zh/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/vi | • {{#if: UbuntuHelp:AutofsLDAP|Tiếng Việt| [[::AutofsLDAP/zh/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/yue | • {{#if: UbuntuHelp:AutofsLDAP|粵語| [[::AutofsLDAP/zh/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/zh | • {{#if: UbuntuHelp:AutofsLDAP|中文| [[::AutofsLDAP/zh/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/zh-hans | • {{#if: UbuntuHelp:AutofsLDAP|中文(简体)| [[::AutofsLDAP/zh/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AutofsLDAP | UbuntuHelp:AutofsLDAP | {{#if: | :}}AutofsLDAP/zh}}/zh-hant | • {{#if: UbuntuHelp:AutofsLDAP|中文(繁體)| [[::AutofsLDAP/zh/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:AutofsLDAP|:AutofsLDAP/zh|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :AutofsLDAP/zh/zh | | {{#ifexist: AutofsLDAP/zh/zh | | {{#ifeq: {{#titleparts:AutofsLDAP/zh|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:AutofsLDAP/zh|1|-1|}} | zh | | }}
介绍
自动挂载是通过网络挂载目录的先进方法,并且非常容易管理非常节省带宽。在这里,autofs将通过LDAP目录来配置。这样,我们将拥有一个集中的配置,并且可以最大化的利用已经配置起来的LDAP。很不错吧?
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: 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)