我刚刚创build了一个基于Squid的代理服务器,该服务器在默认configuration下运行良好。 但是我不希望每个人都能访问它。 我想设置鱿鱼的用户名/密码访问。 我被告知这是相对直接的。 到目前为止,我做了以下几件事:
sudo htpasswd -c /etc/squid/passwd A And added the following to /etc/squid/squid.conf auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd acl AUser proxy_auth A http_access allow AUser
我相信这是正确的做法? 最初我得到了关于“不能使用代理身份validation,因为没有身份validationscheme完全configuration”的错误消息,但我解决了这个问题,通过将auth_param基本程序…行在acl行之前。 但是,当我重新启动鱿鱼服务,并input代理IP地址和端口到我的浏览器(Chrome),它没有加载一个页面,或确实要求用户名/密码。 然后我跟踪到这个事实,我不应该在squid.conf文件中有“http_access全部拒绝”。 我不确定这是否是最好的设置,或者确实是否会造成任何安全问题,但现在看起来确实对我有用。
非常感谢!
您只需要检查可用的squid的身份validationfunction文档
http://wiki.squid-cache.org/Features/Authentication
在squid中有很多可用的身份validation方法,上面的链接都有详细的文档logging。 通过它,select适合你的。
刚刚遇到这个老post,而我面临同样的问题。 我相信没有必要commnet或禁用“http_access拒绝所有”。 所有你需要做的是,而不是指定单个用户undre ACL,指定更广泛的组。 就像是
acl ncsa_users proxy_auth REQUIRED http_access allow ncsa_users
这里有一些额外的自动调整。
#This line defines the file holding the authentication details and also the program to check those details auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/password #Define the maximum number of child process to spawn for authentication auth_param basic children 5 #user will see this message "Squid proxy-caching web server" in authentication box auth_param basic realm Squid proxy-caching web server #time to live after a successful authentication auth_param basic credentialsttl 2 hours #to make username case insensitive auth_param basic casesensitive off
那会做把戏。