OpenLDAP Replication SASL (ldap_sasl_interactive_bind_s failed (-2))
Bonjour à tous,
Je me permet de vous écrire parce que ça fait 1 semaine que je bloque sur un problème. Je suis en train de mettre en place une réplication d'un serveur OpenLDAP avec kerberos. J'ai bien mes serveurs Kerberos et mon master qui fonctionne sans soucis. Je peux configurer un client, me connecter avec un user etc.. tout se passe bien. J'ai voulu ensuite répliquer le master sur un consumer. J'ai pas mal buché mais la base de la base a été ce tuto :
http://www.rjsystems.nl/en/2100-d6-o...r-kerberos.php
Mon erreur est la suivant sur mon esclave :
Code:
1 2
| Jul 11 18:11:40 sldap04 slapd[8179]: slap_client_connect: URI=ldap://sldap05.laine.fr:389/ ldap_sasl_interactive_bind_s failed (-2)
Jul 11 18:11:40 sldap04 slapd[8179]: do_syncrepl: rid=004 rc -2 retrying (4 retries left) |
Sur le tuto il est dis que pour éviter cette erreur, on doit configurer k5start :
Code:
1 2 3 4 5 6 7 8 9
| ~# apt-get install kstart
This is the only package that gets installed as a result:
To configure it, just add this line to the end of the /etc/inittab file to start running k5start in the background soon after the system boots up:
KS:2345:respawn:/usr/bin/k5start -U -f /etc/krb5.keytab -K 10 -l 24h -k /tmp/krb5cc_105 -o openldap
-k /tmp/krb5cc_105 − Use the file /tmp/krb5cc_105 as the ticket cache. The number at the end of the file name *must match* the UID (105 in this example) of the user on behalf of whom the ticket is maintained (see option -o). Otherwise this slapd server will not authenticate properly and the result will be a ldap_sasl_interactive_bind_s failed (-2) error. |
J'ai donc fait comme dis. Je suis sous debian 8.8 donc inittab ne fonctionne pas, j'ai installé sysvinit pour le faire fonctionner. Sans succès. Du coup je me retrouve avec l'erreur indiquée.
Voici la ligne que j'ai mise dans la inittab (j'ai également ajouté le fichier de base dispo sur le net)
Code:
KS:2345:respawn:/usr/bin/k5start -U -f /etc/krb5.keytab -K 10 -l 24h -k /tmp/krb5cc_2002 -o openldap
L'UID ici présent est le compte openldap de l'arbre du master, pas le compte local. J'ai quand meme test avec le compte local ça ne marche pas.
Je pense que vu que mon esclave n'arrive pas a récupérer les ticket TGT, il ne peux pas répliquer la base. Sauf que je n'arrive pas a faire fonctionner le tout.
Du coup une rapide recherche des données sur mon ldap esclave donne :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| ldapsearch -H ldap://sldap04.laine.fr
SASL/GSSAPI authentication started
SASL username: admin@LAINE.FR
SASL SSF: 56
SASL data security layer installed.
# extended LDIF
#
# LDAPv3
# base <dc=laine,dc=fr> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 4
result: 32 No such object
# numResponses: 1
No such object... |
J'ai essayé de lancer la commande a la main sans succès.
Quelqu'un aurait une idée ?
Pour info voila mon fichier Database du slave
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| dn: olcDatabase={1}mdb
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcDbDirectory: /var/lib/ldap
olcLastMod: TRUE
olcDbCheckpoint: 512 30
olcDbIndex: objectClass eq
olcDbIndex: cn,uid eq
olcDbIndex: uidNumber,gidNumber eq
olcDbIndex: member,memberUid eq
olcDbIndex: entryUUID eq
olcDbIndex: entryCSN eq
olcDbIndex: ou eq
olcDbIndex: dc eq
olcDbMaxSize: 1073741824
structuralObjectClass: olcMdbConfig
entryUUID: bc8f001a-1899-1038-8436-5db4e409c09b
creatorsName: cn=admin,cn=config
createTimestamp: 20180710143154Z
olcAccess: {0}to * by users read by * none
olcRootDN: cn=admin,dc=laine,dc=fr
olcSuffix: dc=laine,dc=fr
olcUpdateRef: "ldap://sldap05.laine.fr:389/"
olcSyncrepl: {0}rid=004 provider="ldap://sldap05.laine.fr:389/" type=refresh
AndPersist retry="60 30 300 +" searchbase="dc=laine,dc=fr" bindmethod=sasl
saslmech=gssapi
entryCSN: 20180710182425.191328Z#000000#000#000000
modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifyTimestamp: 20180710182425Z |
Et celui du master :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| dn: olcDatabase={1}mdb
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=laine,dc=fr
olcLastMod: TRUE
olcDbCheckpoint: 512 30
olcDbIndex: objectClass eq
olcDbIndex: cn,uid eq
olcDbIndex: uidNumber,gidNumber eq
olcDbIndex: member,memberUid eq
olcDbIndex: ou eq
olcDbIndex: dc eq
olcDbIndex: entryUUID eq
olcDbIndex: entryCSN eq
olcDbMaxSize: 1073741824
structuralObjectClass: olcMdbConfig
entryUUID: 47922790-1896-1038-9dc8-bbdd7d61784e
creatorsName: cn=admin,cn=config
createTimestamp: 20180710140709Z
olcAccess: {0}to attrs=userPassword,shadowLastChange by * none
olcAccess: {1}to attrs=loginShell by self write by users read by * none
olcAccess: {2}to dn.base="" by * read
olcAccess: {3}to * by users read by * none
olcRootDN: uid=admin,ou=people,dc=laine,dc=fr
entryCSN: 20180710143558.027662Z#000000#000#000000
modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifyTimestamp: 20180710143558Z |
Le cn=config du master :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| # AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 c19b38ef
dn: cn=config
objectClass: olcGlobal
cn: config
olcArgsFile: /var/run/slapd/slapd.args
olcPidFile: /var/run/slapd/slapd.pid
olcToolThreads: 1
structuralObjectClass: olcGlobal
entryUUID: 4791b530-1896-1038-9dbe-bbdd7d61784e
creatorsName: cn=config
createTimestamp: 20180710140709Z
olcAuthzRegexp: {0}uid=([^,]+),cn=laine.fr,cn=gssapi,cn=auth uid=$1,ou=peopl
e,dc=laine,dc=fr
olcAuthzRegexp: {1}uid=admin,cn=laine.fr,cn=gssapi,cn=auth uid=admin,dc=lain
e,dc=fr
olcSaslRealm: LAINE.FR
olcLogLevel: 256
olcServerID: 005
entryCSN: 20180711152503.776159Z#000000#000#000000
modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifyTimestamp: 20180711152503Z |
et celui du slave :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| dn: cn=config
objectClass: olcGlobal
cn: config
olcArgsFile: /var/run/slapd/slapd.args
olcPidFile: /var/run/slapd/slapd.pid
olcToolThreads: 1
structuralObjectClass: olcGlobal
entryUUID: bc8e8a90-1899-1038-842c-5db4e409c09b
creatorsName: cn=config
createTimestamp: 20180710143154Z
olcAuthzRegexp: {0}uid=([^,]+),cn=laine.fr,cn=gssapi,cn=auth uid=$1,ou=peopl
e,dc=laine,dc=fr
olcAuthzRegexp: {1}uid=admin,cn=laine.fr,cn=gssapi,cn=auth uid=admin,dc=lain
e,dc=fr
olcSaslRealm: LAINE.FR
olcSaslHost: sldap04.laine.fr
olcLogLevel: 256
entryCSN: 20180710194203.790280Z#000000#000#000000
modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifyTimestamp: 20180710194203Z
~ |
Et un bref aperçu de mes fichier sur les deux :
Master :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| /etc/ldap/slapd.d/
├── cn=config
│ ├── cn=module{0}.ldif
│ ├── cn=schema
│ │ ├── cn={0}core.ldif
│ │ ├── cn={1}cosine.ldif
│ │ ├── cn={2}nis.ldif
│ │ └── cn={3}inetorgperson.ldif
│ ├── cn=schema.ldif
│ ├── olcBackend={0}mdb.ldif
│ ├── olcDatabase={0}config.ldif
│ ├── olcDatabase={-1}frontend.ldif
│ ├── olcDatabase={1}mdb
│ │ └── olcOverlay={0}syncprov.ldif
│ └── olcDatabase={1}mdb.ldif
└── cn=config.ldif |
3 directories, 12 files
Slave :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| etc/ldap/slapd.d/
├── cn=config
│ ├── cn=module{0}.ldif
│ ├── cn=schema
│ │ ├── cn={0}core.ldif
│ │ ├── cn={1}cosine.ldif
│ │ ├── cn={2}nis.ldif
│ │ └── cn={3}inetorgperson.ldif
│ ├── cn=schema.ldif
│ ├── olcBackend={0}mdb.ldif
│ ├── olcDatabase={0}config.ldif
│ ├── olcDatabase={-1}frontend
│ │ ├── olcOverlay={0}chain
│ │ │ └── olcDatabase={0}ldap.ldif
│ │ └── olcOverlay={0}chain.ldif
│ ├── olcDatabase={-1}frontend.ldif
│ ├── olcDatabase={1}mdb
│ │ └── olcOverlay={0}syncprov.ldif
│ └── olcDatabase={1}mdb.ldif
└── cn=config.ldif
5 directories, 14 files |
Merci de votre aide !
Vincent