免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 7794 | 回复: 29
打印 上一主题 下一主题

[proxy] squid代理实现账号登陆的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-01-10 16:23 |只看该作者 |倒序浏览
centos 6.3  安装  yum安装squid和http
没有能实现有登陆提示,哪里有问题?????????????????????????
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed

auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_user.txt
auth_param basic children 5
auth_param basic realm WELCOME
auth_param basic credentialsttl 2 hours
acl normal proxy_auth REQUIRED
http_access allow normal


acl localnet src 10.0.0.0/8    # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16        # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines



acl squid_user proxy_auth REQUIRED

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT




#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost



#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed

http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
#

cache_dir ufs /var/spool/squid 1024 16 256
cache_mem 1024 MB
cache_swap_low 90
cache_swap_high 95
minimum_object_size 0 KB
maximum_object_size 4096 KB

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

论坛徽章:
3
白羊座
日期:2014-08-25 15:04:112014年中国系统架构师大会
日期:2014-10-14 15:59:002015元宵节徽章
日期:2015-03-06 15:52:30
2 [报告]
发表于 2015-01-10 18:50 来自手机 |只看该作者
http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=4153855&mobile=yes
认真比对一下,看看问题在哪里

论坛徽章:
0
3 [报告]
发表于 2015-01-12 12:43 |只看该作者
回复 2# 睿智2012
yum安装不行吗?感觉编译的好嘛啊!!

   

论坛徽章:
41
操作系统版块每日发帖之星
日期:2016-08-21 06:20:00每日论坛发贴之星
日期:2016-05-05 06:20:00操作系统版块每日发帖之星
日期:2016-05-05 06:20:00IT运维版块每日发帖之星
日期:2016-05-05 06:20:0015-16赛季CBA联赛之山西
日期:2016-04-27 08:49:00操作系统版块每日发帖之星
日期:2016-04-25 06:20:00操作系统版块每日发帖之星
日期:2016-04-17 06:23:2815-16赛季CBA联赛之吉林
日期:2016-03-25 15:46:3415-16赛季CBA联赛之四川
日期:2016-03-25 14:26:19操作系统版块每日发帖之星
日期:2016-05-27 06:20:00操作系统版块每日发帖之星
日期:2016-05-28 06:20:00IT运维版块每日发帖之星
日期:2016-08-18 06:20:00
4 [报告]
发表于 2015-01-12 13:50 |只看该作者
yum安装的可以实现账号登陆,包括绑定ad账号,自己用过

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
5 [报告]
发表于 2015-01-12 14:35 |只看该作者
1.使用用户账号认真配置,就这样设定是没问题的,主要是看你第一行路径有没有指定正确。
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_user.txt
auth_param basic children 5
auth_param basic realm WELCOME
auth_param basic credentialsttl 2 hours


2. 其他解决方式
2.1如果上述路径没问题,查看下你yum安装的squid是不是支持NCSA。
squid -v
--enable-basic-auth-helpers=LDAP,MSNT,NCSA    看到这一行代表是支持的。

2.2  /etc/squid/squid_user.txt
/etc/squid/squid_user.txt 存放密码用的。密码不能手动创建,需要通过htpasswd命令创建

论坛徽章:
0
6 [报告]
发表于 2015-01-13 12:21 |只看该作者
回复 4# jixuuse

貌似不行啊
其他的不说,mac地址我就试过,没有成功!请问你用的是什么版本的系统
   

论坛徽章:
0
7 [报告]
发表于 2015-01-13 16:14 |只看该作者
回复 5# woxizishen


看截图,yum安装的可以支持认证和mac地址认证的啊,但是不知道为什么我不成功


   

QQ截图20150113161228.jpg (123.71 KB, 下载次数: 54)

yum安装的截图

yum安装的截图

论坛徽章:
41
操作系统版块每日发帖之星
日期:2016-08-21 06:20:00每日论坛发贴之星
日期:2016-05-05 06:20:00操作系统版块每日发帖之星
日期:2016-05-05 06:20:00IT运维版块每日发帖之星
日期:2016-05-05 06:20:0015-16赛季CBA联赛之山西
日期:2016-04-27 08:49:00操作系统版块每日发帖之星
日期:2016-04-25 06:20:00操作系统版块每日发帖之星
日期:2016-04-17 06:23:2815-16赛季CBA联赛之吉林
日期:2016-03-25 15:46:3415-16赛季CBA联赛之四川
日期:2016-03-25 14:26:19操作系统版块每日发帖之星
日期:2016-05-27 06:20:00操作系统版块每日发帖之星
日期:2016-05-28 06:20:00IT运维版块每日发帖之星
日期:2016-08-18 06:20:00
8 [报告]
发表于 2015-01-14 10:43 |只看该作者
安装squid openldap openldap-clients

/etc/openldap/ldap.conf
BASE    dc=test,dc=com
URI     ladp://ad.test.com

/etc/squid/squid.conf
//>-----使用账号做验证--------<
auth_param basic program /usr/lib/squid/squid_ldap_auth -R -b "DC=test,DC=com" -D "CN=squid,CN=Users,DC=test,DC=com" -w "123456" -f sAMAccountName=%s -h ad.test.com

auth_param basic children 50                                 
auth_param basic realm Web-Proxy                              
auth_param basic credentialsttl 10 minute                     
                                                              
acl ldap-auth proxy_auth REQUIRED                             
http_access deny !ldap-auth  

论坛徽章:
0
9 [报告]
发表于 2015-01-14 10:55 |只看该作者
回复 8# jixuuse
没看明白,你有qq吗,我加你,给我详细的将一下

   

论坛徽章:
0
10 [报告]
发表于 2015-01-14 10:58 |只看该作者
回复 5# woxizishen

我也不需要做的很麻烦,就是可以ip地址和mac地址认证通过,另外实现账号认证,AD认证可有可无!


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP