• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Auth Problem

Wormi

Newbie
Hi und hallo,

ich habe meinen Squid so konfiguriert, dass er das pam modul benutzt und sich die user aus einer Datei holt die den proxy benutzen dürfen.

Eine Abfrage des Users und des PW´s kommt zwar auch, jedoch kann ich keine Seiten aufrufen weil er mir immer sagt ich dürfte das nicht!

Wo kann der Fehler liegen?

Code:
ERROR
Cache Access Denied

--------------------------------------------------------------------------------

While trying to retrieve the URL: http://www.google.de/ 

The following error was encountered: 

Cache Access Denied. 

Sorry, you are not currently allowed to request: 

    http://www.google.de/from this cache until you have authenticated yourself. 

You need to use Netscape version 2.0 or greater, or Microsoft Internet Explorer 3.0, or an HTTP/1.1 compliant browser for this to work. Please contact the cache administrator if you have difficulties authenticating yourself or change your default password.

Hier meine squid.conf

Code:
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
hosts_file /etc/hosts
auth_param basic program /usr/lib/squid/pam_auth
auth_param basic children 5
auth_param basic realm I-SEC Proxy
auth_param basic credentialsttl 2 hour
authenticate_cache_garbage_interval 1 hour
authenticate_ttl 1 hour
authenticate_ip_ttl 3600 seconds
refresh_pattern ^ftp:		1440	20%	10080
refresh_pattern ^gopher:	1440	0%	1440
refresh_pattern .		0	20%	4320
acl all src 0.0.0.0/0.0.0.0
acl checkpw proxy_auth user "/etc/squid/user"
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl CONNECT method CONNECT
acl Ports_1 port 0-99999
http_access allow all checkpw Ports_1
http_access deny all
http_reply_access allow all
icp_access allow all
coredump_dir /var/spool/squid

Der User ist als Systemuser angelegt und in der Datei "/etc/squid/user" eingetragen!
 
Ich würde es mit folgender config versuchen:

Code:
dns_nameservers 127.0.0.1

auth_param basic program /usr/sbin/ncsa_auth /etc/squid/squid.pw
auth_param basic realm I-SEC Proxy 
auth_param basic children 5 

acl mitpw  proxy_auth REQUIRED
acl all src 0.0.0.0/0.0.0.0 
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8 
acl CONNECT method CONNECT
acl Ports_1 port 0-65535

http_access allow mitpw
http_access allow localhost
icp_access allow all

http_access deny all
http_access deny !Safe_ports

http_reply_access allow all
coredump_dir /var/spool/squid

So würde ich das mal machen!! Oben bei squid.pw kannst die User eintragen, die Zugriff haben sollen.

Befehl: htpasswd2 -c /Pfad/Username
Des -c steht für create, also nur das erste Mal verwenden!
 

L-user

Newbie
Sers wormi ,

das ist ein lösungsweg.

Squid.conf
Code:
auth_param basic program /usr/lib/squid/pam_auth
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
und
Code:
acl ARUSER proxy_auth REQUIRED
http_access allow ARUSER all  
http_access deny all
so eine ähnliche Regel musst du streichen !!
Code:
acl ARNETZ_hosts src 192.168.2.100-192.168.2.120
http_access allow ARNETZ_hosts
wenn du so eine hast.

in /etc/pam.d/
musst du eine Ordner Namens squid anlegen in diesen Ordner legst du eine text datei mit folgenden inhalt:

Code:
#type		control		module-path      		   module-arguments
auth 		 required 	/lib/security/pam_unix.so 		  debug
account        required       /lib/security/pam_unix.so 		debug

jetzt legst du die user einfach auf deinem Linux system an.

mit
Code:
adduser username

ich hoffe das hilft dir

PS:eventuell gibt es noch einen weg über SquidGuard und einer Userlist

Gruß L-user :wink:
 
Ich denk mal beides geht!! Ich habe mir halt gedacht, er soll erstmal ne config haben, wo er blickt welcher Befehl was macht. :lol:

Gruß
Linux-Guru
 

zashx

Newbie
Hallo zusammen,

ich habe Eure Auth Beispiele einmal versuch einzubinden in meinen Squid 2.5, dabei tritt allerdings ein Problem auf.

Und zwar wenn ich die Zeile für das Auth Prog. eingebe, egal welches Program ich für die Authentifizierung nutzen will passiert immer folgendes.

Ich will den Squid wieder starten, mach ein fröhliches rcsquid start und bekomme die Meldung: Starting WWW-proxy squid - Warning: squid already running ! failed

Dann dacht ich mir stop ich ihn halt mal.
Doch was seh ich da: Warning: squid nor running ! failed

Kann mir mal einer Sagen was da schief läuft bitte ?!
Ich bin daran am verzweifeln, find einfach das Problem nicht.

Danke.
 
Könnt n Konfigurationsproblem sein.

Probiers mal mit folgender Konfiguration. Die funzt 100%ig. Die ist mit Passwortschutz und Werbeblocker. Also bei mir gehts einwandfrei auf d Testserver. Halt auf das Minium begrenzt!!

Code:
dns_nameservers 127.0.0.1

auth_param basic program /usr/sbin/ncsa_auth /etc/squid/squid.pw
auth_param basic realm Squid Proxy-Server 2.5

cache_mem 50 MB

acl mitpw  proxy_auth REQUIRED
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl WERBUNG url_regex "/etc/squid/werbefrei.urls"

acl SSL_ports port 443		# ssl
acl Safe_ports port 80		# http
acl Safe_ports port 21		# ftp
acl Safe_ports port 22 		# ssh
acl Safe_ports port 443 	# https
acl Safe_ports port 25		# smtp,mail
acl Safe_ports port 110		# pop3
acl Safe_ports port 5190	# ICQ

acl CONNECT method CONNECT

http_access allow mitpw
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_reply_access allow all
http_access deny WERBUNG

icp_access allow all
coredump_dir /var/cache/squid
 

zashx

Newbie
Vielen Dank für die schnelle Antwort und die gute conf.

Damit funktionierts 1A bei mir :)

Jetzt muß ich nur noch die anderen Einstellungen wieder reinbringen die ich noch brauche.
Bin mal gespannt welche den Fehler verursacht.
 

zashx

Newbie
Hab schon alle Einstellungen in deine übertragen, komischerweise ohne irgendwelche Probleme.
Wahrscheinlich irgendwo ein Tippfehler.
 
Kann schon sein...
Ich habe mal ne Samba config geschrieben. Dabei habe ich nur eine "[" vergessen und schon ging nix mehr. War echt zum k****!!
 
Oben