Squid Web Cache Wiki

Squid Web Cache 文档

🔗 使用 RADIUS 进行身份验证的 Squid 服务器配置

作者:Askar Ali Khan

🔗 目录

在此示例中,Squid 安装将使用 RADIUS “squid_radius_auth” Squid RADIUS 身份验证助手,在允许用户浏览网页之前对其进行身份验证。出于安全原因,用户在被允许访问互联网之前需要输入用户名和密码。

🔗 Squid 安装

使用您的发行版包管理系统或通过源代码安装 Squid。

确保 Squid 是使用 **–enable-basic-auth-helpers=”squid_radius_auth”** 选项编译的,该选项仅在 Squid-2.6.STABLE17 及更高版本中可用。

🔗 创建 RADIUS 配置文件

该配置指定了助手如何连接到 RADIUS。该文件包含指令列表(每行一条)。以 # 开头的行将被忽略。RADIUS 配置文件将包含……

server radiusserver: specifies the name or address of the RADIUS server to connect to.

secret somesecretstring: specifies the shared RADIUS secret.

identifier nameofserver: specifies what the proxy should identify itsels as to the RADIUS server.  This directive is optional (optional)

port portnumber: Specifies the port number or  service name where the helper should connect. (default to 1812)

我的 RADIUS 配置是:/etc/radius_config

server 192.168.10.20
secret someSecret

🔗 测试 squid_radius_auth 助手

在修改 squid.conf 之前,最好从命令行测试该助手。

/usr/local/squid/libexec/squid_radius_auth -f /etc/radius_config

或者,如果您不使用配置文件,那么……

/usr/local/squid/libexec/squid_radius_auth -h 192.168.10.20 -w someSecret

在同一行输入您的 RADIUS 用户名/密码,用空格分隔,成功身份验证后将显示“OK”,否则显示“ERR login failure”。

🔗 squid.conf 配置

auth_param basic program /usr/local/squid/libexec/squid_radius_auth -f /etc/radius_config
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 5 minute
auth_param basic casesensitive off


acl radius-auth proxy_auth REQUIRED
http_access allow radius-auth
http_access allow localhost
http_access deny all

⚠️ Disclaimer: Any example presented here is provided "as-is" with no support
or guarantee of suitability. If you have any further questions about
these examples please email the squid-users mailing list.

类别: ConfigExample

导航:站点搜索站点页面分类🔼 向上