Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i'm on a clean Ubuntu 13.10 install and i've just installed and configured openldap+samba while i'm trying to configure a domain controller plus user shares. In order to ease ldap management i've also installed gosa and lam ( LDAP Account Manager ).

My issue regards to samba when it's trying to connect to ldap:

# pdbedit -L -Uadmin
smbldap_search_domain_info: Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=PBA))]
smbldap_open_connection: connection opened
failed to bind to server ldap://localhost with dn="cn=admin,dc=exedra,dc=cat" Error: Invalid credentials
        (unknown)
Connection to LDAP server failed for the 1 try!
smbldap_open_connection: connection opened
failed to bind to server ldap://localhost with dn="cn=admin,dc=exedra,dc=cat" Error: Invalid credentials
        (unknown)
Connection to LDAP server failed for the 2 try!
smbldap_open_connection: connection opened
failed to bind to server ldap://localhost with dn="cn=admin,dc=exedra,dc=cat" Error: Invalid credentials
        (unknown)
Connection to LDAP server failed for the 3 try!

Here's the server log:

Nov 21 10:40:58 srv1 slapd[30707]: conn=1088 op=2 SEARCH RESULT tag=101 err=0 nentries=0 text=
Nov 21 10:55:42 srv1 slapd[30707]: conn=1089 fd=29 ACCEPT from IP=127.0.0.1:56558 (IP=0.0.0.0:389)
Nov 21 10:55:42 srv1 slapd[30707]: conn=1089 op=0 BIND dn="cn=admin,dc=exedra,dc=cat" method=128
Nov 21 10:55:42 srv1 slapd[30707]: conn=1089 op=0 RESULT tag=97 err=49 text=
Nov 21 10:55:42 srv1 slapd[30707]: conn=1089 op=1 UNBIND
Nov 21 10:55:42 srv1 slapd[30707]: conn=1089 fd=29 closed
Nov 21 10:55:43 srv1 slapd[30707]: conn=1090 fd=29 ACCEPT from IP=127.0.0.1:56559 (IP=0.0.0.0:389)
Nov 21 10:55:43 srv1 slapd[30707]: conn=1090 op=0 BIND dn="cn=admin,dc=exedra,dc=cat" method=128
Nov 21 10:55:43 srv1 slapd[30707]: conn=1090 op=0 RESULT tag=97 err=49 text=
Nov 21 10:55:43 srv1 slapd[30707]: conn=1090 op=1 UNBIND
Nov 21 10:55:43 srv1 slapd[30707]: conn=1090 fd=29 closed
Nov 21 10:55:44 srv1 slapd[30707]: conn=1091 fd=29 ACCEPT from IP=127.0.0.1:56560 (IP=0.0.0.0:389)
Nov 21 10:55:44 srv1 slapd[30707]: conn=1091 op=0 BIND dn="cn=admin,dc=exedra,dc=cat" method=128
Nov 21 10:55:44 srv1 slapd[30707]: conn=1091 op=0 RESULT tag=97 err=49 text=
Nov 21 10:55:44 srv1 slapd[30707]: conn=1091 op=1 UNBIND
Nov 21 10:55:44 srv1 slapd[30707]: conn=1091 fd=29 closed

As you can see there's a wrong password somewhere. It looks like samba provides a password while authenticating against LDAP while maybe it shouldn't as i can run search through ldap without password:

 ldapsearch -x -LLL -b dc=exedra,dc=cat 'uid=admin' -W
Enter LDAP Password: 
dn: cn=System Administrator-admin,ou=People,dc=exedra,dc=cat
objectClass: top
objectClass: person
objectClass: gosaAccount
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: sambaSamAccount
objectClass: shadowAccount
objectClass: posixAccount
givenName: System
sn: Administrator
cn: System Administrator-admin
uid: admin
sambaDomainName: exedra.cat
sambaAcctFlags: [XU         ]
sambaPrimaryGroupSID: S-1-5-21-2410480708-3229887800-873095019-21003
sambaSID: S-1-5-21-2410480708-3229887800-873095019-41002
loginShell: /bin/bash
homeDirectory: /home/admin
uidNumber: 20001
gidNumber: 10001

But i don't understand why my password here is blank. Here you can see the same above result but without using -W option so no password is asked nor provided:

ldapsearch -x -LLL -b dc=exedra,dc=cat 'uid=admin'
dn: cn=System Administrator-admin,ou=People,dc=exedra,dc=cat
objectClass: top
objectClass: person
objectClass: gosaAccount
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: sambaSamAccount
objectClass: shadowAccount
objectClass: posixAccount
givenName: System
sn: Administrator
cn: System Administrator-admin
uid: admin
sambaDomainName: exedra.cat
sambaAcctFlags: [XU         ]
sambaPrimaryGroupSID: S-1-5-21-2410480708-3229887800-873095019-21003
sambaSID: S-1-5-21-2410480708-3229887800-873095019-41002
loginShell: /bin/bash
homeDirectory: /home/admin
uidNumber: 20001
gidNumber: 10001

If i provide a dn in ldapsearch sentence i'm force to authenticate:

# ldapsearch -x -h localhost -D "cn=admin,dc=exedra,dc=cat" -W
Enter LDAP Password: 
ldap_bind: Server is unwilling to perform (53)
        additional info: unauthenticated bind (DN with no password) disallowed

If i supply the password everything runs fine:


During LDAP installation i set up a LDAP admin password for my admin user called admin which credentials i use to login into gosa and lam without problems.
It looks pretty strange as i need the admin password when using LDAP web management tools.

Extra info

As i'm new to LDAP i've just took a read at the following doc https://help.ubuntu.com/12.04/serverguide/openldap-server.html#openldap-server-installation and once i tought i successfully installed and configured LDAP i read the following doc http://www.unixmen.com/setup-samba-domain-controller-with-openldap-backend-in-ubuntu-13-04/ to configure samba server against LDAP.

Through web management tools i also managed to add some users and groups without issues but i'm suffering lot of issues when trying to browse through samba.

Does anyone know where i went wrong? Thanks in advanced!

share|improve this question

1 Answer 1

I solved the issue by running smbpasswd -w MyLiteralPassword

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.