squid + ad+samba+winbind

Posted on 2013-09-02
Medium Priority
Last Modified: 2015-01-14
I am trying to configure the proxy for single sign on.only the users in the internet group will have direct access to the internet but other have to provide the user id and password to get an internet access.

The squid.conf configuration
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
         auth_param basic children 15
         auth_param basic realm squid proxy-caching web server
         auth_param ntlm keep_alive on
acl AuthorizedUsers proxy_auth REQUIRED
#external_acl_type ADS %LOGIN /usr/sbin/wbinfo_group.pl
external_acl_type nt_group %LOGIN /usr/sbin/wbinfo_group.pl
acl dpto external nt_group Holding Internet Users
http_access allow dpto
http_access allow AuthorizedUsers
I am getting this error in /var/log/messages

 fetch_ldap_pw: neither ldap secret retrieved!
Sep  2 14:41:30 proxy-server smbd[5751]: [2013/09/02 14:41:30.814622,  0] lib/smbldap.c:1180(smbldap_connect_system)
Sep  2 14:41:30 proxy-server smbd[5751]:   ldap_connect_system: Failed to retrieve password from secrets.tdb
I can verify the wbinfo -u and wbinfo -g and wbinfo -t all is good.please help
Question by:kastro Abbasi
  • 3
  • 2

Accepted Solution

rajeev2353 earned 2000 total points
ID: 39459465

you can try this method if your ldap configuration is correct and all services and domain are working perfectly

Squid Authentication with Domain User

=>Edit squid.conf file
#vim /etc/squid/squid.conf

http_port 8080

auth_param basic program /usr/lib/squid/squid_ldap_auth -d -b "vd=domain.in,o=domain,dc=domain,dc=in" -f "(&(uid=%s))" 192.168.X.X
auth_param basic children 5
auth_param basic realm web-proxy
auth_param basic credentialsttl 1 minutes
auth_param basic casesensitive off

acl ldapauth proxy_auth REQUIRED

http_access allow ldapauth

save this file

=>Start the service
# /etc/init.d/squid restart
#chkconfig squid on

Author Comment

by:kastro Abbasi
ID: 39459652
I make these changes in squid.conf and now i am getting a login prompt but this prompt did not accept the user id and passwd.

auth_param basic program /usr/sbin/squid_ldap_auth -d -b "vd=holdin.loc,o=holding,dc=loc" -f "(&(uid=%s))"
auth_param basic children 5
auth_param basic realm web-proxy
auth_param basic credentialsttl 1 minutes
auth_param basic casesensitive off

i have attached the samba and squid configuration files.
i have a one group on Active directory for internet users "Internet Users".
Please help me i am strucked from last many days
LVL 81

Expert Comment

ID: 39462345
First you should be using --helper-protocol=squid-2.5-ntlmssp

The other issue is whether you pushed via GPO that NTLM should be used and trusted by the LAN browsers.
Comment out the realm and the keepalive directives for basic.

What guide are you following to set this up.
There is a test for ntlm_auth to make sure it returns a valid response.
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.


Author Comment

by:kastro Abbasi
ID: 39463609
i have checked the ntlm_auth it is working fine with AD users. and squid is working fine for all the users either they are on domain or workgroup.
what should i do if i want
log in prompt only for the users who are not on domain when they try to access the internet through proxy.
LVL 81

Expert Comment

ID: 39463879
Did you configure samba/winbind to default to use AD domain or not.

the setup you have is fine, the difficulty might be what they enter at the login prompt.
i.e. domain+username
or username

If you set the use domain true, then username/password will be validated based on the configuration within /etc/nsswitch.conf.

Your  /usr/sbin/wbinfo_group.pl is ldap based, is that working correctly.  The other issue deals with when squid runs this script, it does not have the rights to external files where you may have stored the credentials that the script uses to authenticate to the LDAP server. or your LDAP server does not allow anonymous queries and the squid  user is not authorized to access it.

Author Comment

by:kastro Abbasi
ID: 39464935
Thanx for the reply.............
when i execute the wbinfo_group.pl script with the user name "abc" which is in the internet group on active diarectory i found the following errors

failed to call wbcLookupName: WBC_ERR_DOMAIN_NOT_FOUND
Could not lookup name Holding
failed to call wbcStringToSid: WBC_ERR_INVALID_PARAM
Could not convert sid  to gid
User:  -abc-
Group: -xxxx
SID:   --
GID:   --
failed to call wbcGetGroups: WBC_ERR_DOMAIN_NOT_FOUND
Could not get groups for user abc
Sending OK to squid

Featured Post

We Need Your Input!

WatchGuard is currently running a beta program for our new macOS Host Sensor for our Threat Detection and Response service. We're looking for more macOS users to help provide insight and feedback to help us make the product even better. Please sign up for our beta program today!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Fine Tune your automatic Updates for Ubuntu / Debian
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

619 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question