1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
5 <!-- entities files to use -->
6 <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
11 <chapter id="DomApps">
12 <title>Integrating Additional Services</title>
15 <primary>authentication</primary>
16 </indexterm><indexterm>
17 <primary>backends</primary>
18 </indexterm><indexterm>
19 <primary>smbpasswd</primary>
20 </indexterm><indexterm>
21 <primary>ldapsam</primary>
22 </indexterm><indexterm>
23 <primary>Active Directory</primary>
25 You've come a long way now. You have pretty much mastered Samba-3 for
26 most uses it can be put to. Up until now, you have cast Samba-3 in the leading
27 role and where authentication was required, you have used one or another of
28 Samba's many authentication backends (from flat text files with smbpasswd
29 to LDAP directory integration with ldapsam). Now you can design a
30 solution for a new Abmas business. This business is running Windows Server
31 2003 and Active Directory, and these are to stay. It's time to master
32 implementing Samba and Samba-supported services in a domain controlled by
33 the latest Windows authentication technologies. Let's get started &smbmdash; this is
38 <title>Introduction</title>
41 Abmas has continued its miraculous growth; indeed, nothing seems to be able
42 to stop its diversification into multiple (and seemingly unrelated) fields.
43 Its latest acquisition is Abmas Snack Foods, a big player in the snack-food
48 With this acquisition comes new challenges for you and your team. Abmas Snack
49 Foods is a well-developed business with a huge and heterogeneous network. They
50 already have Windows, Netware, and Proprietary UNIX, but as yet no Samba or Linux.
51 The network is mature and well established, and there is no question of their chosen
52 user authentication scheme being changed for now. You need to take a wise new
57 You have decided to set the ball rolling by introducing Samba-3 into the network
58 gradually, taking over key services and easing the way to a full migration and,
59 therefore, integration into Abmas's existing business later.
63 <title>Assignment Tasks</title>
66 <primary>web</primary>
67 <secondary>proxying</secondary>
68 </indexterm><indexterm>
69 <primary>web</primary>
70 <secondary>caching</secondary>
72 You've promised the skeptical Abmas Snack Foods management team
73 that you can show them how Samba can ease itself and other Open Source
74 technologies into their existing infrastructure and deliver sound business
75 advantages. Cost cutting is high on their agenda (a major promise of the
76 acquisition). You have chosen Web proxying and caching as your proving ground.
80 <primary>bandwidth</primary>
81 </indexterm><indexterm>
82 <primary>Microsoft ISA</primary>
84 Abmas Snack Foods has several thousand users housed at their Head Office
85 and multiple regional offices, plants, and warehouses. A high proportion of
86 the business's work is done online, so Internet access for most of these
87 users is essential. All Internet access, including all of their regional offices,
88 is funneled through the head office and is the job of the (now your) networking
89 team. The bandwidth requirements were horrific (comparable to a small ISP), and
90 the team soon discovered proxying and caching. In fact, they became one of
91 the earliest commercial users of Microsoft ISA.
95 <primary>Active Directory</primary>
96 </indexterm><indexterm>
97 <primary>authenticated</primary>
98 </indexterm><indexterm>
99 <primary>proxy</primary>
101 The team is not happy with ISA. Because it never lived up to its marketing promises,
102 it under-performed and had reliability problems. You have pounced on the opportunity
103 to show what Open Source can do. The one thing they do like, however, is ISA's
104 integration with Active Directory. They like that their users, once logged on,
105 are automatically authenticated against the proxy. If your alternative to ISA
106 can operate completely seamlessly in their Active Directory Domain, it will be
111 This is a hands-on exercise. You build software applications so
112 that you obtain the functionality Abmas needs.
119 <title>Dissection and Discussion</title>
122 The key requirements in this business example are straightforward. You are not required
123 to do anything new, just to replicate an existing system, not lose any existing features,
124 and improve performance. The key points are:
129 Internet access for most employees
132 Distributed system to accommodate load and geographical distribution of users
135 Seamless and transparent interoperability with the existing Active Directory domain
141 <title>Technical Issues</title>
144 <primary>browsing</primary>
145 </indexterm><indexterm>
146 <primary>Squid</primary>
147 </indexterm><indexterm>
148 <primary>Squid proxy</primary>
149 </indexterm><indexterm>
150 <primary>proxy</primary>
151 </indexterm><indexterm>
152 <primary>authentication</primary>
153 </indexterm><indexterm>
154 <primary>Internet Explorer</primary>
155 </indexterm><indexterm>
156 <primary>winbind</primary>
157 </indexterm><indexterm>
158 <primary>NTLM</primary>
159 </indexterm><indexterm>
160 <primary>NTLM authentication daemon</primary>
161 </indexterm><indexterm>
162 <primary>authentication</primary>
163 </indexterm><indexterm>
164 <primary>daemon</primary>
165 </indexterm><indexterm>
166 <primary>Active Directory</primary>
167 </indexterm><indexterm>
168 <primary>domain</primary>
169 <secondary>Active Directory</secondary>
170 </indexterm><indexterm>
171 <primary>Kerberos</primary>
172 </indexterm><indexterm>
173 <primary>token</primary>
175 Functionally, the user's Internet Explorer requests a browsing session with the
176 Squid proxy, for which it offers its AD authentication token. Squid hands off
177 the authentication request to the Samba-3 authentication helper application
178 called <command>ntlm_auth</command>. This helper is a hook into winbind, the
179 Samba-3 NTLM authentication daemon. Winbind enables UNIX services to authenticate
180 against Microsoft Windows Domains, including Active Directory domains. As Active
181 Directory authentication is a modified Kerberos authentication, winbind is assisted
182 in this by local Kerberos 5 libraries configured to check passwords with the Active
183 Directory server. Once the token has been checked, a browsing session is established.
184 This process is entirely transparent and seamless to the user.
188 Enabling this consists of:
193 Preparing the necessary environment using preconfigured packages
197 Setting up raw Kerberos authentication against the Active Directory domain
201 Configuring, compiling, and then installing the supporting Samba-3 components
205 Tying it all together
213 <title>Political Issues</title>
216 You are a stranger in a strange land and all eyes are upon you. Some would even like to see
217 you fail. For you to gain the trust of your newly acquired IT people, it is essential that your
218 solution does everything the old one did, but does it better in every way. Only then
219 will the entrenched positions consider taking up your new way of doing things on a
228 <title>Implementation</title>
231 <primary>Squid</primary>
233 First, your system needs to be prepared and in a known good state to proceed. This consists
234 of making sure that everything the system depends on is present and that everything that could
235 interfere or conflict with the system is removed. You will be configuring the Squid and Samba-3
236 packages and updating them if necessary. If conflicting packages of these programs are installed,
237 they must be removed.
241 <primary>Red Hat Linux</primary>
243 The following packages should be available on your Red Hat Linux system:
247 <listitem><para><indexterm>
248 <primary>krb5</primary>
249 </indexterm><indexterm>
250 <primary>Kerberos</primary>
273 <primary>SUSE Linux</primary>
275 In the case of SUSE Linux, these packages are called:
287 <listitem><para><indexterm>
288 <primary>Heimdal</primary>
299 If the required packages are not present on your system, you must install
300 them from the vendor's installation media. Follow the administrative guide
301 for your Linux system to ensure that the packages are correctly updated.
304 <note><para><indexterm>
305 <primary>MS Windows Server 2003</primary>
306 </indexterm><indexterm>
307 <primary>Kerberos</primary>
308 </indexterm><indexterm>
309 <primary>MIT</primary>
311 If the requirement is for interoperation with MS Windows Server 2003, it
312 will be necessary to ensure that you are using MIT Kerberos version 1.3.1
313 or later. Red Hat Linux 9 ships with MIT Kerberos 1.2.7 and thus requires
318 <primary>Heimdal</primary>
319 </indexterm><indexterm>
320 <primary>SUSE Enterprise Linux Server</primary>
322 Heimdal 0.6 or later is required in the case of SUSE Linux. SUSE Enterprise
323 Linux Server 8 ships with Heimdal 0.4. SUSE 9 ships with the necessary version.
326 <sect2 id="ch10-one">
327 <title>Removal of Pre-existing Conflicting RPMs</title>
330 <primary>Squid</primary>
332 If Samba and/or Squid rpms are installed, they should be updated. You can
333 build both from source.
337 <primary>rpm</primary>
338 </indexterm><indexterm>
339 <primary>samba</primary>
340 </indexterm><indexterm>
341 <primary>squid</primary>
343 Locating the packages to be uninstalled can be achieved by running:
345 &rootprompt; rpm -qa | grep -i samba
346 &rootprompt; rpm -qa | grep -i squid
348 The identified packages may be removed using:
350 &rootprompt; rpm -e samba-common
355 <title>Kerberos Configuration</title>
358 <primary>Kerberos</primary>
359 </indexterm><indexterm>
360 <primary>Active Directory</primary>
361 <secondary>server</secondary>
362 </indexterm><indexterm>
363 <primary>ADS</primary>
364 </indexterm><indexterm>
365 <primary>KDC</primary>
367 The systems Kerberos installation must be configured to communicate with
368 your primary Active Directory server (ADS KDC).
372 Strictly speaking, MIT Kerberos version 1.3.1 currently gives the best results,
373 although the current default Red Hat MIT version 1.2.7 gives acceptable results
374 unless you are using Windows 2003 servers.
378 <primary>MIT</primary>
379 </indexterm><indexterm>
380 <primary>Heimdal</primary>
381 </indexterm><indexterm>
382 <primary>Kerberos</primary>
383 </indexterm><indexterm>
384 <primary>/etc/krb5.conf</primary>
385 </indexterm><indexterm>
386 <primary>DNS</primary>
387 <secondary>SRV records</secondary>
388 </indexterm><indexterm>
389 <primary>KDC</primary>
390 </indexterm><indexterm>
391 <primary>DNS</primary>
392 <secondary>lookup</secondary>
394 Officially, neither MIT (1.3.1) nor Heimdal (0.6) Kerberos needs an <filename>/etc/krb5.conf</filename>
395 file in order to work correctly. All ADS domains automatically create SRV records in the
396 DNS zone <constant>Kerberos.REALM.NAME</constant> for each KDC in the realm. Since both
397 MIT and Heimdal, KRB5 libraries default to checking for these records, so they
398 automatically find the KDCs. In addition, <filename>krb5.conf</filename> only allows
399 specifying a single KDC, even there if there is more than one. Using the DNS lookup
400 allows the KRB5 libraries to use whichever KDCs are available.
404 <step><para><indexterm>
405 <primary>krb5.conf</primary>
407 If you find the need to manually configure the <filename>krb5.conf</filename>, you should edit it
408 to have the contents shown in <link linkend="ch10-krb5conf"/>. The final fully qualified path for this file
409 should be <filename>/etc/krb5.conf</filename>.
412 <step><para><indexterm>
413 <primary>Kerberos</primary>
414 </indexterm><indexterm>
415 <primary>realm</primary>
416 </indexterm><indexterm>
417 <primary>case-sensitive</primary>
418 </indexterm><indexterm>
419 <primary>KDC</primary>
420 </indexterm><indexterm>
421 <primary>synchronization</primary>
422 </indexterm><indexterm>
423 <primary>initial credentials</primary>
424 </indexterm><indexterm>
425 <primary>Clock skew</primary>
426 </indexterm><indexterm>
427 <primary>NTP</primary>
428 </indexterm><indexterm>
429 <primary>DNS</primary>
430 <secondary>lookup</secondary>
431 </indexterm><indexterm>
432 <primary>reverse DNS</primary>
433 </indexterm><indexterm>
434 <primary>NetBIOS name </primary>
435 </indexterm><indexterm>
436 <primary>/etc/hosts</primary>
437 </indexterm><indexterm>
438 <primary>mapping</primary>
440 The following gotchas often catch people out. Kerberos is case sensitive. Your realm must
441 be in UPPERCASE, or you will get an error: <quote>Cannot find KDC for requested realm while getting
442 initial credentials</quote>. Kerberos is picky about time synchronization. The time
443 according to your participating servers must be within 5 minutes or you get an error
444 <quote>kinit(v5): Clock skew too great while getting initial credentials</quote>.
445 Clock skew limits are, in fact, configurable in the Kerberos protocols (the default is
446 5 minutes). A better solution is to implement NTP throughout your server network.
447 Kerberos needs to be able to do a reverse DNS lookup on the IP address of your KDC.
448 Also, the name that this reverse lookup maps to must either be the NetBIOS name of
449 the KDC (i.e., the hostname with no domain attached), or it can alternately be the
450 NetBIOS name followed by the realm. If all else fails, you can add a
451 <filename>/etc/hosts</filename> entry mapping the IP address of your KDC to its
452 NetBIOS name. If Kerberos cannot do this reverse lookup, you will get a local error
453 when you try to join the realm.
456 <step><para><indexterm>
457 <primary>kinit</primary>
459 You are now ready to test your installation by issuing the command:
461 &rootprompt; kinit [USERNAME@REALM]
463 You are asked for your password, which you should enter. The following
464 is a typical console sequence:
466 &rootprompt; kinit ADMINISTRATOR@LONDON.ABMAS.BIZ
467 Password for ADMINISTRATOR@LONDON.ABMAS.BIZ:
469 Make sure that your password is accepted by the Active Directory KDC.
473 <example id="ch10-krb5conf">
474 <title>Kerberos Configuration &smbmdash; File: <filename>/etc/krb5.conf</filename></title>
477 default_realm = LONDON.ABMAS.BIZ
481 kdc = w2k3s.london.abmas.biz
487 <primary>klist</primary>
491 &rootprompt; klist -e
493 shows the Kerberos tickets cached by the system:
497 <title>Samba Configuration</title>
500 <primary>Active Directory</primary>
502 Samba must be configured to correctly use Active Directory. Samba-3 must be used, as
503 this has the necessary components to interface with Active Directory.
507 <step><para><indexterm>
508 <primary>Red Hat Linux</primary>
509 </indexterm><indexterm>
510 <primary>Samba Tea</primary>
511 </indexterm><indexterm>
512 <primary>Red Hat Fedora Linux</primary>
513 </indexterm><indexterm>
514 <primary>MIT KRB5</primary>
515 </indexterm><indexterm>
516 <primary>ntlm_auth</primary>
518 Download the latest stable Samba-3 for Red Hat Linux from the official Samba Team
519 <ulink url="http://ftp.samba.org">FTP site.</ulink> The official Samba Team
520 RPMs for Red Hat Fedora Linux contain the <command>ntlm_auth</command> tool
521 needed, and are linked against MIT KRB5 version 1.3.1 and, therefore, are ready for use.
525 <primary>SerNet</primary>
526 </indexterm><indexterm>
527 <primary>RPMs</primary>
529 The necessary, validated RPM packages for SUSE Linux may be obtained from
530 the <ulink url="ftp://ftp.sernet.de/pub/samba">SerNet</ulink> FTP site that
531 is located in Germany. All SerNet RPMs are validated, have the necessary
532 <command>ntlm_auth</command> tool, and are statically linked
533 against suitably patched Heimdal 0.6 libraries.
537 Using your favorite editor, change the <filename>/etc/samba/smb.conf</filename>
538 file so it has contents similar to the example shown in <link linkend="ch10-smbconf"/>.
541 <step><para><indexterm>
542 <primary>computer account</primary>
543 </indexterm><indexterm>
544 <primary>Active Directory</primary>
545 </indexterm><indexterm>
546 <primary>net</primary>
547 <secondary>ads</secondary>
548 <tertiary>join</tertiary>
549 </indexterm><indexterm>
550 <primary>Kerberos ticket</primary>
551 </indexterm><indexterm>
552 <primary>ticket</primary>
554 Next you need to create a computer account in the Active Directory.
555 This sets up the trust relationship needed for other clients to
556 authenticate to the Samba server with an Active Directory Kerberos ticket.
557 This is done with the <quote>net ads join -U [Administrator%Password]</quote>
560 &rootprompt; net ads join -U administrator%vulcon
564 <step><para><indexterm>
565 <primary>smbd</primary>
566 </indexterm><indexterm>
567 <primary>nmbd</primary>
568 </indexterm><indexterm>
569 <primary>winbindd</primary>
570 </indexterm><indexterm>
571 <primary>Active Directory</primary>
572 </indexterm><indexterm>
573 <primary>Samba</primary>
575 Your new Samba binaries must be started in the standard manner as is applicable
576 to the platform you are running on. Alternately, start your Active Directory
577 enabled Samba with the following commands:
581 &rootprompt; winbindd -B
585 <step><para><indexterm>
586 <primary>winbind</primary>
587 </indexterm><indexterm>
588 <primary>Active Directory</primary>
589 <secondary>domain</secondary>
590 </indexterm><indexterm>
591 <primary>wbinfo</primary>
592 </indexterm><indexterm>
593 <primary>enumerating</primary>
594 </indexterm><indexterm>
595 <primary>Active Directory</primary>
596 <secondary>tree</secondary>
598 We now need to test that Samba is communicating with the Active
599 Directory domain; most specifically, we want to see whether winbind
600 is enumerating users and groups. Issue the following commands:
602 &rootprompt; wbinfo -t
603 checking the trust secret via RPC calls succeeded
605 This tests whether we are authenticating against Active Directory:
607 &rootprompt; wbinfo -u
610 LONDON+SUPPORT_388945a0
615 This enumerates all the users in your Active Directory tree:
617 &rootprompt; wbinfo -g
618 LONDON+Domain Computers
619 LONDON+Domain Controllers
621 LONDON+Enterprise Admins
625 LONDON+Group Policy Creator Owners
626 LONDON+DnsUpdateProxy
628 This enumerates all the groups in your Active Directory tree.
631 <step><para><indexterm>
632 <primary>Squid</primary>
633 </indexterm><indexterm>
634 <primary>ntlm_auth</primary>
636 Squid uses the <command>ntlm_auth</command> helper build with Samba-3.
637 You may test <command>ntlm_auth</command> with the command:
639 &rootprompt; /usr/bin/ntlm_auth --username=jht
642 You are asked for your password, which you should enter. You are rewarded with:
644 &rootprompt; NT_STATUS_OK: Success (0x0)
648 <step><para><indexterm>
649 <primary>ntlm_auth</primary>
650 </indexterm><indexterm>
651 <primary>authenticate</primary>
652 </indexterm><indexterm>
653 <primary>winbind</primary>
654 </indexterm><indexterm>
655 <primary>privileged pipe</primary>
656 </indexterm><indexterm>
657 <primary>squid</primary>
658 </indexterm><indexterm>
659 <primary>chgrp</primary>
660 </indexterm><indexterm>
661 <primary>chmod</primary>
662 </indexterm><indexterm>
663 <primary>failure</primary>
665 The <command>ntlm_auth</command> helper, when run from a command line as the user
666 <quote>root</quote>, authenticates against your Active Directory domain (with
667 the aid of winbind). It manages this by reading from the winbind privileged pipe.
668 Squid is running with the permissions of user <quote>squid</quote> and group
669 <quote>squid</quote> and is not able to do this unless we make a vital change.
670 Squid cannot read from the winbind privilege pipe unless you change the
671 permissions of its directory. This is the single biggest cause of failure in the
672 whole process. Remember to issue the following command (for Red Hat Linux):
674 &rootprompt; chgrp squid /var/cache/samba/winbindd_privileged
675 &rootprompt; chmod 750 /var/cache/samba/winbindd_privileged
677 For SUSE Linux 9, execute the following:
679 &rootprompt; chgrp squid /var/lib/samba/winbindd_privileged
680 &rootprompt; chmod 750 /var/lib/samba/winbindd_privileged
688 <title>NSS Configuration</title>
691 <primary>NSS</primary>
692 </indexterm><indexterm>
693 <primary>winbind</primary>
694 </indexterm><indexterm>
695 <primary>authentication</primary>
697 For Squid to benefit from Samba-3, NSS must be updated to allow winbind as a valid route to user authentication.
702 Edit your <filename>/etc/nsswitch.conf</filename> file so it has the parameters shown
703 in <link linkend="ch10-etcnsscfg"/>.
707 <smbconfexample id="ch10-smbconf">
708 <title>Samba Configuration &smbmdash; File: <filename>/etc/samba/smb.conf</filename></title>
709 <smbconfsection>[global]</smbconfsection>
710 <smbconfoption><name>workgroup</name><value>LONDON</value></smbconfoption>
711 <smbconfoption><name>netbios name</name><value>W2K3S</value></smbconfoption>
712 <smbconfoption><name>realm</name><value>LONDON.ABMAS.BIZ</value></smbconfoption>
713 <smbconfoption><name>security</name><value>ads</value></smbconfoption>
714 <smbconfoption><name>encrypt passwords</name><value>yes</value></smbconfoption>
715 <smbconfoption><name>password server</name><value>w2k3s.london.abmas.biz</value></smbconfoption>
717 <smbconfcomment>separate domain and username with '/', like DOMAIN/username</smbconfcomment>
718 <smbconfoption><name>winbind separator</name><value>/</value></smbconfoption>
720 <smbconfcomment>use UIDs from 10000 to 20000 for domain users</smbconfcomment>
721 <smbconfoption><name>idmap uid</name><value>10000-20000</value></smbconfoption>
722 # use GIDs from 10000 to 20000 for domain groups
723 <smbconfoption><name>idmap gid</name><value>10000-20000</value></smbconfoption>
725 <smbconfcomment>allow enumeration of winbind users and groups</smbconfcomment>
726 <smbconfoption><name>winbind enum users</name><value>yes</value></smbconfoption>
727 <smbconfoption><name>winbind enum groups</name><value>yes</value></smbconfoption>
728 <smbconfoption><name>winbind user default domain</name><value>yes</value></smbconfoption>
731 <example id="ch10-etcnsscfg">
732 <title>NSS Configuration File Extract &smbmdash; File: <filename>/etc/nsswitch.conf</filename></title>
734 passwd: files winbind
743 <title>Squid Configuration</title>
746 <primary>Squid</primary>
747 </indexterm><indexterm>
748 <primary>Active Directory</primary>
749 <secondary>authentication</secondary>
751 Squid must be configured correctly to interact with the Samba-3
752 components that handle Active Directory authentication.
760 <title>Configuration</title></sect2>
763 <step><para><indexterm>
764 <primary>SUSE Linux</primary>
765 </indexterm><indexterm>
766 <primary>Squid</primary>
767 </indexterm><indexterm>
768 <primary>helper agent</primary>
770 If your Linux distribution is SUSE Linux 9, the version of Squid
771 supplied is already enabled to use the winbind helper agent. You
772 can, therefore, omit the steps that would build the Squid binary
776 <step><para><indexterm>
777 <primary>nobody</primary>
778 </indexterm><indexterm>
779 <primary>squid</primary>
780 </indexterm><indexterm>
781 <primary>rpms</primary>
782 </indexterm><indexterm>
783 <primary>/etc/passwd</primary>
784 </indexterm><indexterm>
785 <primary>/etc/group</primary>
787 Squid, by default, runs as the user <constant>nobody</constant>. You need to
788 add a system user <constant>squid</constant> and a system group
789 <constant>squid</constant> if they are not set up already (if the default
790 Red Hat squid rpms were installed, they will be). Set up a
791 <constant>squid</constant> user in <filename>/etc/passwd</filename>
792 and a <constant>squid</constant> group in <filename>/etc/group</filename> if these aren't there already.
795 <step><para><indexterm>
796 <primary>permissions</primary>
797 </indexterm><indexterm>
798 <primary>chown</primary>
800 You now need to change the permissions on Squid's <constant>var</constant>
801 directory. Enter the following command:
803 &rootprompt; chown -R squid /var/cache/squid
807 <step><para><indexterm>
808 <primary>logging</primary>
809 </indexterm><indexterm>
810 <primary>Squid</primary>
812 Squid must also have control over its logging. Enter the following commands:
814 &rootprompt; chown -R chown squid:squid /var/log/squid
815 &rootprompt; chmod 770 /var/log/squid
820 Finally, Squid must be able to write to its disk cache!
821 Enter the following commands:
823 &rootprompt; chown -R chown squid:squid /var/cache/squid
824 &rootprompt; chmod 770 /var/cache/squid
828 <step><para><indexterm>
829 <primary>/etc/squid/squid.conf</primary>
831 The <filename>/etc/squid/squid.conf</filename> file must be edited to include the lines from
832 <link linkend="etcsquidcfg"/> and <link linkend="etcsquid2"/>.
835 <step><para><indexterm>
836 <primary>cache directories</primary>
838 You must create Squid's cache directories before it may be run. Enter the following command:
840 &rootprompt; squid -z
845 Finally, start Squid and enjoy transparent Active Directory authentication.
846 Enter the following command:
853 <example id="etcsquidcfg">
854 <title>Squid Configuration File Extract &smbmdash; <filename>/etc/squid.conf</filename> [ADMINISTRATIVE PARAMETERS Section]</title>
856 cache_effective_user squid
857 cache_effective_group squid
861 <example id="etcsquid2">
862 <title>Squid Configuration File extract &smbmdash; File: <filename>/etc/squid.conf</filename> [AUTHENTICATION PARAMETERS Section]</title>
864 auth_param ntlm program /usr/bin/ntlm_auth \
865 --helper-protocol=squid-2.5-ntlmssp
866 auth_param ntlm children 5
867 auth_param ntlm max_challenge_reuses 0
868 auth_param ntlm max_challenge_lifetime 2 minutes
869 auth_param basic program /usr/bin/ntlm_auth \
870 --helper-protocol=squid-2.5-basic
871 auth_param basic children 5
872 auth_param basic realm Squid proxy-caching web server
873 auth_param basic credentialsttl 2 hours
874 acl AuthorizedUsers proxy_auth REQUIRED
875 http_access allow all AuthorizedUsers
882 <title>Key Points Learned</title>
885 <primary>Web browsers</primary>
886 </indexterm><indexterm>
887 <primary>services</primary>
888 </indexterm><indexterm>
889 <primary>authentication protocols</primary>
890 </indexterm><indexterm>
891 <primary>Web</primary>
892 <secondary>proxy</secondary>
893 <tertiary>access</tertiary>
894 </indexterm><indexterm>
895 <primary>NTLMSSP</primary>
897 Microsoft Windows networking protocols permeate the spectrum of technologies that Microsoft
898 Windows clients use, even when accessing traditional services such as Web browsers. Depending
899 on whom you discuss this with, this is either good or bad. No matter how you might evaluate this,
900 the use of NTLMSSP as the authentication protocol for Web proxy access has some advantages over
901 the cookie-based authentication regime used by all competing browsers. It is Samba's implementation
902 of NTLMSSP that makes it attractive to implement the solution that has been demonstrated in this chapter.
910 <title>Questions and Answers</title>
913 <primary>ntlm_auth</primary>
914 </indexterm><indexterm>
915 <primary>SambaXP conference</primary>
916 </indexterm><indexterm>
917 <primary>Goettingen</primary>
918 </indexterm><indexterm>
919 <primary>Italian</primary>
921 The development of the <command>ntlm_auth</command> module was first discussed in many Open Source circles
922 in 2002. At the SambaXP conference in Goettingen, Germany, Mr. Francesco Chemolli demonstrated the use of
923 <command>ntlm_auth</command> during one of the late developer meetings that took place. Since that time, the
924 adoption of <command>ntlm_auth</command> has spread considerably.
928 The largest report from a site that uses Squid with <command>ntlm_auth</command>-based authentication
929 support uses a dual processor server that has 2 GBytes of memory. It provides Web and FTP proxy services for 10,000
930 users. Approximately 2,000 of these users make heavy use of the proxy services. According to the source, who
931 wishes to remain anonymous, the sustained transaction load on this server hovers around 140 hits/sec. The following
932 comments were made with respect to questions regarding the performance of this installation:
936 [In our] EXTREMELY optimized environment ... [the] performance impact is almost [nothing]. The <quote>almost</quote>
937 part is due to the brain damage of the ntlm-over-http protocol definition. Suffice to say that its worst-case
938 scenario triples the number of hits needed to perform the same transactions versus basic or digest auth[entication].
942 You would be well advised to recognize the fact that all cache-intensive proxying solutions demand a lot of memory.
943 Make certain that your Squid proxy server is equipped with sufficient memory to permit all proxy operations to run
944 out of memory without invoking the overheads involved in the use of memory that has to be swapped to disk.
947 <qandaset defaultlabel="chap10bqa" type="number">
952 What does Samba have to do with Web proxy serving?
959 <secondary>transparent inter-operability</secondary>
960 </indexterm><indexterm>
961 <primary>Windows clients</primary>
962 </indexterm><indexterm>
963 <primary>network</primary>
964 <secondary>services</secondary>
965 </indexterm><indexterm>
966 <primary>authentication</primary>
967 </indexterm><indexterm>
968 <primary>wrapper</primary>
970 To provide transparent interoperability between Windows clients and the network services
971 that are used from them, Samba has had to develop tools and facilities that deliver that. The benefit
972 of Open Source software is that it can readily be reused. The current <command>ntlm_auth</command>
973 module is basically a wrapper around authentication code from the core of the Samba project.
977 <primary>plain-text</primary>
978 </indexterm><indexterm>
979 <primary>authentication</primary>
980 <secondary>plain-text</secondary>
981 </indexterm><indexterm>
982 <primary>Web</primary>
983 <secondary>proxy</secondary>
984 </indexterm><indexterm>
985 <primary>FTP</primary>
986 <secondary>proxy</secondary>
987 </indexterm><indexterm>
988 <primary>NTLMSSP</primary>
989 </indexterm><indexterm>
990 <primary>logon credentials</primary>
991 </indexterm><indexterm>
992 <primary>Windows explorer</primary>
993 </indexterm><indexterm>
994 <primary>Internet Information Server</primary>
995 </indexterm><indexterm>
996 <primary>Apache Web server</primary>
998 The <command>ntlm_auth</command> module supports basic plain-text authentication and NTLMSSP
999 protocols. This module makes it possible for Web and FTP proxy requests to be authenticated without
1000 the user being interrupted via his/her Windows logon credentials. This facility is available with
1001 MS Windows explorer and is one of the key benefits claimed for Microsoft Internet Information Server.
1002 There are a few open source initiatives to provide support for these protocols in the Apache Web server
1007 <primary>wrapper</primary>
1009 The short answer is that by adding a wrapper around key authentication components of Samba, other
1010 projects (like Squid) can benefit from the labors expended in meeting user interoperability needs.
1020 What other services does Samba provide?
1027 <primary>winbindd</primary>
1028 </indexterm><indexterm>
1029 <primary>Identity resolver</primary>
1030 </indexterm><indexterm>
1031 <primary>daemon</primary>
1032 </indexterm><indexterm>
1033 <primary>smbd</primary>
1034 </indexterm><indexterm>
1035 <primary>file and print server</primary>
1037 Samba-3 is a file and print server. The core components that provide this functionality are <command>smbd</command>,
1038 <command>nmbd</command>, and the Identity resolver daemon, <command>winbindd</command>.
1042 <primary>SMB/CIFS</primary>
1043 </indexterm><indexterm>
1044 <primary>smbclient</primary>
1046 Samba-3 is an SMB/CIFS client. The core component that provides this is called <command>smbclient</command>.
1050 <primary>modules</primary>
1051 </indexterm><indexterm>
1052 <primary>utilities</primary>
1053 </indexterm><indexterm>
1054 <primary>validation</primary>
1055 </indexterm><indexterm>
1056 <primary>inter-operability</primary>
1057 </indexterm><indexterm>
1058 <primary>authentication</primary>
1060 Samba-3 includes a number of helper tools, plug-in modules, utilities, and test/validation facilities.
1061 Samba-3 includes glue modules that help provide interoperability between MS Windows clients and UNIX/Linux
1062 servers and client. It includes Winbind agents that make it possible to authenticate UNIX/Linux access attempts
1063 as well as logins to an SMB/CIFS authentication server backend. Samba-3 includes name service switcher modules
1064 to permit Identity resolution via SMB/CIFS servers (Windows NT4/200x, Samba, and a host of other commercial
1075 Does use of Samba (<command>ntlm_auth</command>) improve the performance of Squid?
1082 Not really. Samba's <command>ntlm_auth</command> module handles only authentication. It requires that
1083 Squid make an external call to <command>ntlm_auth</command> and, therefore, actually incurs a
1084 little more overhead. Compared with the benefit obtained, that overhead is well worth enduring. Since
1085 Squid is a proxy server, and proxy servers tend to require lots of memory, it is good advice to provide
1086 sufficient memory when using Squid. Just add a little more to accommodate <command>ntlm_auth</command>.