LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-19-2012, 04:49 AM   #1
odjb
Member
 
Registered: Jan 2006
Location: France
Distribution: Ubuntu/Debian
Posts: 69

Rep: Reputation: 1
squid authentication via LDAP problem


Hi,

As a student, I work on a project to authenticate users while they acces internet. I am testing Squid authentication to an LDAP server and I have the following problem :
From Squid server where I installed ldap-utils, I have the following result
Code:
lpasr@Arwen-test:~$ ldapsearch -D cn=admin,dc=hetrol,dc=local -W -b 'dc=hetrol,dc=local' "uid=olive" -LLL -H ldap://192.168.0.100
Enter LDAP Password: 
dn: uid=olive,ou=people,dc=hetrol,dc=local
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: Olive
sn: Boe
givenName: Olive
cn: Olive Boe
displayName: Olive Boe
uidNumber: 1000
gidNumber: 10000
userPassword:: cGFzc3dvcmQ=
...
The search returns the desired result.
But when I tr y using Squid utilities, I get this :

Code:
lpasr@Arwen-test:~$ /usr/lib/squid/ldap_auth -b "dc=hetrol,dc=local" -f "uid=%s" -h 192.168.0.100  
olive password
squid_ldap_auth: WARNING, LDAP search error 'No such object'
ERR Success
I don't understand why Squid get a 'No such object' although ldapsearch succeeds.


thanks in advance,
olivier

Last edited by odjb; 01-19-2012 at 04:51 AM.
 
Old 01-19-2012, 11:12 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

I guess you cannot bind as anonymous to the ldap server to do the ldap search. So use the admin's credentials and see if it works:
Code:
/usr/lib/squid/ldap_auth -b "dc=hetrol,dc=local" -f "uid=%s" -D cn=admin,dc=hetrol,dc=local -w <admin's password> -h 192.168.0.100
Regards
 
Old 01-19-2012, 02:50 PM   #3
odjb
Member
 
Registered: Jan 2006
Location: France
Distribution: Ubuntu/Debian
Posts: 69

Original Poster
Rep: Reputation: 1
thanks for the answer.

when I try this, I get the following error :

Code:
lpasr@Arwen-test:~$ /usr/lib/squid/ldap_auth -b "dc=hetrol,dc=local" -f "uid=%s" -h 192.168.0.100  -D "cn=admin, dc=hetrol,dc=local" -w 1234
olive password
squid_ldap_auth: WARNING, could not bind to binddn 'Protocol error'
ERR Success
After searching with google, I checked the "allow bind_v2" line in slapd.conf. It was not good but after correcting it, I had the same message.
 
Old 01-19-2012, 04:38 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
After searching with google, I checked the "allow bind_v2" line in slapd.conf. It was not good but after correcting it, I had the same message
If you're running openldap on ubuntu, you might add "-ZZ" in the ldap_auth command. See this howto written for debian

Regards
 
Old 01-20-2012, 04:58 AM   #5
odjb
Member
 
Registered: Jan 2006
Location: France
Distribution: Ubuntu/Debian
Posts: 69

Original Poster
Rep: Reputation: 1
ok, when I try this, I get another error message (about TLS). That makes me think I should study the squid_ldap_auth command. In our project, it' another student who works on the squid side. I'm gonna dig with him (cheking syntax and so on ...) and I will tell you about the results.

thanks again,
olivier
 
Old 01-20-2012, 05:54 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by odjb View Post
ok, when I try this, I get another error message (about TLS). That makes me think I should study the squid_ldap_auth command. In our project, it' another student who works on the squid side. I'm gonna dig with him (cheking syntax and so on ...) and I will tell you about the results.

thanks again,
olivier
You should better look the ldap side. Check sladp.conf, if it allows anonymous bind, or if it uses tls and so on

Regards
 
Old 01-23-2012, 04:07 AM   #7
odjb
Member
 
Registered: Jan 2006
Location: France
Distribution: Ubuntu/Debian
Posts: 69

Original Poster
Rep: Reputation: 1
Hi,

I tried the command to authenticate on a known working LDAP server and I get the following result (I modified the root name for confidentiality purpose) :

Code:
lpasr@Ubuntu-lpasr:~$ /usr/lib/squid/ldap_auth -b "ou=people,dc=example,dc=com" -f "uid=%s" -h 10.11.4.241 -d
b21115679 azerty
user filter 'uid=b21115679', searchbase 'ou=people,dc=example,dc=com'
attempting to authenticate user 'uid=b21115679,ou=people,dc=example,dc=com'
ERR Success
I don't understand what it means (except that it doesn't work ...)

olivier
 
Old 01-23-2012, 05:52 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
It means that it tries to authenticate as the user b21115679 (i.e. dn=uid=b21115679,ou=people,dc=example,dc=com) with the given password and it fails
Try once again to use also the admin credentials (-D "..." -w ...) to do the search, cause chances are that anonymous searches are forbidden. This can be verified looking for any "access to ..." line(s) in slapd.conf
Or you can watch the ldap logs and see if you get anything, when trying to authenticate through ldap_auth
BTW why are you using /usr/lib/squid/ldap_auth and not /usr/lib/squid/squid_ldap_auth? Are these the same for ubuntu?
 
Old 01-23-2012, 07:09 AM   #9
odjb
Member
 
Registered: Jan 2006
Location: France
Distribution: Ubuntu/Debian
Posts: 69

Original Poster
Rep: Reputation: 1
Thanks for the answer.

The anonymous searches are enabled as I can use ldapsearch without authenticating and it works. Right now, I can't use the admin credentials because I don't know them. I hope to join the people managing the LDAP server and have some help (until now, the guy was not available). I can't look at slapd.conf either for the same reason.
To answer your last question, I tried first to use squid_ldap_auth but I get a "command not found" so I switched to ldap_auth that works.

regards,
olivier
 
Old 01-23-2012, 07:35 AM   #10
odjb
Member
 
Registered: Jan 2006
Location: France
Distribution: Ubuntu/Debian
Posts: 69

Original Poster
Rep: Reputation: 1
ok, I finally solved the problem with the following command :

Code:
lpasr@Ubuntu-lpasr:~$ /usr/lib/squid/ldap_auth -b "ou=people,dc=example,dc=com" -f "uid=%s" -h 10.11.4.241 -d -v 3
b21115679 azerty
user filter 'uid=b21115679', searchbase 'ou=people,dc=example,dc=com'
attempting to authenticate user 'uid=b21115679,ou=people,dc=example,dc=com'
OK
It seems that the default is not LDAPv3 for the command (at least, /usr/lib/squid/ldap_auth).
Now, I need to know how to configure slapd.conf on my test LDAP server to make anonymous accesses work.
Eventually, I need to replicate partly the LDAP server (10.11.4.241) so people can authenticate locally ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP Authentication with Squid/Ubuntu uronacid Linux - Networking 1 01-10-2011 02:23 PM
Using LDAP authentication only on one cache_peer in Squid EricTRA Linux - Security 8 12-04-2009 01:29 AM
LDAP authentication for squid squid 2.6.STABLE16 release 2.fc8 farrukhndm Linux - Security 2 04-03-2008 01:57 AM
squid server with ldap authentication guy_ripper Linux - Security 2 03-09-2007 10:40 AM
Squid PAM authentication and LDAP redmat Linux - Newbie 1 09-03-2004 07:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration