touch /etc/squid/squid_passwd chmod o+r /etc/squid/squid_passwd #添加用户名和密码 htpasswd -cb /etc/squid/squid_passwd username password
注意htpasswd
是Apache Httpd中的一个应用,我在安装Squid后,发现这个就已经有了。如果没有这个程序的话,需要安装httpd服务器。
yum install httpd apt-get install apache2
接下来修改squid的配置文件,/etc/squid/squid.conf
在文件的最上方添加下面的配置(总之在acl和http_access之前),我的ncsa_auth是在lib64下的,我是64位的操作系统
auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/squid_passwd
以前这个放在中间的时候,我这里出现了下面的问题:
Can’t use proxy auth because no authentication schemes are fully configured.
在acl那里配置里最后一行加入
acl ncsa_users proxy_auth REQUIRED
在http_access那里最上一行加入
http_access allow ncsa_users
重新启动
/etc/init.d/squid restart chkconfig squid on #开机自动启动,自己选择安装
附送一个代理检测网站,如果是高度的匿名代码是不会被检测出来的http://www.iprivacytools.com/proxy-checker-anonymity-test/
声明:未经允许禁止转载 东东东 陈煜东的博客 文章,谢谢。如经授权,转载请注明: 转载自东东东 陈煜东的博客
本文链接地址: Squid为http代理设置密码权限 – https://www.chenyudong.com/archives/squid-http-proxy-set-password.html
2018 年 2 月 4 日 — 14:17
Good