Ubuntu

Squid Proxy 不提示進行身份驗證並拒絕每個請求

  • August 30, 2014

我對總是拒絕請求的 squid 代理有疑問。不好的部分是,我永遠看不到身份驗證彈出視窗……

Squid 在 Ubuntu 14.04 虛擬伺服器上執行。

我會給你我的 squid.conf:

# acls
### local net
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

### safe ports
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

#set squid port
http_port 3128

hierarchy_stoplist cgi-bin ?

forwarded_for delete

# authentification with username and password
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/squid_user
acl foo proxy_auth REQUIRED
http_access allow foo

## disable ident lookup
ident_lookup_access deny all

# last rule to block all without other valid rule
http_access deny all

最糟糕的是,在過去的幾個月裡,我已經在其他幾個 vserver 實例上執行了該配置 - 我不知道出了什麼問題……

這是 netstat -l 的輸出和 /var/log/squid3/access.log 的最後幾個日誌條目

網路統計 -l

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:ssh                   *:*                     LISTEN     
tcp6       0      0 [::]:3128               [::]:*                  LISTEN     
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN     
udp        0      0 Ubuntu-1404-trusty-:ntp *:*                                
udp        0      0 localhost.localdoma:ntp *:*                                
udp        0      0 *:ntp                   *:*                                
udp        0      0 *:45391                 *:*                                
udp6       0      0 Ubuntu-1404-trusty-:ntp [::]:*                             
udp6       0      0 fe80::21c:14ff:fe01:ntp [::]:*                             
udp6       0      0 ip6-localhost:ntp       [::]:*                             
udp6       0      0 [::]:ntp                [::]:*                             
udp6       0      0 [::]:46534              [::]:*                             
raw        0      0 *:icmp                  *:*                     7          
raw6       0      0 [::]:ipv6-icmp          [::]:*                  7          
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     9030     /var/run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     7254     @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     7803     /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     SEQPACKET  LISTENING     7624     /run/udev/control

/var/log/squid3/access.log的最後幾個條目

1407774496.214      0 188.40.117.68 TCP_DENIED/403 4167 GET http://www.google.de/ - HIER_NONE/- text/html
1407774496.346      0 188.40.117.68 TCP_DENIED/403 3963 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1407774496.398      0 188.40.117.68 TCP_DENIED/403 4200 GET http://www.google.de/favicon.ico - HIER_NONE/- text/html
1407774496.419      0 188.40.117.68 TCP_DENIED/403 4200 GET http://www.google.de/favicon.ico - HIER_NONE/- text/html
1407774498.431      0 188.40.117.68 TCP_DENIED/403 4203 GET http://www.google.de/ - HIER_NONE/- text/html

感謝您抽出寶貴時間 - 我非常感謝您的幫助。如果您需要更多資訊,請直接說出來,我會盡力提供。

我解決了。至少有點……這似乎是創建使用者的問題。將使用者名更改為全小寫後,它開始工作。

引用自:https://serverfault.com/questions/619595