这个LDAP automount命令/文件中的“语法无效”是什么?

时间:2013-05-21 10:38:21

标签: ldap debian automount

我想使用LDAP自动挂载用户的主页和nfs。我跟着this tutorial配置了ldap和automount。 (automount信息:fstype = nfs,hard,intr,nodev,nosuid,rw 192.168.0.1:/home/serveur/dupont)

dn: cn=dupont, ou=nfs, ou=services, dc=projet, dc=sys

objectClass: top

objectClass: automount

cn: dupont

尝试添加此文件时出现语法错误。

$ ldapadd -x -f au.ldif -W -D cn=admin,dc=projet,dc=sys
ldap_add: Invalid syntax (21)
    additional info: objectClass: value #1 invalid per syntax

我似乎无法找到此错误的来源。

$ ldapsearch -x

# extended LDIF
#
# LDAPv3
# base <dc=projet,dc=sys> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# projet.sys
dn: dc=projet,dc=sys
objectClass: top
objectClass: dcObject
objectClass: organization
o: nsalab
dc: projet

# admin, projet.sys
dn: cn=admin,dc=projet,dc=sys
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator

# people, projet.sys
dn: ou=people,dc=projet,dc=sys
objectClass: top
objectClass: organizationalUnit
ou: people
description: Branche gens

# etudiants, people, projet.sys
dn: ou=etudiants,ou=people,dc=projet,dc=sys
objectClass: top
objectClass: organizationalUnit
ou: etudiants
description: Branche etudiants

# personnel, people, projet.sys
dn: ou=personnel,ou=people,dc=projet,dc=sys
objectClass: top
objectClass: organizationalUnit
ou: personnel
description: Branche personnel

# services, projet.sys
dn: ou=services,dc=projet,dc=sys
objectClass: top
objectClass: organizationalUnit
ou: services
description: Branche services

# groupes, services, projet.sys
dn: ou=groupes,ou=services,dc=projet,dc=sys
objectClass: top
objectClass: organizationalUnit
ou: groupes
description: Branche groupes

# nfs, services, projet.sys
dn: ou=nfs,ou=services,dc=projet,dc=sys
objectClass: top
objectClass: organizationalUnit
ou: nfs
description: Branche nfs

# mongroupe, groupes, services, projet.sys
dn: cn=mongroupe,ou=groupes,ou=services,dc=projet,dc=sys
objectClass: top
objectClass: posixGroup
cn: mongroupe
gidNumber: 1111
description: groupe de test mongroupe

# dupont, etudiants, people, projet.sys
dn: uid=dupont,ou=etudiants,ou=people,dc=projet,dc=sys
objectClass: top
objectClass: posixAccount
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
uid: dupont
cn: Dupont Jean
sn: Dupont
givenName: Jean
uidNumber: 1100
gidNumber: 1111
homeDirectory: /home/aware/dupont
loginShell: /bin/bash
mail: dupont@projet.sys
l: France
ou: mongroupe

# search result
search: 2
result: 0 Success

# numResponses: 11
# numEntries: 10

我必须activate the right schema

  

autofs-ldap.schema文件需要转换为LDIF格式。您   可以使用slapcat实用程序执行此操作,如中所述   OpenLDAPServer指南,或者您可以访问   launchpadlibrarian.net/55451730/autofs.ldif并抓住这一个   已经被转换(将其重命名为autofs-ldap.ldif并将其放入   在/ etc / ldap / schema中为了保持一致性。)

并使用ldapadd将其导入数据库。

$ ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/autofs-ldap.ldif

1 个答案:

答案 0 :(得分:1)

您必须activate the right schema

  

autofs-ldap.schema文件需要转换为LDIF格式。您可以使用OpenLDAPServer指南中所述的slapcat实用程序执行此操作,或者只需访问launchpadlibrarian.net/55451730/autofs.ldif并抓住已经转换过的那个(将其重命名为autofs-ldap.ldif并将其放入/etc/ldap/schema为了一致的缘故)。

并使用ldapadd将其导入数据库。

$ ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/autofs-ldap.ldif