| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-26-2008, 07:23 AM
|
#1
|
|
Member
Registered: Apr 2005
Location: Durban
Posts: 360
Rep:
|
Squid and pam_auth
I have been looking to get pam_auth going with squid.
All the Howtos I've looked at indicate that the pam_auth helper is located at /usr/lib/squid/pam_auth.
However, the file does not exist.
I have compiled Squid3_STABLE1 from source and /opt/squid/helpers/basic_auth/PAM/pam_auth.c does exist.
If I look at /etc/pam.conf, it says the following:
~~~~~~~~~~~~~~ snip ~~~~~~~~~~~~~~~~~~~
# NOTE: Most program use a file under the /etc/pam.d/ directory to setup their
# PAM service modules. This file is used only if that directory does not exist.
~~~~~~~~~~~~~~ snip ~~~~~~~~~~~~~~~~~~~
Obviously the pam_auth module has been replaced.
There is a file in /etc/pam.d/common-auth which contains the following
~~~~~~~~~~~~~~ snip ~~~~~~~~~~~~~~~~~~~
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
# traditional Unix authentication mechanisms.
#
auth required pam_unix.so nullok_secure
~~~~~~~~~~~~~~ snip ~~~~~~~~~~~~~~~~~~~
But I'm not sure how to implement it with the /etc/suid/squid.conf.
|
|
|
|
02-27-2008, 05:46 PM
|
#2
|
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
/usr/lib/squid/pam_auth does exist on my fc8 box
|
|
|
|
02-27-2008, 11:50 PM
|
#3
|
|
Member
Registered: Apr 2005
Location: Durban
Posts: 360
Original Poster
Rep:
|
It turns out I had to compile Squid with the following.
./configure --prefix=/usr/local/squid --enable-linux-netfilter --enable-auth="ntlm,basic" --enable-auth-modules="PAM,NCSA"
What I want is for users to access the 'net without having to change the browser configuration (ie 'transparently').
But I need to be able to track user's usage, so I need them to login to authenticate themselves so that they can be identified by name rather than their IP (which will vary on DHCP).
Googling I see that this is not possible; that Transparent proxying precludes authentication. Beats me why.
|
|
|
|
02-27-2008, 11:54 PM
|
#4
|
|
Member
Registered: Apr 2005
Location: Durban
Posts: 360
Original Poster
Rep:
|
Would it be possible to replace the
"/usr/local/squid/share/errors/English/ERR_ACCESS_DENIED" page with a
custom one providing for usernames and passwords.
A Perl script might then be able to generate a file accessible to the "acl
AuthorisedUser src /var/log/squid/iplistfile" directive.
Is this feasible?
Has anyone done something similar?
Or is there an easier solution?
|
|
|
|
02-28-2008, 04:33 AM
|
#5
|
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
All of the information shows up in the /var/log/squid/access.log and/or /var/log/dansguardian/access.log
If you have authentiacation enabled, the user name and pc address might look like this in the squid access.log
Code:
1203889364.488 0 192.168.0.1 TCP_HIT/200 21287 GET http://linuxquestions.cachefly.net/images/questions/images/LinuxQuestions.png fred NONE/- image/png
or like this in the dansguardian access.log
Code:
2008.2.28 5:17:31 fred 192.168.0.1 http://www.someplace.com/styles/styles1.css GET 1721
From there, you can use a perl script like one found at dansguardian site to dump the access log into an html file which is much for readable.
.
|
|
|
|
02-28-2008, 04:41 AM
|
#6
|
|
Member
Registered: Apr 2005
Location: Durban
Posts: 360
Original Poster
Rep:
|
Yes,
The log looks like the first example you give, which is obviously not sufficient for my purpose.
The second example is really what I'm after, but my information is that user authentication is not compatible with the transparent proxy behaviour. ie, because the browser is unaware of the existence of the proxy, it will not respond to a request for a username and password from it.
|
|
|
|
02-28-2008, 04:59 AM
|
#7
|
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
Quote:
|
but my information is that user authentication is not compatible with the transparent proxy behaviour
|
Correct.
You still get the ip address when not using authentication. But, it's a general pain to get user info when using transparent.
|
|
|
|
02-29-2008, 04:11 AM
|
#8
|
|
Member
Registered: Apr 2005
Location: Durban
Posts: 360
Original Poster
Rep:
|
The point is that my users access multiple networks with multiple network ranges.
I cannot have them reconfiguring their browsers when the access through my server.
|
|
|
|
02-29-2008, 04:25 AM
|
#9
|
|
Member
Registered: Apr 2005
Location: Durban
Posts: 360
Original Poster
Rep:
|
I can't believe that there is not a work-around for this...
For example, if I can set up a file containing an ip address on each line /etc/squid/iplist.
And then I set up the squid.conf to have the following line:
acl authorisedip src "/etc/squid/iplist"
I can change the ERR_ACCESS_DENIED file to contain a form which calls a perl program (catchip.pl) passing it a username and password which, if correct, appends the user's ip to the /etc/squid/iplist file. (removing the IP when the user closes his browser would be trickier).
The problem is that any links in the ERR_ACCESS_DENIED file are appended to the original URL. So, if the user has requested the URL www.toyota.co.za, the form in the ERR file will try to call http://www.toyota.co.za/cgi-bin/catchip.cgi instead of the local cgi-bin/catchip.cgi.
I can't believe that this avenue has not been fully explored....
|
|
|
|
02-29-2008, 05:39 AM
|
#10
|
|
Member
Registered: Apr 2005
Location: Durban
Posts: 360
Original Poster
Rep:
|
Well, in answer to a couple of my questions, the answer is to set up your links as http://localhost/cgi-bin/catchip.pl.
However, the whole scheme seems to fall down because Squid appears to cache the iplist file. So it needs to be restarted in order to re-read that file. Which totally subverts it's usefulness.
Any other suggestions would be most welcome. I can't believe that I'm the only one who wants this kind of functionality?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:28 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|