Un homme n'est vieux que quand les regrets ont pris chez lui la place des rêves. John Barrymore
Howto Squid authentification
Howto Squid authentification BETA
Author: MasterSleepy |
|
|
|
Problem: You want your users to loggin to go to internet |
|
|
STEP 1: Create custom template directory
[root@server root]# mkdir -p /etc/e-smith/templates-custom/etc/squid/squid.conf [root@server root]# cd /etc/e-smith/templates-custom/etc/squid/squid.conf |
STEP 2: Create Template
Edit 15AuthProgramNCSA with your favorite text editor
{ return "" unless ( ($squid{RequireAuth} || "no") eq "ncsa");
|
Edit 15AuthProgramPamAuth with your favorite text editor
{
|
Edit 20ACL05ProxyAuth with your favorite text editor
{ return "acl requireauth proxy_auth REQUIRED" if (defined $squid{RequireAuth} && $squid{RequireAuth} =~ /(ncsa|pam)/); } |
Edit 39http_access00pwdprotect with your favorite text editor
{ return "http_access allow requireauth" if (defined $squid{RequireAuth} && $squid{RequireAuth} =~ /(ncsa|pam)/); } |
STEP 3: If you want to use PAM authentification
[root@server root]# db configuration setprop squid RequireAuth pam [root@server root]# expand-template /etc/squid/squid.conf [root@server root]# service squid restart |
STEP 3: If you want to use NCSA authentification
[root@server root]# db configuration setprop squid RequireAuth ncsa [root@server root]# expand-template /etc/squid/squid.conf [root@server root]# service squid restart |
Create user authentification file
[root@server root]# touch /etc/proxyusers [root@server root]# htpasswd -b /etc/proxyusers [name] [password] |
Adapt [name] and [password] for your need, you can add as many user as you want
You can test it with the following command
[root@server root]# /usr/lib/squid/ncsa_auth /etc/proxyusers |
At the prompt type
[name] [passzord]
you should have response ERR or OK