--- FAQ.orig	Thu Jun 13 16:33:04 2002
+++ FAQ.sgml	Fri Nov 17 14:03:18 2006
@@ -12906,6 +12906,267 @@
 Each authentication program must select its own scheme for persistent
 storage of passwords and usernames.
 
+<sect1>How do I use the Winbind authenticators?
+
+<p>
+Winbind is a recent addition to Samba providing some impressive 
+capabilities for NT based user accounts.  From Squid's perspective winbind provides a robust and efficient
+engine for both basic and NTLM challenge/response authentication
+against an NT domain controller.
+<p>
+Samba 2.2.4 or greater is required.  Samba 2.2.4, 2.2.5, and 3.0a17 
+are known to work with the Squid 2.5 winbind authenticators.  
+<p>
+The winbind authenticators have been used successfully
+under Linux, FreeBSD and Solaris.
+<p>
+
+<sect2>Configure Samba
+<p>
+<bf>Build/Install Samba</bf>
+<p>
+Samba must be built with configure options:
+<verb>
+	--with-winbind
+	--with-winbind-auth-challenge
+</verb>
+<p>
+Optionally, if building Samba 2.2.5, apply the smbpasswd.diff patch 
+in <bf><em>/path/to/patchfile</em></bf>.  See <ref id="WinbindTrustAccounts" name="SMBD and Machine Trust Accounts"> below to
+determine if the patch is worthwhile.
+<p><bf><em>
+(Do we need to tell people how to apply a patch?)
+(should we make a diff for 2.2.4?)
+</em></bf><p>
+<bf>Test Samba's winbindd</bf>
+<enum>
+<item>
+Edit smb.conf for winbindd functionality.  The following entries in 
+the &lsqb;global&rsqb; section of smbd.conf may be used as a template.
+<verb>
+workgroup = mydomain
+password server = myPDC
+security = domain
+winbind uid = 10000-20000
+winbind gid = 10000-20000
+winbind use default domain = yes 
+</verb>
+</item>
+
+<item>
+Join the NT domain as outlined in the winbindd man page for your 
+version of samba. 
+</item>
+
+<item>
+Test winbindd functionality.
+<itemize>
+<item>
+Start nmbd (required to insure proper operation).
+</item>
+
+<item>
+	Start winbindd.
+</item>
+
+<item>
+	Test basic winbindd functionality "wbinfo -t":
+<verb>
+# wbinfo -t
+Secret is good
+</verb>
+</item>
+
+<item>
+Test winbindd user authentication:
+<verb>
+# wbinfo -a mydomain\\myuser%mypasswd
+plaintext password authentication succeeded
+error code was NT_STATUS_OK (0x0)
+challenge/response password authentication succeeded
+error code was NT_STATUS_OK (0x0)
+</verb>
+</item>
+</itemize>
+
+<em/NOTE/: both plaintext and challenge/response should return
+"succeeded." If there is no "challenge/response" status returned then Samba 
+has not built with "--with-winbind-auth-challenge."
+<p>
+</enum>
+
+<bf>SMBD and Machine Trust Accounts</bf><label id="WinbindTrustAccounts">
+<p>
+
+<bf>Samba 2.2.x</bf>
+<p>
+Samba's smbd daemon, while not strictly required by winbindd may be needed
+to manage the machine's trust account.
+<p>
+Well behaved domain members change the account password on a regular
+basis.  Windows and Samba servers default to changing this password
+every seven days.  
+<p>
+The Samba component responsible for managing the trust account password
+is smbd. Smbd needs to receive requests to trigger the password change.
+If the machine will be used for file and print services, then just
+running smbd to serve routine requests should keep everything happy.  
+<p>
+However, in cases where Squid's winbind helpers are the only reason
+Samba components are running, smbd may sit idle.  Indeed, there may be
+no other reason to run smbd at all. 
+<p>
+There are two sample options to change the trust account password in
+<bf><em>/path/to/trustpwstuff</em></bf>. Either may be scheduled daily via a cron job to
+change the trust password.
+<p>
+<bf><em>UglySolution.pl</em></bf> is a sample perl script that will load smbd, connect to
+a Samba share using smbclient, and generate enough dummy activity to
+trigger smbd's machine trust account password change.  
+<p>
+smbpasswd.diff is a patch to Samba 2.2.5's smbpasswd utility to allow
+changing the machine account password at will.  It is a minimal patch
+simply exposing a command line interface to an existing Samba function.  
+<p>
+Once patched, the smbpasswd syntax to change the password is:
+<verb>
+	smbpasswd -t DOMAIN -r PDC
+</verb>
+<p>
+
+<bf>Samba 3.x</bf>
+<p>
+Things are much easier under the 3.x versions of Samba. Smbd is no 
+longer required to manage the machine's trust account, and there is no
+need to patch any utilities. 
+<p>
+The Samba team has incorporated functionality to change the machine 
+trust account password in the new "net" command.  A simple daily cron
+job scheduling "net rpc changetrustpw" is all that is needed.
+<p>
+<p>
+
+
+<sect2>Configure Squid
+<p>
+
+<bf>Build/Install Squid</bf>
+<p>
+Squid must be built with the configure options:
+<verb>
+	--enable-auth="ntlm,basic"
+	--enable-basic-auth-helpers="winbind"
+	--enable-ntlm-auth-helpers="winbind"
+</verb>
+
+<bf>Test Squid without auth</bf>
+<p>
+Before going further, test basic Squid functionality.  Make sure squid 
+is functioning without requiring authorization.
+<p>
+
+<bf>Test the helpers</bf>
+<p>
+Testing the winbind ntlm helper is not really possible from the command
+line, but the winbind basic authenticator can be tested like any other
+basic helper:
+<verb>
+	# /usr/local/squid/libexec/wb_auth -d
+	/wb_auth[65180](wb_basic_auth.c:136): basic winbindd auth helper ...
+	mydomain\myuser mypasswd                   
+	/wb_auth[65180](wb_basic_auth.c:107): Got 'mydomain\myuser mypasswd' from squid (length: 24).
+	/wb_auth[65180](wb_basic_auth.c:54): winbindd result: 0
+	/wb_auth[65180](wb_basic_auth.c:57): sending 'OK' to squid
+	OK
+</verb>
+The helper should return "OK" if given a valid username/password.
+<p>
+
+
+<bf>Edit squid.conf</bf>
+<p>
+<enum>
+
+<item>
+Setup the authenticators.
+<p>
+Add the following to enable both the winbind basic and ntlm 
+authenticators. IE will use ntlm and everything else basic:
+<verb>
+	auth_param ntlm program /usr/local/squid/libexec/wb_ntlmauth         
+	auth_param ntlm children 5
+	auth_param ntlm max_challenge_reuses 0
+	auth_param ntlm max_challenge_lifetime 2 minutes
+
+	auth_param basic program /usr/local/squid/libexec/wb_auth
+	auth_param basic children 5
+	auth_param basic realm Squid proxy-caching web server
+	auth_param basic credentialsttl 2 hours
+</verb>
+</item>
+
+<item>
+Add acl entries to require authentication:
+<verb>
+	acl AuthorizedUsers proxy_auth REQUIRED
+	..
+	http_access allow all AuthorizedUsers
+</verb>
+</item>
+</enum>
+<p>
+
+<bf>Test Squid with auth</bf>
+<p>
+<enum>
+
+<item>
+Internet Explorer:
+<p>
+Test browsing through squid with IE. If logged into the domain,
+a password prompt should NOT pop up. 
+<p>
+Confirm the traffic really is being authorized by tailing access.log.
+The domain\username should be present.
+<p>
+</item>
+
+<item>
+Netscape, mozilla, opera...:
+<p>
+Test with a non-IE browser.  A standard password dialog should appear.
+<p>
+Entering the domain should not be required if the user is in the 
+default domain and "winbind use default domain = yes" is set in 
+smb.conf.  Otherwise, the username must be entered in "domain\username" format.
+</item>
+</enum>
+<p>
+<p>
+If no usernames appear in acces.log and/or no password dialogs appear
+in either browser, then the acl/http_access portions of squid.conf are
+not correct. 
+<p>
+<p>
+<bf>References</bf>
+<p>
+<url url="http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection.html#WINBIND" name="Samba Winbind overview">
+<p>
+<url url="http://www.samba.org/samba/docs/man/winbindd.8.html" name="winbindd man page">
+<p>
+<url url="http://www.samba.org/samba/docs/man/wbinfo.1.html" name="wbinfo man page">
+<p>
+<url url="http://www.samba.org/samba/docs/man/nmbd.8.html" name="nmbd man page">
+<p>
+<url url="http://www.samba.org/samba/docs/man/smbd.8.html" name="smbd man page">
+<p>
+<url url="http://www.samba.org/samba/docs/man/smb.conf.5.html" name="smb.conf man page">
+<p>
+<url url="http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection.html#AEN1134" name="Joining a Domain in Samba 2.2.x">
+<p>
+<url url="http://www.samba.org/samba/docs/man/smbclient.1.html" name="smbclient man page">
+
+
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 
 <sect>Terms and Definitions

