4 >SAMBA Project Documentation</TITLE
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
18 NAME="SAMBA-PROJECT-DOCUMENTATION"
25 NAME="SAMBA-PROJECT-DOCUMENTATION"
26 >SAMBA Project Documentation</A
43 > : Mon Apr 1 08:47:26 CST 2002</P
45 >This book is a collection of HOWTOs added to Samba documentation over the years.
46 I try to ensure that all are current, but sometimes the is a larger job
47 than one person can maintain. The most recent version of this document
49 HREF="http://www.samba.org/"
51 >http://www.samba.org/</A
53 on the "Documentation" page. Please send updates to <A
54 HREF="mailto:jerry@samba.org"
59 >This documentation is distributed under the GNU General Public License (GPL)
60 version 2. A copy of the license is included with the Samba source
61 distribution. A copy can be found on-line at <A
62 HREF="http://www.fsf.org/licenses/gpl.txt"
64 >http://www.fsf.org/licenses/gpl.txt</A
78 >How to Install and Test SAMBA</A
85 >Step 0: Read the man pages</A
90 >Step 1: Building the Binaries</A
95 >Step 2: The all important step</A
100 >Step 3: Create the smb configuration file.</A
105 >Step 4: Test your config file with
114 >Step 5: Starting the smbd and nmbd</A
121 >Step 5a: Starting from inetd.conf</A
126 >Step 5b. Alternative: starting it as a daemon</A
133 >Step 6: Try listing the shares available on your
139 >Step 7: Try connecting with the unix client</A
144 >Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
145 Win2k, OS/2, etc... client</A
150 >What If Things Don't Work?</A
157 >Diagnosing Problems</A
167 >Choosing the Protocol Level</A
172 >Printing from UNIX to a Client PC</A
182 >Mapping Usernames</A
187 >Other Character Sets</A
195 HREF="#INTEGRATE-MS-NETWORKS"
196 >Integrating MS Windows networks with Samba</A
208 >Name Resolution in a pure Unix/Linux world</A
225 >/etc/resolv.conf</TT
241 >/etc/nsswitch.conf</TT
249 >Name resolution as used within MS Windows networking</A
256 >The NetBIOS Name Cache</A
283 >How browsing functions and how to deploy stable and
284 dependable browsing using Samba</A
289 >MS Windows security options and how to configure
290 Samba for seemless integration</A
297 >Use MS Windows NT as an authentication server</A
302 >Make Samba a member of an MS Windows NT security domain</A
307 >Configure Samba as an authentication server</A
319 >MS Windows NT Machine Accounts</A
335 >Configuring PAM for distributed but centrally
336 managed authentication</A
348 >Distributed Authentication</A
353 >PAM Configuration in smb.conf</A
360 >Hosting a Microsoft Distributed File System tree on Samba</A
382 HREF="#UNIX-PERMISSIONS"
383 >UNIX Permission Bits and Windows NT Access Control Lists</A
390 >Viewing and changing UNIX permissions using the NT
396 >How to view file security on a Samba share</A
401 >Viewing file ownership</A
406 >Viewing file or directory permissions</A
418 >Directory Permissions</A
425 >Modifying file or directory permissions</A
430 >Interaction with the standard Samba create mask
436 >Interaction with the standard Samba file attribute
444 >Printing Support in Samba 2.2.x</A
463 >Creating [print$]</A
468 >Setting Drivers for Existing Printers</A
473 >Support a large number of printers</A
478 >Adding New Printers via the Windows NT APW</A
483 >Samba and Printer Ports</A
490 >The Imprints Toolset</A
497 >What is Imprints?</A
502 >Creating Printer Driver Packages</A
507 >The Imprints server</A
512 >The Installation Client</A
522 >Migration to from Samba 2.0.x to 2.2.x</A
528 HREF="#DOMAIN-SECURITY"
529 >security = domain in Samba 2.x</A
536 >Joining an NT Domain with Samba 2.2</A
541 >Samba and Windows 2000 Domains</A
546 >Why is this better than security = server?</A
553 >How to Configure Samba 2.2 as a Primary Domain Controller</A
560 >Prerequisite Reading</A
570 >Configuring the Samba Domain Controller</A
575 >Creating Machine Trust Accounts and Joining Clients to the
583 >Manual Creation of Machine Trust Accounts</A
588 >"On-the-Fly" Creation of Machine Trust Accounts</A
593 >Joining the Client to the Domain</A
600 >Common Problems and Errors</A
605 >System Policies and Profiles</A
610 >What other help can I get?</A
615 >Domain Control for Windows 9x/ME</A
622 >Configuration Instructions: Network Logons</A
627 >Configuration Instructions: Setting up Roaming User Profiles</A
634 >Windows NT Configuration</A
639 >Windows 9X Configuration</A
644 >Win9X and WinNT Configuration</A
649 >Windows 9X Profile Setup</A
654 >Windows NT Workstation 4.0</A
659 >Windows NT Server</A
664 >Sharing Profiles between W95 and NT Workstation 4.0</A
673 >DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba</A
680 >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A
687 >Prerequisite Reading</A
697 >What qualifies a Domain Controller on the network?</A
704 >How does a Workstation find its domain controller?</A
709 >When is the PDC needed?</A
716 >Can Samba be a Backup Domain Controller?</A
721 >How do I set up a Samba BDC?</A
728 >How do I replicate the smbpasswd file?</A
736 HREF="#SAMBA-LDAP-HOWTO"
737 >Storing Samba's User/Machine Account information in an LDAP Directory</A
754 >Supported LDAP Servers</A
759 >Schema and Relationship to the RFC 2307 posixAccount</A
764 >Configuring Samba with LDAP</A
771 >OpenLDAP configuration</A
776 >Configuring Samba</A
783 >Accounts and Groups management</A
788 >Security and sambaAccount</A
793 >LDAP specials attributes for sambaAccounts</A
798 >Example LDIF Entries for a sambaAccount</A
810 >Unified Logons between Windows NT and UNIX using Winbind</A
827 >What Winbind Provides</A
841 >How Winbind Works</A
848 >Microsoft Remote Procedure Calls</A
853 >Name Service Switch</A
858 >Pluggable Authentication Modules</A
863 >User and Group ID Allocation</A
875 >Installation and Configuration</A
892 >Testing Things Out</A
899 >Configure and compile SAMBA</A
913 >Configure smb.conf</A
918 >Join the SAMBA server to the PDC domain</A
923 >Start up the winbindd daemon and test it!</A
930 >/etc/rc.d/init.d/smb</TT
936 >Configure Winbind and PAM</A
971 >How can I configure OS/2 Warp Connect or
972 OS/2 Warp 4 as a client for Samba?</A
977 >How can I configure OS/2 Warp 3 (not Connect),
978 OS/2 1.2, 1.3 or 2.x for Samba?</A
983 >Are there any other issues when OS/2 (any version)
984 is used as a client?</A
989 >How do I get printer driver download working
999 >HOWTO Access Samba source code via CVS</A
1011 >CVS Access to samba.org</A
1018 >Access via CVSweb</A
1041 >Chapter 1. How to Install and Test SAMBA</A
1049 >1.1. Step 0: Read the man pages</A
1052 >The man pages distributed with SAMBA contain
1053 lots of useful info that will help to get you started.
1054 If you don't know how to read man pages then try
1063 >nroff -man smbd.8 | more
1068 >Other sources of information are pointed to
1069 by the Samba web site,<A
1070 HREF="http://www.samba.org/"
1072 > http://www.samba.org</A
1081 >1.2. Step 1: Building the Binaries</A
1084 >To do this, first run the program <B
1088 > in the source directory. This should automatically
1089 configure Samba for your operating system. If you have unusual
1090 needs then you may wish to run</P
1103 >first to see what special options you can enable.
1116 >will create the binaries. Once it's successfully
1117 compiled you can use </P
1129 >to install the binaries and manual pages. You can
1130 separately install the binaries and/or man pages using</P
1156 >Note that if you are upgrading for a previous version
1157 of Samba you might like to know that the old versions of
1158 the binaries will be renamed with a ".old" extension. You
1159 can go back to the previous version with</P
1172 >if you find this version a disaster!</P
1180 >1.3. Step 2: The all important step</A
1183 >At this stage you must fetch yourself a
1184 coffee or other drink you find stimulating. Getting the rest
1185 of the install right can sometimes be tricky, so you will
1186 probably need it.</P
1188 >If you have installed samba before then you can skip
1197 >1.4. Step 3: Create the smb configuration file.</A
1200 >There are sample configuration files in the examples
1201 subdirectory in the distribution. I suggest you read them
1202 carefully so you can see how the options go together in
1203 practice. See the man page for all the options.</P
1205 >The simplest useful configuration file would be
1206 something like this:</P
1215 CLASS="PROGRAMLISTING"
1228 >which would allow connections by anyone with an
1229 account on the server, using either their login name or
1230 "homes" as the service name. (Note that I also set the
1231 workgroup that Samba is part of. See BROWSING.txt for details)</P
1240 > file. You need to create it
1243 >Make sure you put the smb.conf file in the same place
1244 you specified in the<TT
1247 > (the default is to
1250 >/usr/local/samba/lib/</TT
1253 >For more information about security settings for the
1254 [homes] share please refer to the document UNIX_SECURITY.txt.</P
1262 >1.5. Step 4: Test your config file with
1269 >It's important that you test the validity of your
1273 > file using the testparm program.
1274 If testparm runs OK then it will list the loaded services. If
1275 not it will give an error message.</P
1277 >Make sure it runs OK and that the services look
1278 reasonable before proceeding. </P
1286 >1.6. Step 5: Starting the smbd and nmbd</A
1289 >You must choose to start smbd and nmbd either
1290 as daemons or from <B
1294 to do both! Either you can put them in <TT
1297 > and have them started on demand
1301 >, or you can start them as
1302 daemons either from the command line or in <TT
1305 >. See the man pages for details
1306 on the command line options. Take particular care to read
1307 the bit about what user you need to be in order to start
1308 Samba. In many cases you must be root.</P
1310 >The main advantage of starting <B
1317 > using the recommended daemon method
1318 is that they will respond slightly more quickly to an initial connection
1326 >1.6.1. Step 5a: Starting from inetd.conf</A
1329 >NOTE; The following will be different if
1330 you use NIS or NIS+ to distributed services maps.</P
1336 What is defined at port 139/tcp. If nothing is defined
1337 then add a line like this:</P
1342 >netbios-ssn 139/tcp</B
1346 >similarly for 137/udp you should have an entry like:</P
1351 >netbios-ns 137/udp</B
1357 >/etc/inetd.conf</TT
1359 and add two lines something like this:</P
1368 CLASS="PROGRAMLISTING"
1369 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
1370 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
1377 >The exact syntax of <TT
1379 >/etc/inetd.conf</TT
1381 varies between unixes. Look at the other entries in inetd.conf
1384 >NOTE: Some unixes already have entries like netbios_ns
1385 (note the underscore) in <TT
1389 You must either edit <TT
1395 >/etc/inetd.conf</TT
1396 > to make them consistent.</P
1398 >NOTE: On many systems you may need to use the
1399 "interfaces" option in smb.conf to specify the IP address
1400 and netmask of your interfaces. Run <B
1404 as root if you don't know what the broadcast is for your
1408 > tries to determine it at run
1409 time, but fails on some unixes. See the section on "testing nmbd"
1410 for a method of finding if you need to do this.</P
1412 >!!!WARNING!!! Many unixes only accept around 5
1413 parameters on the command line in <TT
1417 This means you shouldn't use spaces between the options and
1418 arguments, or you should use a script, and start the script
1427 >, perhaps just send
1428 it a HUP. If you have installed an earlier version of <B
1431 > then you may need to kill nmbd as well.</P
1439 >1.6.2. Step 5b. Alternative: starting it as a daemon</A
1442 >To start the server as a daemon you should create
1443 a script something like this one, perhaps calling
1456 CLASS="PROGRAMLISTING"
1458 /usr/local/samba/bin/smbd -D
1459 /usr/local/samba/bin/nmbd -D
1466 >then make it executable with <B
1472 >You can then run <B
1476 hand or execute it from <TT
1482 >To kill it send a kill signal to the processes
1491 >NOTE: If you use the SVR4 style init system then
1492 you may like to look at the <TT
1494 >examples/svr4-startup</TT
1496 script to make Samba fit into that system.</P
1505 >1.7. Step 6: Try listing the shares available on your
1525 >Your should get back a list of shares available on
1526 your server. If you don't then something is incorrectly setup.
1527 Note that this method can also be used to see what shares
1528 are available on other LanManager clients (such as WfWg).</P
1530 >If you choose user level security then you may find
1531 that Samba requests a password before it will list the shares.
1535 > man page for details. (you
1536 can force it to list the shares without a password by
1537 adding the option -U% to the command line. This will not work
1538 with non-Samba servers)</P
1546 >1.8. Step 7: Try connecting with the unix client</A
1558 > //yourhostname/aservice</I
1570 would be the name of the host where you installed <B
1579 any service you have defined in the <TT
1583 file. Try your user name if you just have a [homes] section
1589 >For example if your unix host is bambi and your login
1590 name is fred you would type:</P
1598 >smbclient //bambi/fred
1609 >1.9. Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT,
1610 Win2k, OS/2, etc... client</A
1613 >Try mounting disks. eg:</P
1617 >C:\WINDOWS\> </TT
1621 >net use d: \\servername\service
1626 >Try printing. eg:</P
1630 >C:\WINDOWS\> </TT
1635 \\servername\spoolservice</B
1641 >C:\WINDOWS\> </TT
1650 >Celebrate, or send me a bug report!</P
1658 >1.10. What If Things Don't Work?</A
1661 >If nothing works and you start to think "who wrote
1662 this pile of trash" then I suggest you do step 2 again (and
1663 again) till you calm down.</P
1665 >Then you might read the file DIAGNOSIS.txt and the
1666 FAQ. If you are still stuck then try the mailing list or
1667 newsgroup (look in the README for details). Samba has been
1668 successfully installed at thousands of sites worldwide, so maybe
1669 someone else has hit your problem and has overcome it. You could
1670 also use the WWW site to scan back issues of the samba-digest.</P
1672 >When you fix the problem PLEASE send me some updates to the
1673 documentation (or source code) so that the next person will find it
1681 >1.10.1. Diagnosing Problems</A
1684 >If you have installation problems then go to
1688 > to try to find the
1697 >1.10.2. Scope IDs</A
1700 >By default Samba uses a blank scope ID. This means
1701 all your windows boxes must also have a blank scope ID.
1702 If you really want to use a non-blank scope ID then you will
1703 need to use the -i <scope> option to nmbd, smbd, and
1704 smbclient. All your PCs will need to have the same setting for
1705 this to work. I do not recommend scope IDs.</P
1713 >1.10.3. Choosing the Protocol Level</A
1716 >The SMB protocol has many dialects. Currently
1717 Samba supports 5, called CORE, COREPLUS, LANMAN1,
1720 >You can choose what maximum protocol to support
1724 > file. The default is
1725 NT1 and that is the best for the vast majority of sites.</P
1727 >In older versions of Samba you may have found it
1728 necessary to use COREPLUS. The limitations that led to
1729 this have mostly been fixed. It is now less likely that you
1730 will want to use less than LANMAN1. The only remaining advantage
1731 of COREPLUS is that for some obscure reason WfWg preserves
1732 the case of passwords in this protocol, whereas under LANMAN1,
1733 LANMAN2 or NT1 it uppercases all passwords before sending them,
1734 forcing you to use the "password level=" option in some cases.</P
1736 >The main advantage of LANMAN2 and NT1 is support for
1737 long filenames with some clients (eg: smbclient, Windows NT
1740 >See the smb.conf(5) manual page for more details.</P
1742 >Note: To support print queue reporting you may find
1743 that you have to use TCP/IP as the default protocol under
1744 WfWg. For some reason if you leave Netbeui as the default
1745 it may break the print queue reporting on some systems.
1746 It is presumably a WfWg bug.</P
1754 >1.10.4. Printing from UNIX to a Client PC</A
1757 >To use a printer that is available via a smb-based
1758 server from a unix host you will need to compile the
1759 smbclient program. You then need to install the script
1760 "smbprint". Read the instruction in smbprint for more details.
1763 >There is also a SYSV style script that does much
1764 the same thing called smbprint.sysv. It contains instructions.</P
1775 >One area which sometimes causes trouble is locking.</P
1777 >There are two types of locking which need to be
1778 performed by a SMB server. The first is "record locking"
1779 which allows a client to lock a range of bytes in a open file.
1780 The second is the "deny modes" that are specified when a file
1783 >Record locking semantics under Unix is very
1784 different from record locking under Windows. Versions
1785 of Samba before 2.2 have tried to use the native
1786 fcntl() unix system call to implement proper record
1787 locking between different Samba clients. This can not
1788 be fully correct due to several reasons. The simplest
1789 is the fact that a Windows client is allowed to lock a
1790 byte range up to 2^32 or 2^64, depending on the client
1791 OS. The unix locking only supports byte ranges up to
1792 2^31. So it is not possible to correctly satisfy a
1793 lock request above 2^31. There are many more
1794 differences, too many to be listed here.</P
1796 >Samba 2.2 and above implements record locking
1797 completely independent of the underlying unix
1798 system. If a byte range lock that the client requests
1799 happens to fall into the range 0-2^31, Samba hands
1800 this request down to the Unix system. All other locks
1801 can not be seen by unix anyway.</P
1803 >Strictly a SMB server should check for locks before
1804 every read and write call on a file. Unfortunately with the
1805 way fcntl() works this can be slow and may overstress the
1806 rpc.lockd. It is also almost always unnecessary as clients
1807 are supposed to independently make locking calls before reads
1808 and writes anyway if locking is important to them. By default
1809 Samba only makes locking calls when explicitly asked
1810 to by a client, but if you set "strict locking = yes" then it will
1811 make lock checking calls on every read and write. </P
1813 >You can also disable by range locking completely
1814 using "locking = no". This is useful for those shares that
1815 don't support locking or don't need it (such as cdroms). In
1816 this case Samba fakes the return codes of locking calls to
1817 tell clients that everything is OK.</P
1819 >The second class of locking is the "deny modes". These
1820 are set by an application when it opens a file to determine
1821 what types of access should be allowed simultaneously with
1822 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
1823 or DENY_ALL. There are also special compatibility modes called
1824 DENY_FCB and DENY_DOS.</P
1826 >You can disable share modes using "share modes = no".
1827 This may be useful on a heavily loaded server as the share
1828 modes code is very slow. See also the FAST_SHARE_MODES
1829 option in the Makefile for a way to do full share modes
1830 very fast using shared memory (if your OS supports it).</P
1838 >1.10.6. Mapping Usernames</A
1841 >If you have different usernames on the PCs and
1842 the unix server then take a look at the "username map" option.
1843 See the smb.conf man page for details.</P
1851 >1.10.7. Other Character Sets</A
1854 >If you have problems using filenames with accented
1855 characters in them (like the German, French or Scandinavian
1856 character sets) then I recommend you look at the "valid chars"
1857 option in smb.conf and also take a look at the validchars
1858 package in the examples directory.</P
1866 NAME="INTEGRATE-MS-NETWORKS"
1867 >Chapter 2. Integrating MS Windows networks with Samba</A
1878 >To identify the key functional mechanisms of MS Windows networking
1879 to enable the deployment of Samba as a means of extending and/or
1880 replacing MS Windows NT/2000 technology.</P
1882 >We will examine:</P
1889 >Name resolution in a pure Unix/Linux TCP/IP
1895 >Name resolution as used within MS Windows
1901 >How browsing functions and how to deploy stable
1902 and dependable browsing using Samba
1907 >MS Windows security options and how to
1908 configure Samba for seemless integration
1913 >Configuration of Samba as:</P
1920 >A stand-alone server</P
1924 >An MS Windows NT 3.x/4.0 security domain member
1929 >An alternative to an MS Windows NT 3.x/4.0 Domain Controller
1942 >2.2. Name Resolution in a pure Unix/Linux world</A
1945 >The key configuration files covered in this section are:</P
1960 >/etc/resolv.conf</TT
1974 >/etc/nsswitch.conf</TT
1990 >Contains a static list of IP Addresses and names.
2000 CLASS="PROGRAMLISTING"
2001 > 127.0.0.1 localhost localhost.localdomain
2002 192.168.1.1 bigbox.caldera.com bigbox alias4box</PRE
2012 name resolution mechanism so that uses do not need to remember
2015 >Network packets that are sent over the physical network transport
2016 layer communicate not via IP addresses but rather using the Media
2017 Access Control address, or MAC address. IP Addresses are currently
2018 32 bits in length and are typically presented as four (4) decimal
2019 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
2021 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented
2022 as two digit hexadecimal numbers separated by colons. eg:
2023 40:8e:0a:12:34:56</P
2025 >Every network interfrace must have an MAC address. Associated with
2026 a MAC address there may be one or more IP addresses. There is NO
2027 relationship between an IP address and a MAC address, all such assignments
2028 are arbitary or discretionary in nature. At the most basic level all
2029 network communications takes place using MAC addressing. Since MAC
2030 addresses must be globally unique, and generally remains fixed for
2031 any particular interface, the assignment of an IP address makes sense
2032 from a network management perspective. More than one IP address can
2033 be assigned per MAC address. One address must be the primary IP address,
2034 this is the address that will be returned in the ARP reply.</P
2036 >When a user or a process wants to communicate with another machine
2037 the protocol implementation ensures that the "machine name" or "host
2038 name" is resolved to an IP address in a manner that is controlled
2039 by the TCP/IP configuration control files. The file
2043 > is one such file.</P
2045 >When the IP address of the destination interface has been
2046 determined a protocol called ARP/RARP isused to identify
2047 the MAC address of the target interface. ARP stands for Address
2048 Resolution Protocol, and is a broadcast oriented method that
2049 uses UDP (User Datagram Protocol) to send a request to all
2050 interfaces on the local network segment using the all 1's MAC
2051 address. Network interfaces are programmed to respond to two
2052 MAC addresses only; their own unique address and the address
2053 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will
2054 contain the MAC address and the primary IP address for each
2060 > file is foundational to all
2061 Unix/Linux TCP/IP installations and as a minumum will contain
2062 the localhost and local network interface IP addresses and the
2063 primary names by which they are known within the local machine.
2064 This file helps to prime the pump so that a basic level of name
2065 resolution can exist before any other method of name resolution
2066 becomes available.</P
2076 >/etc/resolv.conf</TT
2080 >This file tells the name resolution libraries:</P
2086 >The name of the domain to which the machine
2092 >The name(s) of any domains that should be
2093 automatically searched when trying to resolve unqualified
2094 host names to their IP address
2099 >The name or IP address of available Domain
2100 Name Servers that may be asked to perform name to address
2121 > is the primary means by
2122 which the setting in /etc/resolv.conf may be affected. It is a
2123 critical configuration file. This file controls the order by
2124 which name resolution may procede. The typical structure is:</P
2133 CLASS="PROGRAMLISTING"
2141 >then both addresses should be returned. Please refer to the
2142 man page for host.conf for further details.</P
2152 >/etc/nsswitch.conf</TT
2156 >This file controls the actual name resolution targets. The
2157 file typically has resolver object specifications as follows:</P
2166 CLASS="PROGRAMLISTING"
2167 > # /etc/nsswitch.conf
2169 # Name Service Switch configuration file.
2173 # Alternative entries for password authentication are:
2174 # passwd: compat files nis ldap winbind
2178 hosts: files nis dns
2179 # Alternative entries for host name resolution are:
2180 # hosts: files dns nis nis+ hesoid db compat ldap wins
2181 networks: nis files dns
2184 protocols: nis files
2186 services: nis files</PRE
2192 >Of course, each of these mechanisms requires that the appropriate
2193 facilities and/or services are correctly configured.</P
2195 >It should be noted that unless a network request/message must be
2196 sent, TCP/IP networks are silent. All TCP/IP communications assumes a
2197 principal of speaking only when necessary.</P
2199 >Samba version 2.2.0 will add Linux support for extensions to
2200 the name service switch infrastructure so that linux clients will
2201 be able to obtain resolution of MS Windows NetBIOS names to IP
2202 Addresses. To gain this functionality Samba needs to be compiled
2203 with appropriate arguments to the make command (ie: <B
2206 nsswitch/libnss_wins.so</B
2207 >). The resulting library should
2208 then be installed in the <TT
2212 the "wins" parameter needs to be added to the "hosts:" line in
2215 >/etc/nsswitch.conf</TT
2216 > file. At this point it
2217 will be possible to ping any MS Windows machine by it's NetBIOS
2218 machine name, so long as that machine is within the workgroup to
2219 which both the samba machine and the MS Windows machine belong.</P
2228 >2.3. Name resolution as used within MS Windows networking</A
2231 >MS Windows networking is predicated about the name each machine
2232 is given. This name is known variously (and inconsistently) as
2233 the "computer name", "machine name", "networking name", "netbios name",
2234 "SMB name". All terms mean the same thing with the exception of
2235 "netbios name" which can apply also to the name of the workgroup or the
2236 domain name. The terms "workgroup" and "domain" are really just a
2237 simply name with which the machine is associated. All NetBIOS names
2238 are exactly 16 characters in length. The 16th character is reserved.
2239 It is used to store a one byte value that indicates service level
2240 information for the NetBIOS name that is registered. A NetBIOS machine
2241 name is therefore registered for each service type that is provided by
2242 the client/server.</P
2244 >The following are typical NetBIOS name/service type registrations:</P
2253 CLASS="PROGRAMLISTING"
2254 > Unique NetBIOS Names:
2255 MACHINENAME<00> = Server Service is running on MACHINENAME
2256 MACHINENAME<03> = Generic Machine Name (NetBIOS name)
2257 MACHINENAME<20> = LanMan Server service is running on MACHINENAME
2258 WORKGROUP<1b> = Domain Master Browser
2261 WORKGROUP<03> = Generic Name registered by all members of WORKGROUP
2262 WORKGROUP<1c> = Domain Controllers / Netlogon Servers
2263 WORKGROUP<1d> = Local Master Browsers
2264 WORKGROUP<1e> = Internet Name Resolvers</PRE
2270 >It should be noted that all NetBIOS machines register their own
2271 names as per the above. This is in vast contrast to TCP/IP
2272 installations where traditionally the system administrator will
2273 determine in the /etc/hosts or in the DNS database what names
2274 are associated with each IP address.</P
2276 >One further point of clarification should be noted, the <TT
2280 file and the DNS records do not provide the NetBIOS name type information
2281 that MS Windows clients depend on to locate the type of service that may
2282 be needed. An example of this is what happens when an MS Windows client
2283 wants to locate a domain logon server. It find this service and the IP
2284 address of a server that provides it by performing a lookup (via a
2285 NetBIOS broadcast) for enumeration of all machines that have
2286 registered the name type *<1c>. A logon request is then sent to each
2287 IP address that is returned in the enumerated list of IP addresses. Which
2288 ever machine first replies then ends up providing the logon services.</P
2290 >The name "workgroup" or "domain" really can be confusing since these
2291 have the added significance of indicating what is the security
2292 architecture of the MS Windows network. The term "workgroup" indicates
2293 that the primary nature of the network environment is that of a
2294 peer-to-peer design. In a WORKGROUP all machines are responsible for
2295 their own security, and generally such security is limited to use of
2296 just a password (known as SHARE MORE security). In most situations
2297 with peer-to-peer networking the users who control their own machines
2298 will simply opt to have no security at all. It is possible to have
2299 USER MODE security in a WORKGROUP environment, thus requiring use
2300 of a user name and a matching password.</P
2302 >MS Windows networking is thus predetermined to use machine names
2303 for all local and remote machine message passing. The protocol used is
2304 called Server Message Block (SMB) and this is implemented using
2305 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can
2306 be encapsulated using LLC (Logical Link Control) protocol - in which case
2307 the resulting protocol is called NetBEUI (Network Basic Extended User
2308 Interface). NetBIOS can also be run over IPX (Internetworking Packet
2309 Exchange) protocol as used by Novell NetWare, and it can be run
2310 over TCP/IP protocols - in which case the resulting protocol is called
2311 NBT or NetBT, the NetBIOS over TCP/IP.</P
2313 >MS Windows machines use a complex array of name resolution mechanisms.
2314 Since we are primarily concerned with TCP/IP this demonstration is
2315 limited to this area.</P
2322 >2.3.1. The NetBIOS Name Cache</A
2325 >All MS Windows machines employ an in memory buffer in which is
2326 stored the NetBIOS names and their IP addresses for all external
2327 machines that that the local machine has communicated with over the
2328 past 10-15 minutes. It is more efficient to obtain an IP address
2329 for a machine from the local cache than it is to go through all the
2330 configured name resolution mechanisms.</P
2332 >If a machine whose name is in the local name cache has been shut
2333 down before the name had been expired and flushed from the cache, then
2334 an attempt to exchange a message with that machine will be subject
2335 to time-out delays. ie: It's name is in the cache, so a name resolution
2336 lookup will succeed, but the machine can not respond. This can be
2337 frustrating for users - but it is a characteristic of the protocol.</P
2339 >The MS Windows utility that allows examination of the NetBIOS
2340 name cache is called "nbtstat". The Samba equivalent of this
2341 is called "nmblookup".</P
2349 >2.3.2. The LMHOSTS file</A
2352 >This file is usually located in MS Windows NT 4.0 or
2355 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2357 the IP Address and the machine name in matched pairs. The
2361 > file performs NetBIOS name
2362 to IP address mapping oriented.</P
2364 >It typically looks like:</P
2373 CLASS="PROGRAMLISTING"
2374 > # Copyright (c) 1998 Microsoft Corp.
2376 # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
2377 # over TCP/IP) stack for Windows98
2379 # This file contains the mappings of IP addresses to NT computernames
2380 # (NetBIOS) names. Each entry should be kept on an individual line.
2381 # The IP address should be placed in the first column followed by the
2382 # corresponding computername. The address and the comptername
2383 # should be separated by at least one space or tab. The "#" character
2384 # is generally used to denote the start of a comment (see the exceptions
2387 # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
2388 # files and offers the following extensions:
2391 # #DOM:<domain>
2392 # #INCLUDE <filename>
2395 # \0xnn (non-printing character support)
2397 # Following any entry in the file with the characters "#PRE" will cause
2398 # the entry to be preloaded into the name cache. By default, entries are
2399 # not preloaded, but are parsed only after dynamic name resolution fails.
2401 # Following an entry with the "#DOM:<domain>" tag will associate the
2402 # entry with the domain specified by <domain>. This affects how the
2403 # browser and logon services behave in TCP/IP environments. To preload
2404 # the host name associated with #DOM entry, it is necessary to also add a
2405 # #PRE to the line. The <domain> is always preloaded although it will not
2406 # be shown when the name cache is viewed.
2408 # Specifying "#INCLUDE <filename>" will force the RFC NetBIOS (NBT)
2409 # software to seek the specified <filename> and parse it as if it were
2410 # local. <filename> is generally a UNC-based name, allowing a
2411 # centralized lmhosts file to be maintained on a server.
2412 # It is ALWAYS necessary to provide a mapping for the IP address of the
2413 # server prior to the #INCLUDE. This mapping must use the #PRE directive.
2414 # In addtion the share "public" in the example below must be in the
2415 # LanManServer list of "NullSessionShares" in order for client machines to
2416 # be able to read the lmhosts file successfully. This key is under
2417 # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
2418 # in the registry. Simply add "public" to the list found there.
2420 # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
2421 # statements to be grouped together. Any single successful include
2422 # will cause the group to succeed.
2424 # Finally, non-printing characters can be embedded in mappings by
2425 # first surrounding the NetBIOS name in quotations, then using the
2426 # \0xnn notation to specify a hex value for a non-printing character.
2428 # The following example illustrates all of these extensions:
2430 # 102.54.94.97 rhino #PRE #DOM:networking #net group's DC
2431 # 102.54.94.102 "appname \0x14" #special app server
2432 # 102.54.94.123 popular #PRE #source server
2433 # 102.54.94.117 localsrv #PRE #needed for the include
2436 # #INCLUDE \\localsrv\public\lmhosts
2437 # #INCLUDE \\rhino\public\lmhosts
2440 # In the above example, the "appname" server contains a special
2441 # character in its name, the "popular" and "localsrv" server names are
2442 # preloaded, and the "rhino" server name is specified so it can be used
2443 # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
2444 # system is unavailable.
2446 # Note that the whole file is parsed including comments on each lookup,
2447 # so keeping the number of comments to a minimum will improve performance.
2448 # Therefore it is not advisable to simply add lmhosts file entries onto the
2449 # end of this file.</PRE
2461 >2.3.3. HOSTS file</A
2464 >This file is usually located in MS Windows NT 4.0 or 2000 in
2467 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
2469 the IP Address and the IP hostname in matched pairs. It can be
2470 used by the name resolution infrastructure in MS Windows, depending
2471 on how the TCP/IP environment is configured. This file is in
2472 every way the equivalent of the Unix/Linux <TT
2483 >2.3.4. DNS Lookup</A
2486 >This capability is configured in the TCP/IP setup area in the network
2487 configuration facility. If enabled an elaborate name resolution sequence
2488 is followed the precise nature of which isdependant on what the NetBIOS
2489 Node Type parameter is configured to. A Node Type of 0 means use
2490 NetBIOS broadcast (over UDP broadcast) is first used if the name
2491 that is the subject of a name lookup is not found in the NetBIOS name
2492 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to
2493 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the
2494 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast
2503 >2.3.5. WINS Lookup</A
2506 >A WINS (Windows Internet Name Server) service is the equivaent of the
2507 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores
2508 the names and IP addresses that are registered by a Windows client
2509 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
2511 >To configure Samba to be a WINS server the following parameter needs
2512 to be added to the <TT
2524 CLASS="PROGRAMLISTING"
2525 > wins support = Yes</PRE
2531 >To configure Samba to use a WINS server the following parameters are
2532 needed in the smb.conf file:</P
2541 CLASS="PROGRAMLISTING"
2543 wins server = xxx.xxx.xxx.xxx</PRE
2555 of the WINS server.</P
2564 >2.4. How browsing functions and how to deploy stable and
2565 dependable browsing using Samba</A
2568 >As stated above, MS Windows machines register their NetBIOS names
2569 (ie: the machine name for each service type in operation) on start
2570 up. Also, as stated above, the exact method by which this name registration
2571 takes place is determined by whether or not the MS Windows client/server
2572 has been given a WINS server address, whether or not LMHOSTS lookup
2573 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
2575 >In the case where there is no WINS server all name registrations as
2576 well as name lookups are done by UDP broadcast. This isolates name
2577 resolution to the local subnet, unless LMHOSTS is used to list all
2578 names and IP addresses. In such situations Samba provides a means by
2579 which the samba server name may be forcibly injected into the browse
2580 list of a remote MS Windows network (using the "remote announce" parameter).</P
2582 >Where a WINS server is used, the MS Windows client will use UDP
2583 unicast to register with the WINS server. Such packets can be routed
2584 and thus WINS allows name resolution to function across routed networks.</P
2586 >During the startup process an election will take place to create a
2587 local master browser if one does not already exist. On each NetBIOS network
2588 one machine will be elected to function as the domain master browser. This
2589 domain browsing has nothing to do with MS security domain control.
2590 Instead, the domain master browser serves the role of contacting each local
2591 master browser (found by asking WINS or from LMHOSTS) and exchanging browse
2592 list contents. This way every master browser will eventually obtain a complete
2593 list of all machines that are on the network. Every 11-15 minutes an election
2594 is held to determine which machine will be the master browser. By nature of
2595 the election criteria used, the machine with the highest uptime, or the
2596 most senior protocol version, or other criteria, will win the election
2597 as domain master browser.</P
2599 >Clients wishing to browse the network make use of this list, but also depend
2600 on the availability of correct name resolution to the respective IP
2601 address/addresses. </P
2603 >Any configuration that breaks name resolution and/or browsing intrinsics
2604 will annoy users because they will have to put up with protracted
2605 inability to use the network services.</P
2607 >Samba supports a feature that allows forced synchonisation
2608 of browse lists across routed networks using the "remote
2609 browse sync" parameter in the smb.conf file. This causes Samba
2610 to contact the local master browser on a remote network and
2611 to request browse list synchronisation. This effectively bridges
2612 two networks that are separated by routers. The two remote
2613 networks may use either broadcast based name resolution or WINS
2614 based name resolution, but it should be noted that the "remote
2615 browse sync" parameter provides browse list synchronisation - and
2616 that is distinct from name to address resolution, in other
2617 words, for cross subnet browsing to function correctly it is
2618 essential that a name to address resolution mechanism be provided.
2619 This mechanism could be via DNS, <TT
2631 >2.5. MS Windows security options and how to configure
2632 Samba for seemless integration</A
2635 >MS Windows clients may use encrypted passwords as part of a
2636 challenege/response authentication model (a.k.a. NTLMv1) or
2637 alone, or clear text strings for simple password based
2638 authentication. It should be realized that with the SMB
2639 protocol the password is passed over the network either
2640 in plain text or encrypted, but not both in the same
2641 authentication requets.</P
2643 >When encrypted passwords are used a password that has been
2644 entered by the user is encrypted in two ways:</P
2650 >An MD4 hash of the UNICODE of the password
2651 string. This is known as the NT hash.
2656 >The password is converted to upper case,
2657 and then padded or trucated to 14 bytes. This string is
2658 then appended with 5 bytes of NULL characters and split to
2659 form two 56 bit DES keys to encrypt a "magic" 8 byte value.
2660 The resulting 16 bytes for the LanMan hash.
2665 >You should refer to the <A
2666 HREF="ENCRYPTION.html"
2668 >Password Encryption</A
2669 > chapter in this HOWTO collection
2670 for more details on the inner workings</P
2672 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x
2673 and version 4.0 pre-service pack 3 will use either mode of
2674 password authentication. All versions of MS Windows that follow
2675 these versions no longer support plain text passwords by default.</P
2677 >MS Windows clients have a habit of dropping network mappings that
2678 have been idle for 10 minutes or longer. When the user attempts to
2679 use the mapped drive connection that has been dropped the SMB protocol
2680 has a mechanism by which the connection can be re-established using
2681 a cached copy of the password.</P
2683 >When Microsoft changed the default password mode, they dropped support for
2684 caching of the plain text password. This means that when the registry
2685 parameter is changed to re-enable use of plain text passwords it appears to
2686 work, but when a dropped mapping attempts to revalidate it will fail if
2687 the remote authentication server does not support encrypted passwords.
2688 This means that it is definitely not a good idea to re-enable plain text
2689 password support in such clients.</P
2691 >The following parameters can be used to work around the
2692 issue of Windows 9x client upper casing usernames and
2693 password before transmitting them to the SMB server
2694 when using clear text authentication.</P
2703 CLASS="PROGRAMLISTING"
2705 HREF="smb.conf.5.html#PASSWORDLEVEL"
2715 HREF="smb.conf.5.html#USERNAMELEVEL"
2729 >By default Samba will lower case the username before attempting
2730 to lookup the user in the database of local system accounts.
2731 Because UNIX usernames conventionally only contain lower case
2738 is rarely even needed.</P
2740 >However, password on UNIX systems often make use of mixed case
2741 characters. This means that in order for a user on a Windows 9x
2742 client to connect to a Samba server using clear text authentication,
2748 > must be set to the maximum
2749 number of upper case letter which <EM
2752 is a password. Note that is the server OS uses the traditional
2753 DES version of crypt(), then a <TT
2759 of 8 will result in case insensitive passwords as seen from Windows
2760 users. This will also result in longer login times as Samba
2761 hash to compute the permutations of the password string and
2762 try them one by one until a match is located (or all combinations fail).</P
2764 >The best option to adopt is to enable support for encrypted passwords
2765 where ever Samba is used. There are three configuration possibilities
2766 for support of encrypted passwords:</P
2773 >2.5.1. Use MS Windows NT as an authentication server</A
2776 >This method involves the additions of the following parameters
2777 in the smb.conf file:</P
2786 CLASS="PROGRAMLISTING"
2787 > encrypt passwords = Yes
2789 password server = "NetBIOS_name_of_PDC"</PRE
2795 >There are two ways of identifying whether or not a username and
2796 password pair was valid or not. One uses the reply information provided
2797 as part of the authentication messaging process, the other uses
2798 just and error code.</P
2800 >The down-side of this mode of configuration is the fact that
2801 for security reasons Samba will send the password server a bogus
2802 username and a bogus password and if the remote server fails to
2803 reject the username and password pair then an alternative mode
2804 of identification of validation is used. Where a site uses password
2805 lock out after a certain number of failed authentication attempts
2806 this will result in user lockouts.</P
2808 >Use of this mode of authentication does require there to be
2809 a standard Unix account for the user, this account can be blocked
2810 to prevent logons by other than MS Windows clients.</P
2818 >2.5.2. Make Samba a member of an MS Windows NT security domain</A
2821 >This method involves additon of the following paramters in the smb.conf file:</P
2830 CLASS="PROGRAMLISTING"
2831 > encrypt passwords = Yes
2833 workgroup = "name of NT domain"
2834 password server = *</PRE
2840 >The use of the "*" argument to "password server" will cause samba
2841 to locate the domain controller in a way analogous to the way
2842 this is done within MS Windows NT.</P
2844 >In order for this method to work the Samba server needs to join the
2845 MS Windows NT security domain. This is done as follows:</P
2851 >On the MS Windows NT domain controller using
2852 the Server Manager add a machine account for the Samba server.
2857 >Next, on the Linux system execute:
2860 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
2866 >Use of this mode of authentication does require there to be
2867 a standard Unix account for the user in order to assign
2868 a uid once the account has been authenticated by the remote
2869 Windows DC. This account can be blocked to prevent logons by
2870 other than MS Windows clients by things such as setting an invalid
2876 >An alternative to assigning UIDs to Windows users on a
2877 Samba member server is presented in the <A
2880 >Winbind Overview</A
2882 this HOWTO collection.</P
2890 >2.5.3. Configure Samba as an authentication server</A
2893 >This mode of authentication demands that there be on the
2894 Unix/Linux system both a Unix style account as well as and
2895 smbpasswd entry for the user. The Unix system account can be
2896 locked if required as only the encrypted password will be
2897 used for SMB client authentication.</P
2899 >This method involves addition of the following parameters to
2900 the smb.conf file:</P
2909 CLASS="PROGRAMLISTING"
2910 >## please refer to the Samba PDC HOWTO chapter later in
2911 ## this collection for more details
2913 encrypt passwords = Yes
2916 ; an OS level of 33 or more is recommended
2920 path = /somewhare/in/file/system
2921 read only = yes</PRE
2927 >in order for this method to work a Unix system account needs
2928 to be created for each user, as well as for each MS Windows NT/2000
2929 machine. The following structure is required.</P
2939 >A user account that may provide a home directory should be
2940 created. The following Linux system commands are typical of
2941 the procedure for creating an account.</P
2950 CLASS="PROGRAMLISTING"
2951 > # useradd -s /bin/bash -d /home/"userid" -m "userid"
2953 Enter Password: <pw>
2955 # smbpasswd -a "userid"
2956 Enter Password: <pw></PRE
2968 >2.5.3.2. MS Windows NT Machine Accounts</A
2971 >These are required only when Samba is used as a domain
2972 controller. Refer to the Samba-PDC-HOWTO for more details.</P
2981 CLASS="PROGRAMLISTING"
2982 > # useradd -s /bin/false -d /dev/null "machine_name"\$
2983 # passwd -l "machine_name"\$
2984 # smbpasswd -a -m "machine_name"</PRE
2998 >2.6. Conclusions</A
3001 >Samba provides a flexible means to operate as...</P
3007 >A Stand-alone server - No special action is needed
3008 other than to create user accounts. Stand-alone servers do NOT
3009 provide network logon services, meaning that machines that use this
3010 server do NOT perform a domain logon but instead make use only of
3011 the MS Windows logon which is local to the MS Windows
3017 >An MS Windows NT 3.x/4.0 security domain member.
3022 >An alternative to an MS Windows NT 3.x/4.0
3034 >Chapter 3. Configuring PAM for distributed but centrally
3035 managed authentication</A
3043 >3.1. Samba and PAM</A
3046 >A number of Unix systems (eg: Sun Solaris), as well as the
3047 xxxxBSD family and Linux, now utilize the Pluggable Authentication
3048 Modules (PAM) facility to provide all authentication,
3049 authorization and resource control services. Prior to the
3050 introduction of PAM, a decision to use an alternative to
3051 the system password database (<TT
3055 would require the provision of alternatives for all programs that provide
3056 security services. Such a choice would involve provision of
3057 alternatives to such programs as: <B
3069 >PAM provides a mechanism that disconnects these security programs
3070 from the underlying authentication/authorization infrastructure.
3071 PAM is configured either through one file <TT
3075 or by editing individual files that are located in <TT
3080 >The following is an example <TT
3082 >/etc/pam.d/login</TT
3083 > configuration file.
3084 This example had all options been uncommented is probably not usable
3085 as it stacks many conditions before allowing successful completion
3086 of the login process. Essentially all conditions can be disabled
3087 by commenting them out except the calls to <TT
3099 CLASS="PROGRAMLISTING"
3101 # The PAM configuration file for the `login' service
3103 auth required pam_securetty.so
3104 auth required pam_nologin.so
3105 # auth required pam_dialup.so
3106 # auth optional pam_mail.so
3107 auth required pam_pwdb.so shadow md5
3108 # account requisite pam_time.so
3109 account required pam_pwdb.so
3110 session required pam_pwdb.so
3111 # session optional pam_lastlog.so
3112 # password required pam_cracklib.so retry=3
3113 password required pam_pwdb.so shadow md5</PRE
3119 >PAM allows use of replacable modules. Those available on a
3120 sample system include:</P
3129 CLASS="PROGRAMLISTING"
3130 >$ /bin/ls /lib/security
3131 pam_access.so pam_ftp.so pam_limits.so
3132 pam_ncp_auth.so pam_rhosts_auth.so pam_stress.so
3133 pam_cracklib.so pam_group.so pam_listfile.so
3134 pam_nologin.so pam_rootok.so pam_tally.so
3135 pam_deny.so pam_issue.so pam_mail.so
3136 pam_permit.so pam_securetty.so pam_time.so
3137 pam_dialup.so pam_lastlog.so pam_mkhomedir.so
3138 pam_pwdb.so pam_shells.so pam_unix.so
3139 pam_env.so pam_ldap.so pam_motd.so
3140 pam_radius.so pam_smbpass.so pam_unix_acct.so
3141 pam_wheel.so pam_unix_auth.so pam_unix_passwd.so
3142 pam_userdb.so pam_warn.so pam_unix_session.so</PRE
3148 >The following example for the login program replaces the use of
3152 > module which uses the system
3153 password database (<TT
3167 > which uses the Samba
3168 database which contains the Microsoft MD4 encrypted password
3169 hashes. This database is stored in either
3172 >/usr/local/samba/private/smbpasswd</TT
3176 >/etc/samba/smbpasswd</TT
3180 >/etc/samba.d/smbpasswd</TT
3182 Samba implementation for your Unix/Linux system. The
3186 > module is provided by
3187 Samba version 2.2.1 or later. It can be compiled by specifying the
3190 >--with-pam_smbpass</B
3191 > options when running Samba's
3195 > script. For more information
3199 > module, see the documentation
3202 >source/pam_smbpass</TT
3203 > directory of the Samba
3204 source distribution.</P
3213 CLASS="PROGRAMLISTING"
3215 # The PAM configuration file for the `login' service
3217 auth required pam_smbpass.so nodelay
3218 account required pam_smbpass.so nodelay
3219 session required pam_smbpass.so nodelay
3220 password required pam_smbpass.so nodelay</PRE
3226 >The following is the PAM configuration file for a particular
3227 Linux system. The default condition uses <TT
3239 CLASS="PROGRAMLISTING"
3241 # The PAM configuration file for the `samba' service
3243 auth required /lib/security/pam_pwdb.so nullok nodelay shadow audit
3244 account required /lib/security/pam_pwdb.so audit nodelay
3245 session required /lib/security/pam_pwdb.so nodelay
3246 password required /lib/security/pam_pwdb.so shadow md5</PRE
3252 >In the following example the decision has been made to use the
3253 smbpasswd database even for basic samba authentication. Such a
3254 decision could also be made for the passwd program and would
3255 thus allow the smbpasswd passwords to be changed using the passwd
3265 CLASS="PROGRAMLISTING"
3267 # The PAM configuration file for the `samba' service
3269 auth required /lib/security/pam_smbpass.so nodelay
3270 account required /lib/security/pam_pwdb.so audit nodelay
3271 session required /lib/security/pam_pwdb.so nodelay
3272 password required /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf</PRE
3278 >Note: PAM allows stacking of authentication mechanisms. It is
3279 also possible to pass information obtained within on PAM module through
3280 to the next module in the PAM stack. Please refer to the documentation for
3281 your particular system implementation for details regarding the specific
3282 capabilities of PAM in this environment. Some Linux implmentations also
3286 > module that allows all
3287 authentication to be configured in a single central file. The
3291 > method has some very devoted followers
3292 on the basis that it allows for easier administration. As with all issues in
3293 life though, every decision makes trade-offs, so you may want examine the
3294 PAM documentation for further helpful information.</P
3302 >3.2. Distributed Authentication</A
3305 >The astute administrator will realize from this that the
3318 HREF="http://rsync.samba.org/"
3320 >http://rsync.samba.org/</A
3322 will allow the establishment of a centrally managed, distributed
3323 user/password database that can also be used by all
3324 PAM (eg: Linux) aware programs and applications. This arrangement
3325 can have particularly potent advantages compared with the
3326 use of Microsoft Active Directory Service (ADS) in so far as
3327 reduction of wide area network authentication traffic.</P
3335 >3.3. PAM Configuration in smb.conf</A
3338 >There is an option in smb.conf called <A
3339 HREF="smb.conf.5.html#OBEYPAMRESTRICTIONS"
3341 >obey pam restrictions</A
3343 The following is from the on-line help for this option in SWAT;</P
3345 >When Samba 2.2 is configure to enable PAM support (i.e.
3349 >), this parameter will
3350 control whether or not Samba should obey PAM's account
3351 and session management directives. The default behavior
3352 is to use PAM for clear text authentication only and to
3353 ignore any account or session management. Note that Samba always
3354 ignores PAM for authentication in the case of
3356 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
3358 >encrypt passwords = yes</A
3360 The reason is that PAM modules cannot support the challenge/response
3361 authentication mechanism needed in the presence of SMB
3362 password encryption. </P
3366 >obey pam restrictions = no</B
3375 >Chapter 4. Hosting a Microsoft Distributed File System tree on Samba</A
3383 >4.1. Instructions</A
3386 >The Distributed File System (or Dfs) provides a means of
3387 separating the logical view of files and directories that users
3388 see from the actual physical locations of these resources on the
3389 network. It allows for higher availability, smoother storage expansion,
3390 load balancing etc. For more information about Dfs, refer to <A
3391 HREF="http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
3393 > Microsoft documentation</A
3396 >This document explains how to host a Dfs tree on a Unix
3397 machine (for Dfs-aware clients to browse) using Samba.</P
3399 >To enable SMB-based DFS for Samba, configure it with the
3405 > option. Once built, a
3406 Samba server can be made a Dfs server by setting the global
3408 HREF="smb.conf.5.html#HOSTMSDFS"
3416 > parameter in the <TT
3420 > file. You designate a share as a Dfs root using the share
3422 HREF="smb.conf.5.html#MSDFSROOT"
3430 > parameter. A Dfs root directory on
3431 Samba hosts Dfs links in the form of symbolic links that point
3432 to other servers. For example, a symbolic link
3435 >junction->msdfs:storage1\share1</TT
3437 the share directory acts as the Dfs junction. When Dfs-aware
3438 clients attempt to access the junction link, they are redirected
3439 to the storage location (in this case, \\storage1\share1).</P
3441 >Dfs trees on Samba work with all Dfs-aware clients ranging
3442 from Windows 95 to 2000.</P
3444 >Here's an example of setting up a Dfs tree on a Samba
3454 CLASS="PROGRAMLISTING"
3455 ># The smb.conf file:
3457 netbios name = SAMBA
3461 path = /export/dfsroot
3469 >In the /export/dfsroot directory we set up our dfs links to
3470 other servers on the network.</P
3478 >cd /export/dfsroot</B
3488 >chown root /export/dfsroot</B
3498 >chmod 755 /export/dfsroot</B
3508 >ln -s msdfs:storageA\\shareA linka</B
3518 >ln -s msdfs:serverB\\share,serverC\\share linkb</B
3522 >You should set up the permissions and ownership of
3523 the directory acting as the Dfs root such that only designated
3524 users can create, delete or modify the msdfs links. Also note
3525 that symlink names should be all lowercase. This limitation exists
3526 to have Samba avoid trying all the case combinations to get at
3527 the link name. Finally set up the symbolic links to point to the
3528 network shares you want, and start Samba.</P
3530 >Users on Dfs-aware clients can now browse the Dfs tree
3531 on the Samba server at \\samba\dfs. Accessing
3532 links linka or linkb (which appear as directories to the client)
3533 takes users directly to the appropriate shares on the network.</P
3547 >Windows clients need to be rebooted
3548 if a previously mounted non-dfs share is made a dfs
3549 root or vice versa. A better way is to introduce a
3550 new share and make it the dfs root.</P
3554 >Currently there's a restriction that msdfs
3555 symlink names should all be lowercase.</P
3559 >For security purposes, the directory
3560 acting as the root of the Dfs tree should have ownership
3561 and permissions set so that only designated users can
3562 modify the symbolic links in the directory.</P
3572 NAME="UNIX-PERMISSIONS"
3573 >Chapter 5. UNIX Permission Bits and Windows NT Access Control Lists</A
3581 >5.1. Viewing and changing UNIX permissions using the NT
3585 >New in the Samba 2.0.4 release is the ability for Windows
3586 NT clients to use their native security settings dialog box to
3587 view and modify the underlying UNIX permissions.</P
3589 >Note that this ability is careful not to compromise
3590 the security of the UNIX host Samba is running on, and
3591 still obeys all the file permission rules that a Samba
3592 administrator can set.</P
3594 >In Samba 2.0.4 and above the default value of the
3596 HREF="smb.conf.5.html#NTACLSUPPORT"
3604 > has been changed from
3612 manipulation of permissions is turned on by default.</P
3620 >5.2. How to view file security on a Samba share</A
3623 >From an NT 4.0 client, single-click with the right
3624 mouse button on any file or directory in a Samba mounted
3625 drive letter or UNC path. When the menu pops-up, click
3628 > entry at the bottom of
3629 the menu. This brings up the normal file properties dialog
3630 box, but with Samba 2.0.4 this will have a new tab along the top
3633 >. Click on this tab and you
3634 will see three buttons, <EM
3644 > button will cause either
3645 an error message <SPAN
3647 >A requested privilege is not held
3649 > to appear if the user is not the
3650 NT Administrator, or a dialog which is intended to allow an
3651 Administrator to add auditing requirements to a file if the
3652 user is logged on as the NT Administrator. This dialog is
3653 non-functional with a Samba share at this time, as the only
3654 useful button, the <B
3657 > button will not currently
3658 allow a list of users to be seen.</P
3666 >5.3. Viewing file ownership</A
3673 brings up a dialog box telling you who owns the given file. The
3674 owner name will be of the form :</P
3678 >"SERVER\user (Long name)"</B
3686 > is the NetBIOS name of
3687 the Samba server, <TT
3692 > is the user name of
3693 the UNIX user who owns the file, and <TT
3699 is the descriptive string identifying the user (normally found in the
3700 GECOS field of the UNIX password database). Click on the <B
3704 > button to remove this dialog.</P
3706 >If the parameter <TT
3715 > then the file owner will
3716 be shown as the NT user <B
3724 > button will not allow
3725 you to change the ownership of this file to yourself (clicking on
3726 it will display a dialog box complaining that the user you are
3727 currently logged onto the NT client cannot be found). The reason
3728 for this is that changing the ownership of a file is a privileged
3729 operation in UNIX, available only to the <EM
3732 user. As clicking on this button causes NT to attempt to change
3733 the ownership of a file to the current user logged into the NT
3734 client this will not work with Samba at this time.</P
3736 >There is an NT chown command that will work with Samba
3737 and allow a user with Administrator privilege connected
3738 to a Samba 2.0.4 server as root to change the ownership of
3739 files on both a local NTFS filesystem or remote mounted NTFS
3740 or Samba drive. This is available as part of the <EM
3743 > NT security library written by Jeremy Allison of
3744 the Samba Team, available from the main Samba ftp site.</P
3752 >5.4. Viewing file or directory permissions</A
3755 >The third button is the <B
3759 button. Clicking on this brings up a dialog box that shows both
3760 the permissions and the UNIX owner of the file or directory.
3761 The owner is displayed in the form :</P
3765 >"SERVER\user (Long name)"</B
3773 > is the NetBIOS name of
3774 the Samba server, <TT
3779 > is the user name of
3780 the UNIX user who owns the file, and <TT
3786 is the descriptive string identifying the user (normally found in the
3787 GECOS field of the UNIX password database).</P
3789 >If the parameter <TT
3798 > then the file owner will
3799 be shown as the NT user <B
3803 permissions will be shown as NT "Full Control".</P
3805 >The permissions field is displayed differently for files
3806 and directories, so I'll describe the way file permissions
3807 are displayed first.</P
3814 >5.4.1. File Permissions</A
3817 >The standard UNIX user/group/world triple and
3818 the corresponding "read", "write", "execute" permissions
3819 triples are mapped by Samba into a three element NT ACL
3820 with the 'r', 'w', and 'x' bits mapped into the corresponding
3821 NT permissions. The UNIX world permissions are mapped into
3822 the global NT group <B
3826 by the list of permissions allowed for UNIX world. The UNIX
3827 owner and group permissions are displayed as an NT
3835 > icon respectively followed by the list
3836 of permissions allowed for the UNIX user and group.</P
3838 >As many UNIX permission sets don't map into common
3849 usually the permissions will be prefixed by the words <B
3851 > "Special Access"</B
3852 > in the NT display list.</P
3854 >But what happens if the file has no permissions allowed
3855 for a particular UNIX user group or world component ? In order
3856 to allow "no permissions" to be seen and modified then Samba
3859 >"Take Ownership"</B
3861 (which has no meaning in UNIX) and reports a component with
3862 no permissions as having the NT <B
3866 This was chosen of course to make it look like a zero, meaning
3867 zero permissions. More details on the decision behind this will
3876 >5.4.2. Directory Permissions</A
3879 >Directories on an NT NTFS file system have two
3880 different sets of permissions. The first set of permissions
3881 is the ACL set on the directory itself, this is usually displayed
3882 in the first set of parentheses in the normal <B
3886 NT style. This first set of permissions is created by Samba in
3887 exactly the same way as normal file permissions are, described
3888 above, and is displayed in the same way.</P
3890 >The second set of directory permissions has no real meaning
3891 in the UNIX permissions world and represents the <B
3894 > permissions that any file created within
3895 this directory would inherit.</P
3897 >Samba synthesises these inherited permissions for NT by
3898 returning as an NT ACL the UNIX permission mode that a new file
3899 created by Samba on this share would receive.</P
3908 >5.5. Modifying file or directory permissions</A
3911 >Modifying file and directory permissions is as simple
3912 as changing the displayed permissions in the dialog box, and
3916 > button. However, there are
3917 limitations that a user needs to be aware of, and also interactions
3918 with the standard Samba permission masks and mapping of DOS
3919 attributes that need to also be taken into account.</P
3921 >If the parameter <TT
3930 > then any attempt to set
3931 security permissions will fail with an <B
3937 >The first thing to note is that the <B
3941 button will not return a list of users in Samba 2.0.4 (it will give
3942 an error message of <B
3944 >"The remote procedure call failed
3945 and did not execute"</B
3946 >). This means that you can only
3947 manipulate the current user/group/world permissions listed in
3948 the dialog box. This actually works quite well as these are the
3949 only permissions that UNIX actually has.</P
3951 >If a permission triple (either user, group, or world)
3952 is removed from the list of permissions in the NT dialog box,
3956 > button is pressed it will
3957 be applied as "no permissions" on the UNIX side. If you then
3958 view the permissions again the "no permissions" entry will appear
3962 > flag, as described above. This
3963 allows you to add permissions back to a file or directory once
3964 you have removed them from a triple component.</P
3966 >As UNIX supports only the "r", "w" and "x" bits of
3967 an NT ACL then if other NT security attributes such as "Delete
3968 access" are selected then they will be ignored when applied on
3969 the Samba server.</P
3971 >When setting permissions on a directory the second
3972 set of permissions (in the second set of parentheses) is
3973 by default applied to all files within that directory. If this
3974 is not what you want you must uncheck the <B
3977 permissions on existing files"</B
3978 > checkbox in the NT
3979 dialog before clicking <B
3984 >If you wish to remove all permissions from a
3985 user/group/world component then you may either highlight the
3986 component and click the <B
3990 or set the component to only have the special <B
3994 > permission (displayed as <B
4006 >5.6. Interaction with the standard Samba create mask
4010 >Note that with Samba 2.0.5 there are four new parameters
4011 to control this interaction. These are :</P
4023 >force security mode</I
4030 >directory security mask</I
4037 >force directory security mode</I
4041 >Once a user clicks <B
4045 permissions Samba maps the given permissions into a user/group/world
4046 r/w/x triple set, and then will check the changed permissions for a
4047 file against the bits set in the <A
4048 HREF="smb.conf.5.html#SECURITYMASK"
4057 > parameter. Any bits that
4058 were changed that are not set to '1' in this parameter are left alone
4059 in the file permissions.</P
4061 >Essentially, zero bits in the <TT
4067 mask may be treated as a set of bits the user is <EM
4070 allowed to change, and one bits are those the user is allowed to change.
4073 >If not set explicitly this parameter is set to the same value as
4075 HREF="smb.conf.5.html#CREATEMASK"
4084 > parameter to provide compatibility with Samba 2.0.4
4085 where this permission change facility was introduced. To allow a user to
4086 modify all the user/group/world permissions on a file, set this parameter
4089 >Next Samba checks the changed permissions for a file against
4090 the bits set in the <A
4091 HREF="smb.conf.5.html#FORCESECURITYMODE"
4096 >force security mode</I
4099 > parameter. Any bits
4100 that were changed that correspond to bits set to '1' in this parameter
4101 are forced to be set.</P
4103 >Essentially, bits set in the <TT
4106 >force security mode
4109 > parameter may be treated as a set of bits that, when
4110 modifying security on a file, the user has always set to be 'on'.</P
4112 >If not set explicitly this parameter is set to the same value
4114 HREF="smb.conf.5.html#FORCECREATEMODE"
4123 > parameter to provide compatibility
4124 with Samba 2.0.4 where the permission change facility was introduced.
4125 To allow a user to modify all the user/group/world permissions on a file
4126 with no restrictions set this parameter to 000.</P
4139 > parameters are applied to the change
4140 request in that order.</P
4142 >For a directory Samba will perform the same operations as
4143 described above for a file except using the parameter <TT
4146 > directory security mask</I
4157 >force directory security mode
4160 > parameter instead of <TT
4163 >force security mode
4171 >directory security mask</I
4174 by default is set to the same value as the <TT
4180 > parameter and the <TT
4183 >force directory security
4186 > parameter by default is set to the same value as
4190 >force directory mode</I
4192 > parameter to provide
4193 compatibility with Samba 2.0.4 where the permission change facility
4196 >In this way Samba enforces the permission restrictions that
4197 an administrator can set on a Samba share, whilst still allowing users
4198 to modify the permission bits within that restriction.</P
4200 >If you want to set up a share that allows users full control
4201 in modifying the permission bits on their files and directories and
4202 doesn't force any particular bits to be set 'on', then set the following
4203 parameters in the <A
4204 HREF="smb.conf.5.html"
4211 > file in that share specific section :</P
4216 >security mask = 0777</I
4223 >force security mode = 0</I
4230 >directory security mask = 0777</I
4237 >force directory security mode = 0</I
4241 >As described, in Samba 2.0.4 the parameters :</P
4253 >force create mode</I
4267 >force directory mode</I
4271 >were used instead of the parameters discussed here.</P
4279 >5.7. Interaction with the standard Samba file attribute
4283 >Samba maps some of the DOS attribute bits (such as "read
4284 only") into the UNIX permissions of a file. This means there can
4285 be a conflict between the permission bits set via the security
4286 dialog and the permission bits set by the file attribute mapping.
4289 >One way this can show up is if a file has no UNIX read access
4290 for the owner it will show up as "read only" in the standard
4291 file attributes tabbed dialog. Unfortunately this dialog is
4292 the same one that contains the security info in another tab.</P
4294 >What this can mean is that if the owner changes the permissions
4295 to allow themselves read access using the security dialog, clicks
4299 > to get back to the standard attributes tab
4300 dialog, and then clicks <B
4303 > on that dialog, then
4304 NT will set the file permissions back to read-only (as that is what
4305 the attributes still say in the dialog). This means that after setting
4306 permissions and clicking <B
4309 > to get back to the
4310 attributes dialog you should always hit <B
4317 > to ensure that your changes
4318 are not overridden.</P
4326 >Chapter 6. Printing Support in Samba 2.2.x</A
4334 >6.1. Introduction</A
4337 >Beginning with the 2.2.0 release, Samba supports
4338 the native Windows NT printing mechanisms implemented via
4339 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
4340 Samba only supported LanMan printing calls.</P
4342 >The additional functionality provided by the new
4343 SPOOLSS support includes:</P
4349 >Support for downloading printer driver
4350 files to Windows 95/98/NT/2000 clients upon demand.
4355 >Uploading of printer drivers via the
4356 Windows NT Add Printer Wizard (APW) or the
4357 Imprints tool set (refer to <A
4358 HREF="http://imprints.sourceforge.net"
4360 >http://imprints.sourceforge.net</A
4366 >Support for the native MS-RPC printing
4367 calls such as StartDocPrinter, EnumJobs(), etc... (See
4368 the MSDN documentation at <A
4369 HREF="http://msdn.microsoft.com/"
4371 >http://msdn.microsoft.com/</A
4373 for more information on the Win32 printing API)
4378 >Support for NT Access Control Lists (ACL)
4379 on printer objects</P
4383 >Improved support for printer queue manipulation
4384 through the use of an internal databases for spooled job
4389 >There has been some initial confusion about what all this means
4390 and whether or not it is a requirement for printer drivers to be
4391 installed on a Samba host in order to support printing from Windows
4392 clients. A bug existed in Samba 2.2.0 which made Windows NT/2000 clients
4393 require that the Samba server possess a valid driver for the printer.
4394 This is fixed in Samba 2.2.1 and once again, Windows NT/2000 clients
4395 can use the local APW for installing drivers to be used with a Samba
4396 served printer. This is the same behavior exhibited by Windows 9x clients.
4397 As a side note, Samba does not use these drivers in any way to process
4398 spooled files. They are utilized entirely by the clients.</P
4400 >The following MS KB article, may be of some help if you are dealing with
4401 Windows 2000 clients: <EM
4402 >How to Add Printers with No User
4403 Interaction in Windows 2000</EM
4407 HREF="http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
4409 >http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP</A
4418 >6.2. Configuration</A
4432 >[print$] vs. [printer$]</B
4439 >Previous versions of Samba recommended using a share named [printer$].
4440 This name was taken from the printer$ service created by Windows 9x
4441 clients when a printer was shared. Windows 9x printer servers always have
4442 a printer$ service which provides read-only access via no
4443 password in order to support printer driver downloads.</P
4445 >However, the initial implementation allowed for a
4449 >printer driver location</I
4452 to be used on a per share basis to specify the location of
4453 the driver files associated with that printer. Another
4460 a means of defining the printer driver name to be sent to
4463 >These parameters, including <TT
4469 > parameter, are being depreciated and should not
4470 be used in new installations. For more information on this change,
4471 you should refer to the <A
4473 >Migration section</A
4475 of this document.</P
4486 >6.2.1. Creating [print$]</A
4489 >In order to support the uploading of printer driver
4490 files, you must first configure a file share named [print$].
4491 The name of this share is hard coded in Samba's internals so
4492 the name is very important (print$ is the service used by
4493 Windows NT print servers to provide support for printer driver
4496 >You should modify the server's smb.conf file to add the global
4497 parameters and to create the
4498 following file share (of course, some of the parameter values,
4499 such as 'path' are arbitrary and should be replaced with
4500 appropriate values for your site):</P
4509 CLASS="PROGRAMLISTING"
4511 ; members of the ntadmin group should be able
4512 ; to add drivers and set printer properties
4513 ; root is implicitly a 'printer admin'
4514 printer admin = @ntadmin
4517 path = /usr/local/samba/printers
4521 ; since this share is configured as read only, then we need
4522 ; a 'write list'. Check the file system permissions to make
4523 ; sure this account can copy files to the share. If this
4524 ; is setup to a non-root account, then it should also exist
4525 ; as a 'printer admin'
4526 write list = @ntadmin,root</PRE
4533 HREF="smb.conf.5.html#WRITELIST"
4541 > is used to allow administrative
4542 level user accounts to have write access in order to update files
4543 on the share. See the <A
4544 HREF="smb.conf.5.html"
4548 > for more information on configuring file shares.</P
4550 >The requirement for <A
4551 HREF="smb.conf.5.html#GUESTOK"
4558 > depends upon how your
4559 site is configured. If users will be guaranteed to have
4560 an account on the Samba host, then this is a non-issue.</P
4568 >The non-issue is that if all your Windows NT users are guaranteed to be
4569 authenticated by the Samba server (such as a domain member server and the NT
4570 user has already been validated by the Domain Controller in
4571 order to logon to the Windows NT console), then guest access
4572 is not necessary. Of course, in a workgroup environment where
4573 you just want to be able to print without worrying about
4574 silly accounts and security, then configure the share for
4575 guest access. You'll probably want to add <A
4576 HREF="smb.conf.5.html#MAPTOGUEST"
4580 >map to guest = Bad User</B
4582 > in the [global] section as well. Make sure
4583 you understand what this parameter does before using it
4588 >In order for a Windows NT print server to support
4589 the downloading of driver files by multiple client architectures,
4590 it must create subdirectories within the [print$] service
4591 which correspond to each of the supported client architectures.
4592 Samba follows this model as well.</P
4594 >Next create the directory tree below the [print$] share
4595 for each architecture you wish to support.</P
4604 CLASS="PROGRAMLISTING"
4606 |-W32X86 ; "Windows NT x86"
4607 |-WIN40 ; "Windows 95/98"
4608 |-W32ALPHA ; "Windows NT Alpha_AXP"
4609 |-W32MIPS ; "Windows NT R4000"
4610 |-W32PPC ; "Windows NT PowerPC"</PRE
4627 >ATTENTION! REQUIRED PERMISSIONS</B
4634 >In order to currently add a new driver to you Samba host,
4635 one of two conditions must hold true:</P
4641 >The account used to connect to the Samba host
4642 must have a uid of 0 (i.e. a root account)</P
4646 >The account used to connect to the Samba host
4647 must be a member of the <A
4648 HREF="smb.conf.5.html#PRINTERADMIN"
4661 >Of course, the connected account must still possess access
4662 to add files to the subdirectories beneath [print$]. Remember
4663 that all file shares are set to 'read only' by default.</P
4669 >Once you have created the required [print$] service and
4670 associated subdirectories, simply log onto the Samba server using
4677 from a Windows NT 4.0/2k client. Open "Network Neighbourhood" or
4678 "My Network Places" and browse for the Samba host. Once you have located
4679 the server, navigate to the "Printers..." folder.
4680 You should see an initial listing of printers
4681 that matches the printer shares defined on your Samba host.</P
4689 >6.2.2. Setting Drivers for Existing Printers</A
4692 >The initial listing of printers in the Samba host's
4693 Printers folder will have no real printer driver assigned
4694 to them. By default, in Samba 2.2.0 this driver name was set to
4696 >NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</EM
4698 Later versions changed this to a NULL string to allow the use
4699 tof the local Add Printer Wizard on NT/2000 clients.
4700 Attempting to view the printer properties for a printer
4701 which has this default driver assigned will result in
4702 the error message:</P
4705 >Device settings cannot be displayed. The driver
4706 for the specified printer is not installed, only spooler
4707 properties will be displayed. Do you want to install the
4711 >Click "No" in the error dialog and you will be presented with
4712 the printer properties window. The way assign a driver to a
4713 printer is to either</P
4719 >Use the "New Driver..." button to install
4720 a new printer driver, or</P
4724 >Select a driver from the popup list of
4725 installed drivers. Initially this list will be empty.</P
4729 >If you wish to install printer drivers for client
4730 operating systems other than "Windows NT x86", you will need
4731 to use the "Sharing" tab of the printer properties dialog.</P
4733 >Assuming you have connected with a root account, you
4734 will also be able modify other printer properties such as
4735 ACLs and device settings using this dialog box.</P
4737 >A few closing comments for this section, it is possible
4738 on a Windows NT print server to have printers
4739 listed in the Printers folder which are not shared. Samba does
4740 not make this distinction. By definition, the only printers of
4741 which Samba is aware are those which are specified as shares in
4747 >Another interesting side note is that Windows NT clients do
4748 not use the SMB printer share, but rather can print directly
4749 to any printer on another Windows NT host using MS-RPC. This
4750 of course assumes that the printing client has the necessary
4751 privileges on the remote host serving the printer. The default
4752 permissions assigned by Windows NT to a printer gives the "Print"
4753 permissions to the "Everyone" well-known group.</P
4761 >6.2.3. Support a large number of printers</A
4764 >One issue that has arisen during the development
4765 phase of Samba 2.2 is the need to support driver downloads for
4766 100's of printers. Using the Windows NT APW is somewhat
4767 awkward to say the list. If more than one printer are using the
4769 HREF="rpcclient.1.html"
4774 setdriver command</B
4776 > can be used to set the driver
4777 associated with an installed driver. The following is example
4778 of how this could be accomplished:</P
4787 CLASS="PROGRAMLISTING"
4792 >rpcclient pogo -U root%secret -c "enumdrivers"
4793 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4796 Printer Driver Info 1:
4797 Driver Name: [HP LaserJet 4000 Series PS]
4799 Printer Driver Info 1:
4800 Driver Name: [HP LaserJet 2100 Series PS]
4802 Printer Driver Info 1:
4803 Driver Name: [HP LaserJet 4Si/4SiMX PS]
4808 >rpcclient pogo -U root%secret -c "enumprinters"
4809 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4811 name:[\\POGO\hp-print]
4812 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
4818 >rpcclient pogo -U root%secret \
4822 > -c "setdriver hp-print \"HP LaserJet 4000 Series PS\""
4823 Domain=[NARNIA] OS=[Unix] Server=[Samba 2.2.0-alpha3]
4824 Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE
4836 >6.2.4. Adding New Printers via the Windows NT APW</A
4839 >By default, Samba offers all printer shares defined in <TT
4843 in the "Printers..." folder. Also existing in this folder is the Windows NT
4844 Add Printer Wizard icon. The APW will be show only if</P
4850 >The connected user is able to successfully
4851 execute an OpenPrinterEx(\\server) with administrative
4852 privileges (i.e. root or <TT
4863 HREF="smb.conf.5.html#SHOWADDPRINTERWIZARD"
4869 add printer wizard = yes</I
4877 >In order to be able to use the APW to successfully add a printer to a Samba
4879 HREF="smb.conf.5.html#ADDPRINTERCOMMAND"
4888 > must have a defined value. The program
4889 hook must successfully add the printer to the system (i.e.
4893 > or appropriate files) and
4899 >When using the APW from a client, if the named printer share does
4903 > will execute the <TT
4909 > and reparse to the <TT
4913 to attempt to locate the new printer share. If the share is still not defined,
4914 an error of "Access Denied" is returned to the client. Note that the
4918 >add printer program</I
4920 > is executed under the context
4921 of the connected user, not necessarily a root account.</P
4923 >There is a complementing <A
4924 HREF="smb.conf.5.html#DELETEPRINTERCOMMAND"
4933 > for removing entries from the "Printers..."
4942 >6.2.5. Samba and Printer Ports</A
4945 >Windows NT/2000 print servers associate a port with each printer. These normally
4946 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
4947 concept of ports associated with a printer. By default, only one printer port,
4948 named "Samba Printer Port", exists on a system. Samba does not really a port in
4949 order to print, rather it is a requirement of Windows clients. </P
4951 >Note that Samba does not support the concept of "Printer Pooling" internally
4952 either. This is when a logical printer is assigned to multiple ports as
4953 a form of load balancing or fail over.</P
4955 >If you require that multiple ports be defined for some reason,
4960 HREF="smb.conf.5.html#ENUMPORTSCOMMAND"
4969 > which can be used to define an external program
4970 that generates a listing of ports on a system.</P
4979 >6.3. The Imprints Toolset</A
4982 >The Imprints tool set provides a UNIX equivalent of the
4983 Windows NT Add Printer Wizard. For complete information, please
4984 refer to the Imprints web site at <A
4985 HREF="http://imprints.sourceforge.net/"
4987 > http://imprints.sourceforge.net/</A
4988 > as well as the documentation
4989 included with the imprints source distribution. This section will
4990 only provide a brief introduction to the features of Imprints.</P
4997 >6.3.1. What is Imprints?</A
5000 >Imprints is a collection of tools for supporting the goals
5007 >Providing a central repository information
5008 regarding Windows NT and 95/98 printer driver packages</P
5012 >Providing the tools necessary for creating
5013 the Imprints printer driver packages.</P
5017 >Providing an installation client which
5018 will obtain and install printer drivers on remote Samba
5019 and Windows NT 4 print servers.</P
5029 >6.3.2. Creating Printer Driver Packages</A
5032 >The process of creating printer driver packages is beyond
5033 the scope of this document (refer to Imprints.txt also included
5034 with the Samba distribution for more information). In short,
5035 an Imprints driver package is a gzipped tarball containing the
5036 driver files, related INF files, and a control file needed by the
5037 installation client.</P
5045 >6.3.3. The Imprints server</A
5048 >The Imprints server is really a database server that
5049 may be queried via standard HTTP mechanisms. Each printer
5050 entry in the database has an associated URL for the actual
5051 downloading of the package. Each package is digitally signed
5052 via GnuPG which can be used to verify that package downloaded
5053 is actually the one referred in the Imprints database. It is
5056 > recommended that this security check
5065 >6.3.4. The Installation Client</A
5068 >More information regarding the Imprints installation client
5069 is available in the <TT
5071 >Imprints-Client-HOWTO.ps</TT
5073 file included with the imprints source package.</P
5075 >The Imprints installation client comes in two forms.</P
5081 >a set of command line Perl scripts</P
5085 >a GTK+ based graphical interface to
5086 the command line perl scripts</P
5090 >The installation client (in both forms) provides a means
5091 of querying the Imprints database server for a matching
5092 list of known printer model names as well as a means to
5093 download and install the drivers on remote Samba and Windows
5094 NT print servers.</P
5096 >The basic installation process is in four steps and
5097 perl code is wrapped around <B
5113 CLASS="PROGRAMLISTING"
5115 foreach (supported architecture for a given driver)
5117 1. rpcclient: Get the appropriate upload directory
5118 on the remote server
5119 2. smbclient: Upload the driver files
5120 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
5123 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
5124 create the printer</PRE
5130 >One of the problems encountered when implementing
5131 the Imprints tool set was the name space issues between
5132 various supported client architectures. For example, Windows
5133 NT includes a driver named "Apple LaserWriter II NTX v51.8"
5134 and Windows 95 calls its version of this driver "Apple
5135 LaserWriter II NTX"</P
5137 >The problem is how to know what client drivers have
5138 been uploaded for a printer. As astute reader will remember
5139 that the Windows NT Printer Properties dialog only includes
5140 space for one printer driver name. A quick look in the
5141 Windows NT 4.0 system registry at</P
5145 >HKLM\System\CurrentControlSet\Control\Print\Environment
5149 >will reveal that Windows NT always uses the NT driver
5150 name. This is ok as Windows NT always requires that at least
5151 the Windows NT version of the printer driver is present.
5152 However, Samba does not have the requirement internally.
5153 Therefore, how can you use the NT driver name if is has not
5154 already been installed?</P
5156 >The way of sidestepping this limitation is to require
5157 that all Imprints printer driver packages include both the Intel
5158 Windows NT and 95/98 printer drivers and that NT driver is
5171 >Migration to from Samba 2.0.x to 2.2.x</A
5174 >Given that printer driver management has changed (we hope improved) in
5175 2.2 over prior releases, migration from an existing setup to 2.2 can
5176 follow several paths. Here are the possible scenarios for
5183 >If you do not desire the new Windows NT
5184 print driver support, nothing needs to be done.
5185 All existing parameters work the same.</P
5189 >If you want to take advantage of NT printer
5190 driver support but do not want to migrate the
5191 9x drivers to the new setup, the leave the existing
5195 > file. When smbd attempts
5197 9x driver for the printer in the TDB and fails it
5198 will drop down to using the printers.def (and all
5199 associated parameters). The <B
5203 tool will also remain for backwards compatibility but will
5204 be removed in the next major release.</P
5208 >If you install a Windows 9x driver for a printer
5209 on your Samba host (in the printing TDB), this information will
5210 take precedence and the three old printing parameters
5211 will be ignored (including print driver location).</P
5215 >If you want to migrate an existing <TT
5219 file into the new setup, the current only solution is to use the Windows
5220 NT APW to install the NT drivers and the 9x drivers. This can be scripted
5228 Imprints installation client at <A
5229 HREF="http://imprints.sourceforge.net/"
5231 >http://imprints.sourceforge.net/</A
5259 > parameters are considered to
5260 be deprecated and will be removed soon. Do not use them in new
5270 >printer driver file (G)</I
5280 >printer driver (S)</I
5290 >printer driver location (S)</I
5301 >The have been two new parameters add in Samba 2.2.2 to for
5302 better support of Samba 2.0.x backwards capability (<TT
5308 >) and for using local printers drivers on Windows
5309 NT/2000 clients (<TT
5312 >use client driver</I
5315 these options are described in the smb.coinf(5) man page and are
5316 disabled by default.</P
5323 NAME="DOMAIN-SECURITY"
5324 >Chapter 7. security = domain in Samba 2.x</A
5332 >7.1. Joining an NT Domain with Samba 2.2</A
5335 >Assume you have a Samba 2.x server with a NetBIOS name of
5339 > and are joining an NT domain called
5343 >, which has a PDC with a NetBIOS name
5347 > and two backup domain controllers
5348 with NetBIOS names <TT
5357 >In order to join the domain, first stop all Samba daemons
5358 and run the command:</P
5366 >smbpasswd -j DOM -r DOMPDC
5370 >Administrator%password</I
5376 >as we are joining the domain DOM and the PDC for that domain
5377 (the only machine that has write access to the domain SAM database)
5381 >Administrator%password</I
5384 the login name and password for an account which has the necessary
5385 privilege to add machines to the domain. If this is successful
5386 you will see the message:</P
5389 CLASS="COMPUTEROUTPUT"
5390 >smbpasswd: Joined domain DOM.</TT
5394 >in your terminal window. See the <A
5395 HREF="smbpasswd.8.html"
5398 > man page for more details.</P
5400 >There is existing development code to join a domain
5401 without having to create the machine trust account on the PDC
5402 beforehand. This code will hopefully be available soon
5403 in release branches as well.</P
5405 >This command goes through the machine account password
5406 change protocol, then writes the new (random) machine account
5407 password for this Samba server into a file in the same directory
5408 in which an smbpasswd file would be stored - normally :</P
5412 >/usr/local/samba/private</TT
5415 >In Samba 2.0.x, the filename looks like this:</P
5422 ><NT DOMAIN NAME></I
5436 > suffix stands for machine account
5437 password file. So in our example above, the file would be called:</P
5444 >In Samba 2.2, this file has been replaced with a TDB
5445 (Trivial Database) file named <TT
5451 >This file is created and owned by root and is not
5452 readable by any other user. It is the key to the domain-level
5453 security for your system, and should be treated as carefully
5454 as a shadow password file.</P
5456 >Now, before restarting the Samba daemons you must
5458 HREF="smb.conf.5.html"
5465 > file to tell Samba it should now use domain security.</P
5467 >Change (or add) your <A
5468 HREF="smb.conf.5.html#SECURITY"
5476 > line in the [global] section
5477 of your smb.conf to read:</P
5481 >security = domain</B
5485 HREF="smb.conf.5.html#WORKGROUP"
5493 > line in the [global] section to read: </P
5500 >as this is the name of the domain we are joining. </P
5502 >You must also have the parameter <A
5503 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
5508 >encrypt passwords</I
5515 > in order for your users to authenticate to the NT PDC.</P
5517 >Finally, add (or modify) a <A
5518 HREF="smb.conf.5.html#PASSWORDSERVER"
5523 >password server =</I
5526 > line in the [global]
5527 section to read: </P
5531 >password server = DOMPDC DOMBDC1 DOMBDC2</B
5534 >These are the primary and backup domain controllers Samba
5535 will attempt to contact in order to authenticate users. Samba will
5536 try to contact each of these servers in order, so you may want to
5537 rearrange this list in order to spread out the authentication load
5538 among domain controllers.</P
5540 >Alternatively, if you want smbd to automatically determine
5541 the list of Domain controllers to use for authentication, you may
5542 set this line to be :</P
5546 >password server = *</B
5549 >This method, which was introduced in Samba 2.0.6,
5550 allows Samba to use exactly the same mechanism that NT does. This
5551 method either broadcasts or uses a WINS database in order to
5552 find domain controllers to authenticate against.</P
5554 >Finally, restart your Samba daemons and get ready for
5555 clients to begin using domain security!</P
5563 >7.2. Samba and Windows 2000 Domains</A
5566 >Many people have asked regarding the state of Samba's ability to participate in
5567 a Windows 2000 Domain. Samba 2.2 is able to act as a member server of a Windows
5568 2000 domain operating in mixed or native mode.</P
5570 >There is much confusion between the circumstances that require a "mixed" mode
5571 Win2k DC and a when this host can be switched to "native" mode. A "mixed" mode
5572 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
5573 domain. By default, a Win2k DC in "native" mode will still support
5574 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and
5575 NT 4.0. Samba has the same requirements as a Windows NT 4.0 member server.</P
5577 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
5578 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that
5579 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and
5580 Computers" MMC (Microsoft Management Console) plugin.</P
5588 >7.3. Why is this better than security = server?</A
5591 >Currently, domain security in Samba doesn't free you from
5592 having to create local Unix users to represent the users attaching
5593 to your server. This means that if domain user <TT
5597 > attaches to your domain security Samba server, there needs
5598 to be a local Unix user fred to represent that user in the Unix
5599 filesystem. This is very similar to the older Samba security mode
5601 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
5603 >security = server</A
5605 where Samba would pass through the authentication request to a Windows
5606 NT server in the same way as a Windows 95 or Windows 98 server would.
5609 >Please refer to the <A
5614 > for information on a system to automatically
5615 assign UNIX uids and gids to Windows NT Domain users and groups.
5616 This code is available in development branches only at the moment,
5617 but will be moved to release branches soon.</P
5619 >The advantage to domain-level security is that the
5620 authentication in domain-level security is passed down the authenticated
5621 RPC channel in exactly the same way that an NT server would do it. This
5622 means Samba servers now participate in domain trust relationships in
5623 exactly the same way NT servers do (i.e., you can add Samba servers into
5624 a resource domain and have the authentication passed on from a resource
5625 domain PDC to an account domain PDC.</P
5627 >In addition, with <B
5629 >security = server</B
5631 daemon on a server has to keep a connection open to the
5632 authenticating server for as long as that daemon lasts. This can drain
5633 the connection resources on a Microsoft NT server and cause it to run
5634 out of available connections. With <B
5636 >security = domain</B
5638 however, the Samba daemons connect to the PDC/BDC only for as long
5639 as is necessary to authenticate the user, and then drop the connection,
5640 thus conserving PDC connection resources.</P
5642 >And finally, acting in the same manner as an NT server
5643 authenticating to a PDC means that as part of the authentication
5644 reply, the Samba server gets the user identification information such
5645 as the user SID, the list of NT groups the user belongs to, etc. All
5646 this information will allow Samba to be extended in the future into
5647 a mode the developers currently call appliance mode. In this mode,
5648 no local Unix users will be necessary, and Samba will generate Unix
5649 uids and gids from the information passed back from the PDC when a
5650 user is authenticated, making a Samba server truly plug and play
5651 in an NT domain environment. Watch for this code soon.</P
5655 > Much of the text of this document
5656 was first published in the Web magazine <A
5657 HREF="http://www.linuxworld.com"
5662 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
5674 >Chapter 8. How to Configure Samba 2.2 as a Primary Domain Controller</A
5682 >8.1. Prerequisite Reading</A
5685 >Before you continue reading in this chapter, please make sure
5686 that you are comfortable with configuring basic files services
5687 in smb.conf and how to enable and administer password
5688 encryption in Samba. Theses two topics are covered in the
5690 HREF="smb.conf.5.html"
5698 HREF="ENCRYPTION.html"
5700 >Encryption chapter</A
5702 of this HOWTO Collection.</P
5721 > This document is a combination
5722 of David Bannon's "Samba 2.2 PDC HOWTO" and "Samba NT Domain FAQ".
5723 Both documents are superseded by this one.</P
5727 >Versions of Samba prior to release 2.2 had marginal capabilities to act
5728 as a Windows NT 4.0 Primary Domain Controller
5730 (PDC). With Samba 2.2.0, we are proud to announce official support for
5731 Windows NT 4.0-style domain logons from Windows NT 4.0 and Windows
5732 2000 clients. This article outlines the steps
5733 necessary for configuring Samba as a PDC. It is necessary to have a
5734 working Samba server prior to implementing the PDC functionality. If
5735 you have not followed the steps outlined in <A
5736 HREF="UNIX_INSTALL.html"
5738 > UNIX_INSTALL.html</A
5740 that your server is configured correctly before proceeding. Another
5741 good resource in the <A
5742 HREF="smb.conf.5.html"
5746 >. The following functionality should work in 2.2:</P
5752 > domain logons for Windows NT 4.0/2000 clients.
5757 > placing a Windows 9x client in user level security
5762 > retrieving a list of users and groups from a Samba PDC to
5763 Windows 9x/NT/2000 clients
5768 > roving (roaming) user profiles
5773 > Windows NT 4.0-style system policies
5778 >The following pieces of functionality are not included in the 2.2 release:</P
5784 > Windows NT 4 domain trusts
5789 > SAM replication with Windows NT 4.0 Domain Controllers
5790 (i.e. a Samba PDC and a Windows NT BDC or vice versa)
5795 > Adding users via the User Manager for Domains
5800 > Acting as a Windows 2000 Domain Controller (i.e. Kerberos and
5806 >Please note that Windows 9x clients are not true members of a domain
5807 for reasons outlined in this article. Therefore the protocol for
5808 support Windows 9x-style domain logons is completely different
5809 from NT4 domain logons and has been officially supported for some
5812 >Implementing a Samba PDC can basically be divided into 2 broad
5820 > Configuring the Samba PDC
5825 > Creating machine trust accounts and joining clients
5831 >There are other minor details such as user profiles, system
5832 policies, etc... However, these are not necessarily specific
5833 to a Samba PDC as much as they are related to Windows NT networking
5834 concepts. They will be mentioned only briefly here.</P
5842 >8.3. Configuring the Samba Domain Controller</A
5845 >The first step in creating a working Samba PDC is to
5846 understand the parameters necessary in smb.conf. I will not
5847 attempt to re-explain the parameters here as they are more that
5848 adequately covered in <A
5849 HREF="smb.conf.5.html"
5853 >. For convenience, the parameters have been
5854 linked with the actual smb.conf description.</P
5856 >Here is an example <TT
5859 > for acting as a PDC:</P
5868 CLASS="PROGRAMLISTING"
5870 ; Basic server settings
5872 HREF="smb.conf.5.html#NETBIOSNAME"
5882 HREF="smb.conf.5.html#WORKGROUP"
5892 ; we should act as the domain and local master browser
5894 HREF="smb.conf.5.html#OSLEVEL"
5899 HREF="smb.conf.5.html#PERFERREDMASTER"
5901 >preferred master</A
5904 HREF="smb.conf.5.html#DOMAINMASTER"
5909 HREF="smb.conf.5.html#LOCALMASTER"
5914 ; security settings (must user security = user)
5916 HREF="smb.conf.5.html#SECURITYEQUALSUSER"
5921 ; encrypted passwords are a requirement for a PDC
5923 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
5925 >encrypt passwords</A
5928 ; support domain logons
5930 HREF="smb.conf.5.html#DOMAINLOGONS"
5935 ; where to store user profiles?
5937 HREF="smb.conf.5.html#LOGONPATH"
5940 > = \\%N\profiles\%u
5942 ; where is a user's home directory and where should it
5945 HREF="smb.conf.5.html#LOGONDRIVE"
5950 HREF="smb.conf.5.html#LOGONHOME"
5955 ; specify a generic logon script for all users
5956 ; this is a relative **DOS** path to the [netlogon] share
5958 HREF="smb.conf.5.html#LOGONSCRIPT"
5963 ; necessary share for domain controller
5966 HREF="smb.conf.5.html#PATH"
5969 > = /usr/local/samba/lib/netlogon
5971 HREF="smb.conf.5.html#READONLY"
5976 HREF="smb.conf.5.html#WRITELIST"
5986 ; share for storing user profiles
5989 HREF="smb.conf.5.html#PATH"
5992 > = /export/smb/ntprofile
5994 HREF="smb.conf.5.html#READONLY"
5999 HREF="smb.conf.5.html#CREATEMASK"
6004 HREF="smb.conf.5.html#DIRECTORYMASK"
6013 >There are a couple of points to emphasize in the above configuration.</P
6019 > Encrypted passwords must be enabled. For more details on how
6020 to do this, refer to <A
6021 HREF="ENCRYPTION.html"
6029 > The server must support domain logons and a
6038 > The server must be the domain master browser in order for Windows
6039 client to locate the server as a DC. Please refer to the various
6040 Network Browsing documentation included with this distribution for
6046 >As Samba 2.2 does not offer a complete implementation of group mapping
6047 between Windows NT groups and Unix groups (this is really quite
6048 complicated to explain in a short space), you should refer to the
6050 HREF="smb.conf.5.html#DOMAINADMINGROUP"
6054 > smb.conf parameter for information of creating "Domain
6055 Admins" style accounts.</P
6063 >8.4. Creating Machine Trust Accounts and Joining Clients to the
6067 >A machine trust account is a Samba account that is used to
6068 authenticate a client machine (rather than a user) to the Samba
6069 server. In Windows terminology, this is known as a "Computer
6072 >The password of a machine trust account acts as the shared secret for
6073 secure communication with the Domain Controller. This is a security
6074 feature to prevent an unauthorized machine with the same NetBIOS name
6075 from joining the domain and gaining access to domain user/group
6076 accounts. Windows NT and 2000 clients use machine trust accounts, but
6077 Windows 9x clients do not. Hence, a Windows 9x client is never a true
6078 member of a domain because it does not possess a machine trust
6079 account, and thus has no shared secret with the domain controller.</P
6081 >A Windows PDC stores each machine trust account in the Windows
6082 Registry. A Samba PDC, however, stores each machine trust account
6083 in two parts, as follows:
6090 >A Samba account, stored in the same location as user
6091 LanMan and NT password hashes (currently
6095 >). The Samba account
6096 possesses and uses only the NT password hash.</P
6100 >A corresponding Unix account, typically stored in
6104 >. (Future releases will alleviate the need to
6113 >There are two ways to create machine trust accounts:</P
6119 > Manual creation. Both the Samba and corresponding
6120 Unix account are created by hand.</P
6124 > "On-the-fly" creation. The Samba machine trust
6125 account is automatically created by Samba at the time the client
6126 is joined to the domain. (For security, this is the
6127 recommended method.) The corresponding Unix account may be
6128 created automatically or manually. </P
6137 >8.4.1. Manual Creation of Machine Trust Accounts</A
6140 >The first step in manually creating a machine trust account is to
6141 manually create the corresponding Unix account in
6145 >. This can be done using
6149 > or other 'add user' command that is normally
6150 used to create new Unix accounts. The following is an example for a
6151 Linux based Samba server:</P
6158 >/usr/sbin/useradd -g 100 -d /dev/null -c <TT
6188 > entry will list the machine name
6189 with a "$" appended, won't have a password, will have a null shell and no
6190 home directory. For example a machine named 'doppy' would have an
6194 > entry like this:</P
6203 CLASS="PROGRAMLISTING"
6204 >doppy$:x:505:501:<TT
6207 >machine_nickname</I
6209 >:/dev/null:/bin/false</PRE
6218 >machine_nickname</I
6221 descriptive name for the client, i.e., BasementComputer.
6227 > absolutely must be the NetBIOS
6228 name of the client to be joined to the domain. The "$" must be
6229 appended to the NetBIOS name of the client or Samba will not recognize
6230 this as a machine trust account.</P
6232 >Now that the corresponding Unix account has been created, the next step is to create
6233 the Samba account for the client containing the well-known initial
6234 machine trust account password. This can be done using the <A
6235 HREF="smbpasswd.8.html"
6249 >smbpasswd -a -m <TT
6262 > is the machine's NetBIOS
6263 name. The RID of the new machine account is generated from the UID of
6264 the corresponding Unix account.</P
6277 >Join the client to the domain immediately</B
6284 > Manually creating a machine trust account using this method is the
6285 equivalent of creating a machine trust account on a Windows NT PDC using
6286 the "Server Manager". From the time at which the account is created
6287 to the time which the client joins the domain and changes the password,
6288 your domain is vulnerable to an intruder joining your domain using a
6289 a machine with the same NetBIOS name. A PDC inherently trusts
6290 members of the domain and will serve out a large degree of user
6291 information to such clients. You have been warned!
6304 >8.4.2. "On-the-Fly" Creation of Machine Trust Accounts</A
6307 >The second (and recommended) way of creating machine trust accounts is
6308 simply to allow the Samba server to create them as needed when the client
6309 is joined to the domain. </P
6311 >Since each Samba machine trust account requires a corresponding
6312 Unix account, a method for automatically creating the
6313 Unix account is usually supplied; this requires configuration of the
6315 HREF="smb.conf.5.html#ADDUSERSCRIPT"
6323 method is not required, however; corresponding Unix accounts may also
6324 be created manually.</P
6326 >Below is an example for a RedHat 6.2 Linux system.</P
6335 CLASS="PROGRAMLISTING"
6337 # <...remainder of parameters...>
6338 add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u </PRE
6350 >8.4.3. Joining the Client to the Domain</A
6353 >The procedure for joining a client to the domain varies with the
6354 version of Windows.</P
6364 > When the user elects to join the client to a domain, Windows prompts for
6365 an account and password that is privileged to join the domain. A
6366 Samba administrative account (i.e., a Samba account that has root
6367 privileges on the Samba server) must be entered here; the
6368 operation will fail if an ordinary user account is given.
6369 The password for this account should be
6370 set to a different password than the associated
6374 > entry, for security
6377 >The session key of the Samba administrative account acts as an
6378 encryption key for setting the password of the machine trust
6379 account. The machine trust account will be created on-the-fly, or
6380 updated if it already exists.</P
6388 > If the machine trust account was created manually, on the
6389 Identification Changes menu enter the domain name, but do not
6390 check the box "Create a Computer Account in the Domain." In this case,
6391 the existing machine trust account is used to join the machine to
6394 > If the machine trust account is to be created
6395 on-the-fly, on the Identification Changes menu enter the domain
6396 name, and check the box "Create a Computer Account in the Domain." In
6397 this case, joining the domain proceeds as above for Windows 2000
6398 (i.e., you must supply a Samba administrative account when
6410 >8.5. Common Problems and Errors</A
6420 >I cannot include a '$' in a machine name.</EM
6424 > A 'machine name' in (typically) <TT
6428 of the machine name with a '$' appended. FreeBSD (and other BSD
6429 systems?) won't create a user with a '$' in their name.
6432 > The problem is only in the program used to make the entry, once
6433 made, it works perfectly. So create a user without the '$' and
6437 > to edit the entry, adding the '$'. Or create
6438 the whole entry with vipw if you like, make sure you use a
6445 >I get told "You already have a connection to the Domain...."
6446 or "Cannot join domain, the credentials supplied conflict with an
6447 existing set.." when creating a machine trust account.</EM
6451 > This happens if you try to create a machine trust account from the
6452 machine itself and already have a connection (e.g. mapped drive)
6453 to a share (or IPC$) on the Samba PDC. The following command
6454 will remove all network drive connections:
6466 > Further, if the machine is a already a 'member of a workgroup' that
6467 is the same name as the domain you are joining (bad idea) you will
6468 get this message. Change the workgroup name to something else, it
6469 does not matter what, reboot, and try again.
6475 >The system can not log you on (C000019B)....</EM
6479 >I joined the domain successfully but after upgrading
6480 to a newer version of the Samba code I get the message, "The system
6481 can not log you on (C000019B), Please try a gain or consult your
6482 system administrator" when attempting to logon.
6485 > This occurs when the domain SID stored in
6488 >private/WORKGROUP.SID</TT
6490 changed. For example, you remove the file and <B
6494 creates a new one. Or you are swapping back and forth between
6495 versions 2.0.7, TNG and the HEAD branch code (not recommended). The
6496 only way to correct the problem is to restore the original domain
6497 SID or remove the domain client from the domain and rejoin.
6503 >The machine trust account for this computer either does not
6504 exist or is not accessible.</EM
6508 > When I try to join the domain I get the message "The machine account
6509 for this computer either does not exist or is not accessible". What's
6513 > This problem is caused by the PDC not having a suitable machine trust account.
6514 If you are using the <TT
6520 accounts then this would indicate that it has not worked. Ensure the domain
6521 admin user system is working.
6524 > Alternatively if you are creating account entries manually then they
6525 have not been created correctly. Make sure that you have the entry
6526 correct for the machine trust account in smbpasswd file on the Samba PDC.
6527 If you added the account using an editor rather than using the smbpasswd
6528 utility, make sure that the account name is the machine NetBIOS name
6529 with a '$' appended to it ( i.e. computer_name$ ). There must be an entry
6530 in both /etc/passwd and the smbpasswd file. Some people have reported
6531 that inconsistent subnet masks between the Samba server and the NT
6532 client have caused this problem. Make sure that these are consistent
6533 for both client and server.
6539 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
6540 I get a message about my account being disabled.</EM
6544 > This problem is caused by a PAM related bug in Samba 2.2.0. This bug is
6545 fixed in 2.2.1. Other symptoms could be unaccessible shares on
6546 NT/W2K member servers in the domain or the following error in your smbd.log:
6547 passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
6550 > At first be ensure to enable the useraccounts with <B
6554 >, this is normally done, when you create an account.
6557 > In order to work around this problem in 2.2.0, configure the
6566 >/etc/pam.d/samba</TT
6577 CLASS="PROGRAMLISTING"
6578 > account required pam_permit.so
6585 > If you want to remain backward compatibility to samba 2.0.x use
6589 >, it's also possible to use
6593 >. There are some bugs if you try to
6597 >, if you need this, be ensure to use
6598 the most recent version of this file.
6609 >8.6. System Policies and Profiles</A
6612 >Much of the information necessary to implement System Policies and
6613 Roving User Profiles in a Samba domain is the same as that for
6614 implementing these same items in a Windows NT 4.0 domain.
6615 You should read the white paper <A
6616 HREF="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
6619 Profiles and Policies in Windows NT 4.0</A
6620 > available from Microsoft.</P
6622 >Here are some additional details:</P
6629 >What about Windows NT Policy Editor?</EM
6633 > To create or edit <TT
6637 the NT Server Policy Editor, <B
6641 is included with NT Server but <EM
6642 >not NT Workstation</EM
6644 There is a Policy Editor on a NTws
6645 but it is not suitable for creating <EM
6646 >Domain Policies</EM
6648 Further, although the Windows 95
6649 Policy Editor can be installed on an NT Workstation/Server, it will not
6650 work with NT policies because the registry key that are set by the policy templates.
6651 However, the files from the NT Server will run happily enough on an NTws.
6654 >poledit.exe, common.adm</TT
6659 to put the two *.adm files in <TT
6663 the binary will look for them unless told otherwise. Note also that that
6664 directory is 'hidden'.
6667 > The Windows NT policy editor is also included with the Service Pack 3 (and
6668 later) for Windows NT 4.0. Extract the files using <B
6670 >servicepackname /x</B
6675 > for service pack 6a. The policy editor,
6679 > and the associated template files (*.adm) should
6680 be extracted as well. It is also possible to downloaded the policy template
6681 files for Office97 and get a copy of the policy editor. Another possible
6682 location is with the Zero Administration Kit available for download from Microsoft.
6688 >Can Win95 do Policies?</EM
6692 > Install the group policy handler for Win9x to pick up group
6693 policies. Look on the Win98 CD in <TT
6695 >\tools\reskit\netadmin\poledit</TT
6697 Install group policies on a Win9x client by double-clicking
6701 >. Log off and on again a couple of
6702 times and see if Win98 picks up group policies. Unfortunately this needs
6703 to be done on every Win9x machine that uses group policies....
6706 > If group policies don't work one reports suggests getting the updated
6707 (read: working) grouppol.dll for Windows 9x. The group list is grabbed
6714 >How do I get 'User Manager' and 'Server Manager'</EM
6718 > Since I don't need to buy an NT Server CD now, how do I get
6719 the 'User Manager for Domains', the 'Server Manager'?
6722 > Microsoft distributes a version of these tools called nexus for
6723 installation on Windows 95 systems. The tools set includes
6734 >User Manager for Domains</P
6742 > Click here to download the archived file <A
6743 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
6745 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</A
6749 > The Windows NT 4.0 version of the 'User Manager for
6750 Domains' and 'Server Manager' are available from Microsoft via ftp
6752 HREF="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
6754 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</A
6766 >8.7. What other help can I get?</A
6769 >There are many sources of information available in the form
6770 of mailing lists, RFC's and documentation. The docs that come
6771 with the samba distribution contain very good explanations of
6772 general SMB topics such as browsing.</P
6779 >What are some diagnostics tools I can use to debug the domain logon
6780 process and where can I find them?</EM
6784 > One of the best diagnostic tools for debugging problems is Samba itself.
6785 You can use the -d option for both smbd and nmbd to specify what
6786 'debug level' at which to run. See the man pages on smbd, nmbd and
6787 smb.conf for more information on debugging options. The debug
6788 level can range from 1 (the default) to 10 (100 for debugging passwords).
6791 > Another helpful method of debugging is to compile samba using the
6795 > flag. This will include debug
6796 information in the binaries and allow you to attach gdb to the
6797 running smbd / nmbd process. In order to attach gdb to an smbd
6798 process for an NT workstation, first get the workstation to make the
6799 connection. Pressing ctrl-alt-delete and going down to the domain box
6800 is sufficient (at least, on the first time you join the domain) to
6801 generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation
6802 maintains an open connection, and therefore there will be an smbd
6803 process running (assuming that you haven't set a really short smbd
6804 idle timeout) So, in between pressing ctrl alt delete, and actually
6805 typing in your password, you can gdb attach and continue.
6808 > Some useful samba commands worth investigating:
6815 >testparam | more</P
6819 >smbclient -L //{netbios name of server}</P
6823 > An SMB enabled version of tcpdump is available from
6825 HREF="http://www.tcpdump.org/"
6827 >http://www.tcpdup.org/</A
6829 Ethereal, another good packet sniffer for Unix and Win32
6830 hosts, can be downloaded from <A
6831 HREF="http://www.ethereal.com/"
6833 >http://www.ethereal.com</A
6837 > For tracing things on the Microsoft Windows NT, Network Monitor
6838 (aka. netmon) is available on the Microsoft Developer Network CD's,
6839 the Windows NT Server install CD and the SMS CD's. The version of
6840 netmon that ships with SMS allows for dumping packets between any two
6841 computers (i.e. placing the network interface in promiscuous mode).
6842 The version on the NT Server install CD will only allow monitoring
6843 of network traffic directed to the local NT box and broadcasts on the
6844 local subnet. Be aware that Ethereal can read and write netmon
6851 >How do I install 'Network Monitor' on an NT Workstation
6852 or a Windows 9x box?</EM
6856 > Installing netmon on an NT workstation requires a couple
6857 of steps. The following are for installing Netmon V4.00.349, which comes
6858 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
6859 Workstation 4.0. The process should be similar for other version of
6860 Windows NT / Netmon. You will need both the Microsoft Windows
6861 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
6864 > Initially you will need to install 'Network Monitor Tools and Agent'
6865 on the NT Server. To do this
6872 >Goto Start - Settings - Control Panel -
6873 Network - Services - Add </P
6877 >Select the 'Network Monitor Tools and Agent' and
6882 >Click 'OK' on the Network Control Panel.
6887 >Insert the Windows NT Server 4.0 install CD
6892 > At this point the Netmon files should exist in
6895 >%SYSTEMROOT%\System32\netmon\*.*</TT
6897 Two subdirectories exist as well, <TT
6901 which contains the necessary DLL's for parsing the netmon packet
6908 > In order to install the Netmon tools on an NT Workstation, you will
6909 first need to install the 'Network Monitor Agent' from the Workstation
6917 >Goto Start - Settings - Control Panel -
6918 Network - Services - Add</P
6922 >Select the 'Network Monitor Agent' and click
6927 >Click 'OK' on the Network Control Panel.
6932 >Insert the Windows NT Workstation 4.0 install
6933 CD when prompted.</P
6937 > Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.*
6938 to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set
6939 permissions as you deem appropriate for your site. You will need
6940 administrative rights on the NT box to run netmon.
6943 > To install Netmon on a Windows 9x box install the network monitor agent
6944 from the Windows 9x CD (\admin\nettools\netmon). There is a readme
6945 file located with the netmon driver files on the CD if you need
6946 information on how to do this. Copy the files from a working
6947 Netmon installation.
6952 > The following is a list if helpful URLs and other links:
6959 >Home of Samba site <A
6960 HREF="http://samba.org"
6962 > http://samba.org</A
6963 >. We have a mirror near you !</P
6970 on the Samba mirrors might mention your problem. If so,
6971 it might mean that the developers are working on it.</P
6975 >See how Scott Merrill simulates a BDC behavior at
6977 HREF="http://www.skippy.net/linux/smb-howto.html"
6979 > http://www.skippy.net/linux/smb-howto.html</A
6984 >Although 2.0.7 has almost had its day as a PDC, David Bannon will
6985 keep the 2.0.7 PDC pages at <A
6986 HREF="http://bioserve.latrobe.edu.au/samba"
6988 > http://bioserve.latrobe.edu.au/samba</A
6989 > going for a while yet.</P
6993 >Misc links to CIFS information
6995 HREF="http://samba.org/cifs/"
6997 >http://samba.org/cifs/</A
7002 >NT Domains for Unix <A
7003 HREF="http://mailhost.cb1.com/~lkcl/ntdom/"
7005 > http://mailhost.cb1.com/~lkcl/ntdom/</A
7010 >FTP site for older SMB specs:
7012 HREF="ftp://ftp.microsoft.com/developr/drg/CIFS/"
7014 > ftp://ftp.microsoft.com/developr/drg/CIFS/</A
7026 >How do I get help from the mailing lists?</EM
7030 > There are a number of Samba related mailing lists. Go to <A
7031 HREF="http://samba.org"
7033 >http://samba.org</A
7034 >, click on your nearest mirror
7035 and then click on <B
7038 > and then click on <B
7040 > Samba related mailing lists</B
7044 > For questions relating to Samba TNG go to
7046 HREF="http://www.samba-tng.org/"
7048 >http://www.samba-tng.org/</A
7050 It has been requested that you don't post questions about Samba-TNG to the
7051 main stream Samba lists.</P
7053 > If you post a message to one of the lists please observe the following guide lines :
7060 > Always remember that the developers are volunteers, they are
7061 not paid and they never guarantee to produce a particular feature at
7062 a particular time. Any time lines are 'best guess' and nothing more.
7067 > Always mention what version of samba you are using and what
7068 operating system its running under. You should probably list the
7069 relevant sections of your smb.conf file, at least the options
7070 in [global] that affect PDC support.</P
7074 >In addition to the version, if you obtained Samba via
7075 CVS mention the date when you last checked it out.</P
7079 > Try and make your question clear and brief, lots of long,
7080 convoluted questions get deleted before they are completely read !
7081 Don't post html encoded messages (if you can select colour or font
7086 > If you run one of those nifty 'I'm on holidays' things when
7087 you are away, make sure its configured to not answer mailing lists.
7092 > Don't cross post. Work out which is the best list to post to
7093 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
7094 Many people active on the lists subscribe to more
7095 than one list and get annoyed to see the same message two or more times.
7096 Often someone will see a message and thinking it would be better dealt
7097 with on another, will forward it on for you.</P
7101 >You might include <EM
7104 log files written at a debug level set to as much as 20.
7105 Please don't send the entire log but enough to give the context of the
7110 >(Possibly) If you have a complete netmon trace ( from the opening of
7111 the pipe to the error ) you can send the *.CAP file as well.</P
7115 >Please think carefully before attaching a document to an email.
7116 Consider pasting the relevant parts into the body of the message. The samba
7117 mailing lists go to a huge number of people, do they all need a copy of your
7118 smb.conf in their attach directory?</P
7125 >How do I get off the mailing lists?</EM
7129 >To have your name removed from a samba mailing list, go to the
7130 same place you went to to get on it. Go to <A
7131 HREF="http://lists.samba.org/"
7133 >http://lists.samba.org</A
7135 click on your nearest mirror and then click on <B
7141 > Samba related mailing lists</B
7144 HREF="http://lists.samba.org/mailman/roster/samba-ntdom"
7150 > Please don't post messages to the list asking to be removed, you will just
7151 be referred to the above address (unless that process failed in some way...)
7162 >8.8. Domain Control for Windows 9x/ME</A
7171 >The following section contains much of the original
7172 DOMAIN.txt file previously included with Samba. Much of
7173 the material is based on what went into the book <EM
7175 Edition, Using Samba</EM
7176 >, by Richard Sharpe.</P
7180 >A domain and a workgroup are exactly the same thing in terms of network
7181 browsing. The difference is that a distributable authentication
7182 database is associated with a domain, for secure login access to a
7183 network. Also, different access rights can be granted to users if they
7184 successfully authenticate against a domain logon server (NT server and
7185 other systems based on NT server support this, as does at least Samba TNG now).</P
7187 >The SMB client logging on to a domain has an expectation that every other
7188 server in the domain should accept the same authentication information.
7189 Network browsing functionality of domains and workgroups is
7190 identical and is explained in BROWSING.txt. It should be noted, that browsing
7191 is totally orthogonal to logon support.</P
7193 >Issues related to the single-logon network model are discussed in this
7194 section. Samba supports domain logons, network logon scripts, and user
7195 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
7196 which will be the focus of this section.</P
7198 >When an SMB client in a domain wishes to logon it broadcast requests for a
7199 logon server. The first one to reply gets the job, and validates its
7200 password using whatever mechanism the Samba administrator has installed.
7201 It is possible (but very stupid) to create a domain where the user
7202 database is not shared between servers, i.e. they are effectively workgroup
7203 servers advertising themselves as participating in a domain. This
7204 demonstrates how authentication is quite different from but closely
7205 involved with domains.</P
7207 >Using these features you can make your clients verify their logon via
7208 the Samba server; make clients run a batch file when they logon to
7209 the network and download their preferences, desktop and start menu.</P
7211 >Before launching into the configuration instructions, it is
7212 worthwhile lookingat how a Windows 9x/ME client performs a logon:</P
7219 > The client broadcasts (to the IP broadcast address of the subnet it is in)
7220 a NetLogon request. This is sent to the NetBIOS name DOMAIN<1c> at the
7221 NetBIOS layer. The client chooses the first response it receives, which
7222 contains the NetBIOS name of the logon server to use in the format of
7228 > The client then connects to that server, logs on (does an SMBsessetupX) and
7229 then connects to the IPC$ share (using an SMBtconX).
7234 > The client then does a NetWkstaUserLogon request, which retrieves the name
7235 of the user's logon script.
7240 > The client then connects to the NetLogon share and searches for this
7241 and if it is found and can be read, is retrieved and executed by the client.
7242 After this, the client disconnects from the NetLogon share.
7247 > The client then sends a NetUserGetInfo request to the server, to retrieve
7248 the user's home share, which is used to search for profiles. Since the
7249 response to the NetUserGetInfo request does not contain much more
7250 the user's home share, profiles for Win9X clients MUST reside in the user
7256 > The client then connects to the user's home share and searches for the
7257 user's profile. As it turns out, you can specify the user's home share as
7258 a sharename and path. For example, \\server\fred\.profile.
7259 If the profiles are found, they are implemented.
7264 > The client then disconnects from the user's home share, and reconnects to
7265 the NetLogon share and looks for CONFIG.POL, the policies file. If this is
7266 found, it is read and implemented.
7276 >8.8.1. Configuration Instructions: Network Logons</A
7279 >The main difference between a PDC and a Windows 9x logon
7280 server configuration is that</P
7286 >Password encryption is not required for a Windows 9x logon server.</P
7290 >Windows 9x/ME clients do not possess machine trust accounts.</P
7294 >Therefore, a Samba PDC will also act as a Windows 9x logon
7308 >security mode and master browsers</B
7315 >There are a few comments to make in order to tie up some
7316 loose ends. There has been much debate over the issue of whether
7317 or not it is ok to configure Samba as a Domain Controller in security
7318 modes other than <TT
7321 >. The only security mode
7322 which will not work due to technical reasons is <TT
7333 mode security is really just a variation on SMB user level security.</P
7335 >Actually, this issue is also closely tied to the debate on whether
7336 or not Samba must be the domain master browser for its workgroup
7337 when operating as a DC. While it may technically be possible
7338 to configure a server as such (after all, browsing and domain logons
7339 are two distinctly different functions), it is not a good idea to
7340 so. You should remember that the DC must register the DOMAIN#1b NetBIOS
7341 name. This is the name used by Windows clients to locate the DC.
7342 Windows clients do not distinguish between the DC and the DMB.
7343 For this reason, it is very wise to configure the Samba DC as the DMB.</P
7345 >Now back to the issue of configuring a Samba DC to use a mode other
7346 than "security = user". If a Samba host is configured to use
7347 another SMB server or DC in order to validate user connection
7348 requests, then it is a fact that some other machine on the network
7349 (the "password server") knows more about user than the Samba host.
7350 99% of the time, this other host is a domain controller. Now
7351 in order to operate in domain mode security, the "workgroup" parameter
7352 must be set to the name of the Windows NT domain (which already
7353 has a domain controller, right?)</P
7355 >Therefore configuring a Samba box as a DC for a domain that
7356 already by definition has a PDC is asking for trouble.
7357 Therefore, you should always configure the Samba DC to be the DMB
7370 >8.8.2. Configuration Instructions: Setting up Roaming User Profiles</A
7393 > Roaming profiles support is different
7394 for Win9X and WinNT.</P
7400 >Before discussing how to configure roaming profiles, it is useful to see how
7401 Win9X and WinNT clients implement these features.</P
7403 >Win9X clients send a NetUserGetInfo request to the server to get the user's
7404 profiles location. However, the response does not have room for a separate
7405 profiles location field, only the user's home share. This means that Win9X
7406 profiles are restricted to being in the user's home directory.</P
7408 >WinNT clients send a NetSAMLogon RPC request, which contains many fields,
7409 including a separate field for the location of the user's profiles.
7410 This means that support for profiles is different for Win9X and WinNT.</P
7417 >8.8.2.1. Windows NT Configuration</A
7420 >To support WinNT clients, in the [global] section of smb.conf set the
7421 following (for example):</P
7430 CLASS="PROGRAMLISTING"
7431 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath</PRE
7437 >The default for this option is \\%N\%U\profile, namely
7438 \\sambaserver\username\profile. The \\N%\%U service is created
7439 automatically by the [homes] service.
7440 If you are using a samba server for the profiles, you _must_ make the
7441 share specified in the logon path browseable. </P
7449 >[lkcl 26aug96 - we have discovered a problem where Windows clients can
7450 maintain a connection to the [homes] share in between logins. The
7451 [homes] share must NOT therefore be used in a profile path.]</P
7461 >8.8.2.2. Windows 9X Configuration</A
7464 >To support Win9X clients, you must use the "logon home" parameter. Samba has
7465 now been fixed so that "net use/home" now works as well, and it, too, relies
7466 on the "logon home" parameter.</P
7468 >By using the logon home parameter, you are restricted to putting Win9X
7469 profiles in the user's home directory. But wait! There is a trick you
7470 can use. If you set the following in the [global] section of your
7480 CLASS="PROGRAMLISTING"
7481 >logon home = \\%L\%U\.profiles</PRE
7487 >then your Win9X clients will dutifully put their clients in a subdirectory
7488 of your home directory called .profiles (thus making them hidden).</P
7490 >Not only that, but 'net use/home' will also work, because of a feature in
7491 Win9X. It removes any directory stuff off the end of the home directory area
7492 and only uses the server and share portion. That is, it looks like you
7493 specified \\%L\%U for "logon home".</P
7501 >8.8.2.3. Win9X and WinNT Configuration</A
7504 >You can support profiles for both Win9X and WinNT clients by setting both the
7505 "logon home" and "logon path" parameters. For example:</P
7514 CLASS="PROGRAMLISTING"
7515 >logon home = \\%L\%U\.profiles
7516 logon path = \\%L\profiles\%U</PRE
7528 >I have not checked what 'net use /home' does on NT when "logon home" is
7539 >8.8.2.4. Windows 9X Profile Setup</A
7542 >When a user first logs in on Windows 9X, the file user.DAT is created,
7543 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".
7544 These directories and their contents will be merged with the local
7545 versions stored in c:\windows\profiles\username on subsequent logins,
7546 taking the most recent from each. You will need to use the [global]
7547 options "preserve case = yes", "short preserve case = yes" and
7548 "case sensitive = no" in order to maintain capital letters in shortcuts
7549 in any of the profile folders.</P
7551 >The user.DAT file contains all the user's preferences. If you wish to
7552 enforce a set of preferences, rename their user.DAT file to user.MAN,
7553 and deny them write access to this file.</P
7560 > On the Windows 95 machine, go to Control Panel | Passwords and
7561 select the User Profiles tab. Select the required level of
7562 roaming preferences. Press OK, but do _not_ allow the computer
7568 > On the Windows 95 machine, go to Control Panel | Network |
7569 Client for Microsoft Networks | Preferences. Select 'Log on to
7570 NT Domain'. Then, ensure that the Primary Logon is 'Client for
7571 Microsoft Networks'. Press OK, and this time allow the computer
7577 >Under Windows 95, Profiles are downloaded from the Primary Logon.
7578 If you have the Primary Logon as 'Client for Novell Networks', then
7579 the profiles and logon script will be downloaded from your Novell
7580 Server. If you have the Primary Logon as 'Windows Logon', then the
7581 profiles will be loaded from the local machine - a bit against the
7582 concept of roaming profiles, if you ask me.</P
7584 >You will now find that the Microsoft Networks Login box contains
7585 [user, password, domain] instead of just [user, password]. Type in
7586 the samba server's domain name (or any other domain known to exist,
7587 but bear in mind that the user will be authenticated against this
7588 domain and profiles downloaded from it, if that domain logon server
7589 supports it), user name and user's password.</P
7591 >Once the user has been successfully validated, the Windows 95 machine
7592 will inform you that 'The user has not logged on before' and asks you
7593 if you wish to save the user's preferences? Select 'yes'.</P
7595 >Once the Windows 95 client comes up with the desktop, you should be able
7596 to examine the contents of the directory specified in the "logon path"
7597 on the samba server and verify that the "Desktop", "Start Menu",
7598 "Programs" and "Nethood" folders have been created.</P
7600 >These folders will be cached locally on the client, and updated when
7601 the user logs off (if you haven't made them read-only by then :-).
7602 You will find that if the user creates further folders or short-cuts,
7603 that the client will merge the profile contents downloaded with the
7604 contents of the profile directory already on the local client, taking
7605 the newest folders and short-cuts from each set.</P
7607 >If you have made the folders / files read-only on the samba server,
7608 then you will get errors from the w95 machine on logon and logout, as
7609 it attempts to merge the local and the remote profile. Basically, if
7610 you have any errors reported by the w95 machine, check the Unix file
7611 permissions and ownership rights on the profile directory contents,
7612 on the samba server.</P
7614 >If you have problems creating user profiles, you can reset the user's
7615 local desktop cache, as shown below. When this user then next logs in,
7616 they will be told that they are logging in "for the first time".</P
7623 > instead of logging in under the [user, password, domain] dialog,
7629 > run the regedit.exe program, and look in:
7632 > HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
7635 > you will find an entry, for each user, of ProfilePath. Note the
7636 contents of this key (likely to be c:\windows\profiles\username),
7637 then delete the key ProfilePath for the required user.
7640 > [Exit the registry editor].
7647 > - before deleting the contents of the
7649 the ProfilePath (this is likely to be c:\windows\profiles\username),
7650 ask them if they have any important files stored on their desktop
7651 or in their start menu. delete the contents of the directory
7652 ProfilePath (making a backup if any of the files are needed).
7655 > This will have the effect of removing the local (read-only hidden
7656 system file) user.DAT in their profile directory, as well as the
7657 local "desktop", "nethood", "start menu" and "programs" folders.
7662 > search for the user's .PWL password-caching file in the c:\windows
7663 directory, and delete it.
7668 > log off the windows 95 client.
7673 > check the contents of the profile path (see "logon path" described
7674 above), and delete the user.DAT or user.MAN file for the user,
7675 making a backup if required.
7680 >If all else fails, increase samba's debug log levels to between 3 and 10,
7681 and / or run a packet trace program such as tcpdump or netmon.exe, and
7682 look for any error reports.</P
7684 >If you have access to an NT server, then first set up roaming profiles
7685 and / or netlogons on the NT server. Make a packet trace, or examine
7686 the example packet traces provided with NT server, and see what the
7687 differences are with the equivalent samba trace.</P
7695 >8.8.2.5. Windows NT Workstation 4.0</A
7698 >When a user first logs in to a Windows NT Workstation, the profile
7699 NTuser.DAT is created. The profile location can be now specified
7700 through the "logon path" parameter. </P
7708 >[lkcl 10aug97 - i tried setting the path to
7709 \\samba-server\homes\profile, and discovered that this fails because
7710 a background process maintains the connection to the [homes] share
7711 which does _not_ close down in between user logins. you have to
7712 have \\samba-server\%L\profile, where user is the username created
7713 from the [homes] share].</P
7717 >There is a parameter that is now available for use with NT Profiles:
7718 "logon drive". This should be set to "h:" or any other drive, and
7719 should be used in conjunction with the new "logon home" parameter.</P
7721 >The entry for the NT 4.0 profile is a _directory_ not a file. The NT
7722 help on profiles mentions that a directory is also created with a .PDS
7723 extension. The user, while logging in, must have write permission to
7724 create the full profile path (and the folder with the .PDS extension)
7725 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
7726 and had to create these manually for each user, with a shell script.
7727 also, i presume, but have not tested, that the full profile path must
7728 be browseable just as it is for w95, due to the manner in which they
7729 attempt to create the full profile path: test existence of each path
7730 component; create path component].</P
7732 >In the profile directory, NT creates more folders than 95. It creates
7733 "Application Data" and others, as well as "Desktop", "Nethood",
7734 "Start Menu" and "Programs". The profile itself is stored in a file
7735 NTuser.DAT. Nothing appears to be stored in the .PDS directory, and
7736 its purpose is currently unknown.</P
7738 >You can use the System Control Panel to copy a local profile onto
7739 a samba server (see NT Help on profiles: it is also capable of firing
7740 up the correct location in the System Control Panel for you). The
7741 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
7742 turns a profile into a mandatory one.</P
7750 >[lkcl 10aug97 - i notice that NT Workstation tells me that it is
7751 downloading a profile from a slow link. whether this is actually the
7752 case, or whether there is some configuration issue, as yet unknown,
7753 that makes NT Workstation _think_ that the link is a slow one is a
7754 matter to be resolved].</P
7756 >[lkcl 20aug97 - after samba digest correspondence, one user found, and
7757 another confirmed, that profiles cannot be loaded from a samba server
7758 unless "security = user" and "encrypt passwords = yes" (see the file
7759 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
7760 of.yourNTserver" are used. Either of these options will allow the NT
7761 workstation to access the samba server using LAN manager encrypted
7762 passwords, without the user intervention normally required by NT
7763 workstation for clear-text passwords].</P
7765 >[lkcl 25aug97 - more comments received about NT profiles: the case of
7766 the profile _matters_. the file _must_ be called NTuser.DAT or, for
7767 a mandatory profile, NTuser.MAN].</P
7777 >8.8.2.6. Windows NT Server</A
7780 >There is nothing to stop you specifying any path that you like for the
7781 location of users' profiles. Therefore, you could specify that the
7782 profile be stored on a samba server, or any other SMB server, as long as
7783 that SMB server supports encrypted passwords.</P
7791 >8.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</A
7805 >Potentially outdated or incorrect material follows</B
7812 >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P
7818 >The default logon path is \\%N\U%. NT Workstation will attempt to create
7819 a directory "\\samba-server\username.PDS" if you specify the logon path
7820 as "\\samba-server\username" with the NT User Manager. Therefore, you
7821 will need to specify (for example) "\\samba-server\username\profile".
7822 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
7823 is more likely to succeed.</P
7825 >If you then want to share the same Start Menu / Desktop with W95, you will
7826 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
7827 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
7828 to run from the c:\winnt\system32 directory. this directory is obviously
7829 unlikely to exist on a Win95-only host].</P
7831 > If you have this set up correctly, you will find separate user.DAT and
7832 NTuser.DAT files in the same profile directory.</P
7840 >[lkcl 25aug97 - there are some issues to resolve with downloading of
7841 NT profiles, probably to do with time/date stamps. i have found that
7842 NTuser.DAT is never updated on the workstation after the first time that
7843 it is copied to the local workstation profile directory. this is in
7844 contrast to w95, where it _does_ transfer / update profiles correctly].</P
7856 >8.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba</A
7870 >Possibly Outdated Material</B
7877 > This appendix was originally authored by John H Terpstra of
7878 the Samba Team and is included here for posterity.
7888 The term "Domain Controller" and those related to it refer to one specific
7889 method of authentication that can underly an SMB domain. Domain Controllers
7890 prior to Windows NT Server 3.1 were sold by various companies and based on
7891 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
7892 Microsoft-specific ways of distributing the user authentication database.
7893 See DOMAIN.txt for examples of how Samba can participate in or create
7894 SMB domains based on shared authentication database schemes other than the
7897 >Windows NT Server can be installed as either a plain file and print server
7898 (WORKGROUP workstation or server) or as a server that participates in Domain
7899 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
7900 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
7901 products, all of which can participate in Domain Control along with Windows NT.</P
7903 >To many people these terms can be confusing, so let's try to clear the air.</P
7905 >Every Windows NT system (workstation or server) has a registry database.
7906 The registry contains entries that describe the initialization information
7907 for all services (the equivalent of Unix Daemons) that run within the Windows
7908 NT environment. The registry also contains entries that tell application
7909 software where to find dynamically loadable libraries that they depend upon.
7910 In fact, the registry contains entries that describes everything that anything
7911 may need to know to interact with the rest of the system.</P
7913 >The registry files can be located on any Windows NT machine by opening a
7914 command prompt and typing:</P
7919 > dir %SystemRoot%\System32\config</P
7921 >The environment variable %SystemRoot% value can be obtained by typing:</P
7926 >echo %SystemRoot%</P
7928 >The active parts of the registry that you may want to be familiar with are
7929 the files called: default, system, software, sam and security.</P
7931 >In a domain environment, Microsoft Windows NT domain controllers participate
7932 in replication of the SAM and SECURITY files so that all controllers within
7933 the domain have an exactly identical copy of each.</P
7935 >The Microsoft Windows NT system is structured within a security model that
7936 says that all applications and services must authenticate themselves before
7937 they can obtain permission from the security manager to do what they set out
7940 >The Windows NT User database also resides within the registry. This part of
7941 the registry contains the user's security identifier, home directory, group
7942 memberships, desktop profile, and so on.</P
7944 >Every Windows NT system (workstation as well as server) will have its own
7945 registry. Windows NT Servers that participate in Domain Security control
7946 have a database that they share in common - thus they do NOT own an
7947 independent full registry database of their own, as do Workstations and
7950 >The User database is called the SAM (Security Access Manager) database and
7951 is used for all user authentication as well as for authentication of inter-
7952 process authentication (i.e. to ensure that the service action a user has
7953 requested is permitted within the limits of that user's privileges).</P
7955 >The Samba team have produced a utility that can dump the Windows NT SAM into
7956 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
7957 /pub/samba/pwdump on your nearest Samba mirror for the utility. This
7958 facility is useful but cannot be easily used to implement SAM replication
7959 to Samba systems.</P
7961 >Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
7962 can participate in a Domain security system that is controlled by Windows NT
7963 servers that have been correctly configured. Almost every domain will have
7964 ONE Primary Domain Controller (PDC). It is desirable that each domain will
7965 have at least one Backup Domain Controller (BDC).</P
7967 >The PDC and BDCs then participate in replication of the SAM database so that
7968 each Domain Controlling participant will have an up to date SAM component
7969 within its registry.</P
7977 >Chapter 9. How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A
7985 >9.1. Prerequisite Reading</A
7988 >Before you continue reading in this chapter, please make sure
7989 that you are comfortable with configuring a Samba PDC
7990 as described in the <A
7991 HREF="Samba-PDC-HOWTO.html"
8005 >What is a Domain Controller? It is a machine that is able to answer
8006 logon requests from workstations in a Windows NT Domain. Whenever a
8007 user logs into a Windows NT Workstation, the workstation connects to a
8008 Domain Controller and asks him whether the username and password the
8009 user typed in is correct. The Domain Controller replies with a lot of
8010 information about the user, for example the place where the users
8011 profile is stored, the users full name of the user. All this
8012 information is stored in the NT user database, the so-called SAM.</P
8014 >There are two kinds of Domain Controller in a NT 4 compatible Domain:
8015 A Primary Domain Controller (PDC) and one or more Backup Domain
8016 Controllers (BDC). The PDC contains the master copy of the
8017 SAM. Whenever the SAM has to change, for example when a user changes
8018 his password, this change has to be done on the PDC. A Backup Domain
8019 Controller is a machine that maintains a read-only copy of the
8020 SAM. This way it is able to reply to logon requests and authenticate
8021 users in case the PDC is not available. During this time no changes to
8022 the SAM are possible. Whenever changes to the SAM are done on the PDC,
8023 all BDC receive the changes from the PDC.</P
8025 >Since version 2.2 Samba officially supports domain logons for all
8026 current Windows Clients, including Windows 2000 and XP. This text
8027 assumes the domain to be named SAMBA. To be able to act as a PDC, some
8028 parameters in the [global]-section of the smb.conf have to be set:</P
8037 CLASS="PROGRAMLISTING"
8040 domain logons = yes</PRE
8046 >Several other things like a [homes] and a [netlogon] share also may be
8047 set along with settings for the profile path, the users home drive and
8048 others. This will not be covered in this document.</P
8056 >9.3. What qualifies a Domain Controller on the network?</A
8059 >Every machine that is a Domain Controller for the domain SAMBA has to
8060 register the NetBIOS group name SAMBA#1c with the WINS server and/or
8061 by broadcast on the local network. The PDC also registers the unique
8062 NetBIOS name SAMBA#1b with the WINS server. The name type #1b is
8063 normally reserved for the domain master browser, a role that has
8064 nothing to do with anything related to authentication, but the
8065 Microsoft Domain implementation requires the domain master browser to
8066 be on the same machine as the PDC.</P
8073 >9.3.1. How does a Workstation find its domain controller?</A
8076 >A NT workstation in the domain SAMBA that wants a local user to be
8077 authenticated has to find the domain controller for SAMBA. It does
8078 this by doing a NetBIOS name query for the group name SAMBA#1c. It
8079 assumes that each of the machines it gets back from the queries is a
8080 domain controller and can answer logon requests. To not open security
8081 holes both the workstation and the selected (TODO: How is the DC
8082 chosen) domain controller authenticate each other. After that the
8083 workstation sends the user's credentials (his name and password) to
8084 the domain controller, asking for approval.</P
8092 >9.3.2. When is the PDC needed?</A
8095 >Whenever a user wants to change his password, this has to be done on
8096 the PDC. To find the PDC, the workstation does a NetBIOS name query
8097 for SAMBA#1b, assuming this machine maintains the master copy of the
8098 SAM. The workstation contacts the PDC, both mutually authenticate and
8099 the password change is done.</P
8108 >9.4. Can Samba be a Backup Domain Controller?</A
8111 >With version 2.2, no. The native NT SAM replication protocols have
8112 not yet been fully implemented. The Samba Team is working on
8113 understanding and implementing the protocols, but this work has not
8114 been finished for version 2.2.</P
8116 >Can I get the benefits of a BDC with Samba? Yes. The main reason for
8117 implementing a BDC is availability. If the PDC is a Samba machine,
8118 a second Samba machine can be set up to
8119 service logon requests whenever the PDC is down.</P
8127 >9.5. How do I set up a Samba BDC?</A
8130 >Several things have to be done:</P
8136 >The file private/MACHINE.SID identifies the domain. When a samba
8137 server is first started, it is created on the fly and must never be
8138 changed again. This file has to be the same on the PDC and the BDC,
8139 so the MACHINE.SID has to be copied from the PDC to the BDC.</P
8143 >The Unix user database has to be synchronized from the PDC to the
8144 BDC. This means that both the /etc/passwd and /etc/group have to be
8145 replicated from the PDC to the BDC. This can be done manually
8146 whenever changes are made, or the PDC is set up as a NIS master
8147 server and the BDC as a NIS slave server. To set up the BDC as a
8148 mere NIS client would not be enough, as the BDC would not be able to
8149 access its user database in case of a PDC failure.</P
8153 >The Samba password database in the file private/smbpasswd has to be
8154 replicated from the PDC to the BDC. This is a bit tricky, see the
8159 >Any netlogon share has to be replicated from the PDC to the
8160 BDC. This can be done manually whenever login scripts are changed,
8161 or it can be done automatically together with the smbpasswd
8166 >Finally, the BDC has to be found by the workstations. This can be done
8176 CLASS="PROGRAMLISTING"
8179 domain logons = yes</PRE
8185 >in the [global]-section of the smb.conf of the BDC. This makes the BDC
8186 only register the name SAMBA#1c with the WINS server. This is no
8187 problem as the name SAMBA#1c is a NetBIOS group name that is meant to
8188 be registered by more than one machine. The parameter 'domain master =
8189 no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS
8190 name is reserved for the Primary Domain Controller.</P
8197 >9.5.1. How do I replicate the smbpasswd file?</A
8200 >Replication of the smbpasswd file is sensitive. It has to be done
8201 whenever changes to the SAM are made. Every user's password change is
8202 done in the smbpasswd file and has to be replicated to the BDC. So
8203 replicating the smbpasswd file very often is necessary.</P
8205 >As the smbpasswd file contains plain text password equivalents, it
8206 must not be sent unencrypted over the wire. The best way to set up
8207 smbpasswd replication from the PDC to the BDC is to use the utility
8208 rsync. rsync can use ssh as a transport. ssh itself can be set up to
8209 accept *only* rsync transfer without requiring the user to type a
8218 NAME="SAMBA-LDAP-HOWTO"
8219 >Chapter 10. Storing Samba's User/Machine Account information in an LDAP Directory</A
8230 >This document describes how to use an LDAP directory for storing Samba user
8231 account information traditionally stored in the smbpasswd(5) file. It is
8232 assumed that the reader already has a basic understanding of LDAP concepts
8233 and has a working directory server already installed. For more information
8234 on LDAP architectures and Directories, please refer to the following sites.</P
8241 HREF="http://www.openldap.org/"
8243 >http://www.openldap.org/</A
8248 >iPlanet Directory Server - <A
8249 HREF="http://iplanet.netscape.com/directory"
8251 >http://iplanet.netscape.com/directory</A
8257 HREF="http://www.ora.com/"
8259 >O'Reilly Publishing</A
8261 a guide to LDAP for System Administrators which has a planned release date of
8262 early summer, 2002.</P
8264 >Two additional Samba resources which may prove to be helpful are</P
8271 HREF="http://www.unav.es/cti/ldap-smb/ldap-smb-2_2-howto.html"
8273 >Samba-PDC-LDAP-HOWTO</A
8275 maintained by Ignacio Coupeau.</P
8279 >The NT migration scripts from <A
8280 HREF="http://samba.idealx.org/"
8284 geared to manage users and group in such a Samba-LDAP Domain Controller configuration.
8295 >10.2. Introduction</A
8298 >Traditionally, when configuring <A
8299 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
8306 > file, user account
8307 information such as username, LM/NT password hashes, password change times, and account
8308 flags have been stored in the <TT
8311 > file. There are several
8312 disadvantages to this approach for sites with very large numbers of users (counted
8313 in the thousands).</P
8319 >The first is that all lookups must be performed sequentially. Given that
8320 there are approximately two lookups per domain logon (one for a normal
8321 session connection such as when mapping a network drive or printer), this
8322 is a performance bottleneck for lareg sites. What is needed is an indexed approach
8323 such as is used in databases.</P
8327 >The second problem is that administrators who desired to replicate a
8328 smbpasswd file to more than one Samba server were left to use external
8336 and wrote custom, in-house scripts.</P
8340 >And finally, the amount of information which is stored in an
8341 smbpasswd entry leaves no room for additional attributes such as
8342 a home directory, password expiration time, or even a Relative
8343 Identified (RID).</P
8347 >As a result of these defeciencies, a more robust means of storing user attributes
8348 used by smbd was developed. The API which defines access to user accounts
8349 is commonly referred to as the samdb interface (previously this was called the passdb
8350 API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support
8351 for a samdb backend (e.g. <TT
8362 >) requires compile time support.</P
8364 >When compiling Samba to include the <TT
8370 option, smbd (and associated tools) will store and lookup user accounts in
8371 an LDAP directory. In reality, this is very easy to understand. If you are
8372 comfortable with using an smbpasswd file, simply replace "smbpasswd" with
8373 "LDAP directory" in all the documentation.</P
8375 >There are a few points to stress about what the <TT
8381 does not provide. The LDAP support referred to in the this documentation does not
8388 >A means of retrieving user account information from
8389 an Windows 2000 Active Directory server.</P
8393 >A means of replacing /etc/passwd.</P
8397 >The second item can be accomplished by using LDAP NSS and PAM modules. LGPL
8398 versions of these libraries can be obtained from PADL Software
8400 HREF="http://www.padl.com/"
8402 >http://www.padl.com/</A
8404 the details of configuring these packages are beyond the scope of this document.</P
8412 >10.3. Supported LDAP Servers</A
8415 >The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP
8416 2.0 server and client libraries. The same code should be able to work with
8417 Netscape's Directory Server and client SDK. However, due to lack of testing
8418 so far, there are bound to be compile errors and bugs. These should not be
8419 hard to fix. If you are so inclined, please be sure to forward all patches to
8421 HREF="samba-patches@samba.org"
8423 >samba-patches@samba.org</A
8426 HREF="jerry@samba.org"
8437 >10.4. Schema and Relationship to the RFC 2307 posixAccount</A
8440 >Samba 2.2.3 includes the necessary schema file for OpenLDAP 2.0 in
8443 >examples/LDAP/samba.schema</TT
8444 >. (Note that this schema
8445 file has been modified since the experimental support initially included
8446 in 2.2.2). The sambaAccount objectclass is given here:</P
8455 CLASS="PROGRAMLISTING"
8456 >objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL
8457 DESC 'Samba Account'
8459 MAY ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $
8460 logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $
8461 displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $
8462 description $ userWorkstations $ primaryGroupID $ domain ))</PRE
8468 >The samba.schema file has been formatted for OpenLDAP 2.0. The OID's are
8469 owned by the Samba Team and as such is legal to be openly published.
8470 If you translate the schema to be used with Netscape DS, please
8471 submit the modified schema file as a patch to <A
8472 HREF="jerry@samba.org"
8477 >Just as the smbpasswd file is mean to store information which supplements a
8481 > entry, so is the sambaAccount object
8482 meant to supplement the UNIX user account information. A sambaAccount is a
8486 > objectclass so it can be stored individually
8487 in the directory. However, there are several fields (e.g. uid) which overlap
8488 with the posixAccount objectclass outlined in RFC2307. This is by design.</P
8490 >In order to store all user account information (UNIX and Samba) in the directory,
8491 it is necessary to use the sambaAccount and posixAccount objectclasses in
8492 combination. However, smbd will still obtain the user's UNIX account
8493 information via the standard C library calls (e.g. getpwnam(), et. al.).
8494 This means that the Samba server must also have the LDAP NSS library installed
8495 and functioning correctly. This division of information makes it possible to
8496 store all Samba account information in LDAP, but still maintain UNIX account
8497 information in NIS while the network is transitioning to a full LDAP infrastructure.</P
8505 >10.5. Configuring Samba with LDAP</A
8513 >10.5.1. OpenLDAP configuration</A
8516 >To include support for the sambaAccount object in an OpenLDAP directory
8517 server, first copy the samba.schema file to slapd's configuration directory.</P
8524 >cp samba.schema /etc/openldap/schema/</B
8527 >Next, include the <TT
8534 The sambaAccount object contains two attributes which depend upon other schema
8535 files. The 'uid' attribute is defined in <TT
8539 the 'displayName' attribute is defined in the <TT
8541 >inetorgperson.schema</TT
8543 file. Both of these must be included before the <TT
8555 CLASS="PROGRAMLISTING"
8556 >## /etc/openldap/slapd.conf
8558 ## schema files (core.schema is required by default)
8559 include /etc/openldap/schema/core.schema
8561 ## needed for sambaAccount
8562 include /etc/openldap/schema/cosine.schema
8563 include /etc/openldap/schema/inetorgperson.schema
8564 include /etc/openldap/schema/samba.schema
8566 ## uncomment this line if you want to support the RFC2307 (NIS) schema
8567 ## include /etc/openldap/schema/nis.schema
8575 >It is recommended that you maintain some indices on some of the most usefull attributes,
8576 like in the following example, to speed up searches made on sambaAccount objectclasses
8577 (and possibly posixAccount and posixGroup as well).</P
8586 CLASS="PROGRAMLISTING"
8587 ># Indices to maintain
8588 ## required by OpenLDAP 2.0
8589 index objectclass eq
8591 ## support pb_getsampwnam()
8593 ## support pdb_getsambapwrid()
8596 ## uncomment these if you are storing posixAccount and
8597 ## posixGroup entries in the directory as well
8598 ##index uidNumber eq
8599 ##index gidNumber eq
8601 ##index memberUid eq</PRE
8613 >10.5.2. Configuring Samba</A
8616 >The following parameters are available in smb.conf only with <TT
8622 was included with compiling Samba.</P
8629 HREF="smb.conf.5.html#LDAPSSL"
8637 HREF="smb.conf.5.html#LDAPSERVER"
8645 HREF="smb.conf.5.html#LDAPADMINDN"
8653 HREF="smb.conf.5.html#LDAPSUFFIX"
8661 HREF="smb.conf.5.html#LDAPFILTER"
8669 HREF="smb.conf.5.html#LDAPPORT"
8676 >These are described in the <A
8677 HREF="smb.conf.5.html"
8681 page and so will not be repeated here. However, a sample smb.conf file for
8682 use with an LDAP directory could appear as</P
8691 CLASS="PROGRAMLISTING"
8692 >## /usr/local/samba/lib/smb.conf
8695 encrypt passwords = yes
8697 netbios name = TASHTEGO
8700 # ldap related parameters
8702 # define the DN to use when binding to the directory servers
8703 # The password for this DN is not stored in smb.conf. Rather it
8704 # must be set by using 'smbpasswd -w <TT
8710 # passphrase in the secrets.tdb file. If the "ldap admin dn" values
8711 # changes, this password will need to be reset.
8712 ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org"
8714 # specify the LDAP server's hostname (defaults to locahost)
8715 ldap server = ahab.samba.org
8717 # Define the SSL option when connecting to the directory
8718 # ('off', 'start tls', or 'on' (default))
8719 ldap ssl = start tls
8721 # define the port to use in the LDAP session (defaults to 636 when
8725 # specify the base DN to use when searching the directory
8726 ldap suffix = "ou=people,dc=samba,dc=org"
8728 # generally the default ldap search filter is ok
8729 # ldap filter = "(&(uid=%u)(objectclass=sambaAccount))"</PRE
8742 >10.6. Accounts and Groups management</A
8745 >As users accounts are managed thru the sambaAccount objectclass, you should
8746 modify you existing administration tools to deal with sambaAccount attributes.</P
8748 >Machines accounts are managed with the sambaAccount objectclass, just
8749 like users accounts. However, it's up to you to stored thoses accounts
8750 in a different tree of you LDAP namespace: you should use
8751 "ou=Groups,dc=plainjoe,dc=org" to store groups and
8752 "ou=People,dc=plainjoe,dc=org" to store users. Just configure your
8753 NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration
8756 >In Samba release 2.2.3, the group management system is based on posix
8757 groups. This meand that Samba make usage of the posixGroup objectclass.
8758 For now, there is no NT-like group system management (global and local
8767 >10.7. Security and sambaAccount</A
8770 >There are two important points to remember when discussing the security
8771 of sambaAccount entries in the directory.</P
8779 > retrieve the lmPassword or
8780 ntPassword attribute values over an unencrypted LDAP session.</P
8786 > allow non-admin users to
8787 view the lmPassword or ntPassword attribute values.</P
8791 >These password hashes are clear text equivalents and can be used to impersonate
8792 the user without deriving the original clear text strings. For more information
8793 on the details of LM/NT password hashes, refer to the <A
8794 HREF="ENCRYPTION.html"
8796 >ENCRYPTION chapter</A
8797 > of the Samba-HOWTO-Collection.</P
8799 >To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults
8800 to require an encrypted session (<B
8804 the default port of 636
8805 when contacting the directory server. When using an OpenLDAP 2.0 server, it
8806 is possible to use the use the StartTLS LDAP extended operation in the place of
8807 LDAPS. In either case, you are strongly discouraged to disable this security
8813 >Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS
8814 extended operation. However, the OpenLDAP library still provides support for
8815 the older method of securing communication between clients and servers.</P
8817 >The second security precaution is to prevent non-administrative users from
8818 harvesting password hashes from the directory. This can be done using the
8819 following ACL in <TT
8831 CLASS="PROGRAMLISTING"
8832 >## allow the "ldap admin dn" access, but deny everyone else
8833 access to attrs=lmPassword,ntPassword
8834 by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write
8847 >10.8. LDAP specials attributes for sambaAccounts</A
8850 >The sambaAccount objectclass is composed of the following attributes:</P
8859 >: the LANMAN password 16-byte hash stored as a character
8860 representation of a hexidecimal string.</P
8867 >: the NT password hash 16-byte stored as a character
8868 representation of a hexidecimal string.</P
8875 >: The integer time in seconds since 1970 when the
8882 > attributes were last set.
8890 >: string of 11 characters surrounded by square brackets []
8891 representing account flags such as U (user), W(workstation), X(no password expiration), and
8899 >: Integer value currently unused</P
8906 >: Integer value currently unused</P
8913 >: Integer value currently unused</P
8920 >: Integer value currently unused</P
8927 >: Integer value currently unused</P
8934 >: specifies the drive letter to which to map the
8935 UNC path specified by homeDirectory. The drive letter must be specified in the form "X:"
8936 where X is the letter of the drive to map. Refer to the "logon drive" parameter in the
8937 smb.conf(5) man page for more information.</P
8944 >: The scriptPath property specifies the path of
8945 the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path
8946 is relative to the netlogon share. Refer to the "logon script" parameter in the
8947 smb.conf(5) man page for more information.</P
8954 >: specifies a path to the user's profile.
8955 This value can be a null string, a local absolute path, or a UNC path. Refer to the
8956 "logon path" parameter in the smb.conf(5) man page for more information.</P
8963 >: The homeDirectory property specifies the path of
8964 the home directory for the user. The string can be null. If homeDrive is set and specifies
8965 a drive letter, homeDirectory should be a UNC path. The path must be a network
8966 UNC path of the form \\server\share\directory. This value can be a null string.
8967 Refer to the "logon home" parameter in the smb.conf(5) man page for more information.
8974 >userWorkstation</TT
8975 >: character string value currently unused.
8983 >: the integer representation of the user's relative identifier
8991 >: the relative identifier (RID) of the primary group
8996 >The majority of these parameters are only used when Samba is acting as a PDC of
8997 a domain (refer to the <A
8998 HREF="Samba-PDC-HOWTO.html"
9002 how to configure Samba as a Primary Domain Controller). The following four attributes
9003 are only stored with the sambaAccount entry if the values are non-default values:</P
9025 >These attributes are only stored with the sambaAccount entry if
9026 the values are non-default values. For example, assume TASHTEGO has now been
9027 configured as a PDC and that <B
9029 >logon home = \\%L\%u</B
9034 > file. When a user named "becky" logons to the domain,
9040 > string is expanded to \\TASHTEGO\becky.
9041 If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org",
9042 this value is used. However, if this attribute does not exist, then the value
9048 > parameter is used in its place. Samba
9049 will only write the attribute value to the directory entry is the value is
9050 something other than the default (e.g. \\MOBY\becky).</P
9058 >10.9. Example LDIF Entries for a sambaAccount</A
9061 >The following is a working LDIF with the inclusion of the posixAccount objectclass:</P
9070 CLASS="PROGRAMLISTING"
9071 >dn: uid=guest2, ou=people,dc=plainjoe,dc=org
9072 ntPassword: 878D8014606CDA29677A44EFA1353FC7
9073 pwdMustChange: 2147483647
9074 primaryGroupID: 1201
9075 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
9076 pwdLastSet: 1010179124
9078 objectClass: sambaAccount
9080 kickoffTime: 2147483647
9082 logoffTime: 2147483647
9084 pwdCanChange: 0</PRE
9090 >The following is an LDIF entry for using both the sambaAccount and
9091 posixAccount objectclasses:</P
9100 CLASS="PROGRAMLISTING"
9101 >dn: uid=gcarter, ou=people,dc=plainjoe,dc=org
9103 displayName: Gerald Carter
9104 lmPassword: 552902031BEDE9EFAAD3B435B51404EE
9105 primaryGroupID: 1201
9106 objectClass: posixAccount
9107 objectClass: sambaAccount
9109 userPassword: {crypt}BpM2ej8Rkzogo
9113 loginShell: /bin/bash
9114 logoffTime: 2147483647
9116 kickoffTime: 2147483647
9117 pwdLastSet: 1010179230
9119 homeDirectory: /home/tashtego/gcarter
9121 pwdMustChange: 2147483647
9122 ntPassword: 878D8014606CDA29677A44EFA1353FC7</PRE
9137 >Please mail all comments regarding this HOWTO to <A
9138 HREF="mailto:jerry@samba.org"
9141 >. This documents was
9142 last updated to reflect the Samba 2.2.3 release. </P
9150 >Chapter 11. Unified Logons between Windows NT and UNIX using Winbind</A
9161 >Integration of UNIX and Microsoft Windows NT through
9162 a unified logon has been considered a "holy grail" in heterogeneous
9163 computing environments for a long time. We present
9166 >, a component of the Samba suite
9167 of programs as a solution to the unified logon problem. Winbind
9168 uses a UNIX implementation
9169 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
9170 Service Switch to allow Windows NT domain users to appear and operate
9171 as UNIX users on a UNIX machine. This paper describes the winbind
9172 system, explaining the functionality it provides, how it is configured,
9173 and how it works internally.</P
9181 >11.2. Introduction</A
9184 >It is well known that UNIX and Microsoft Windows NT have
9185 different models for representing user and group information and
9186 use different technologies for implementing them. This fact has
9187 made it difficult to integrate the two systems in a satisfactory
9190 >One common solution in use today has been to create
9191 identically named user accounts on both the UNIX and Windows systems
9192 and use the Samba suite of programs to provide file and print services
9193 between the two. This solution is far from perfect however, as
9194 adding and deleting users on both sets of machines becomes a chore
9195 and two sets of passwords are required both of which
9196 can lead to synchronization problems between the UNIX and Windows
9197 systems and confusion for users.</P
9199 >We divide the unified logon problem for UNIX machines into
9200 three smaller problems:</P
9206 >Obtaining Windows NT user and group information
9211 >Authenticating Windows NT users
9216 >Password changing for Windows NT users
9221 >Ideally, a prospective solution to the unified logon problem
9222 would satisfy all the above components without duplication of
9223 information on the UNIX machines and without creating additional
9224 tasks for the system administrator when maintaining users and
9225 groups on either system. The winbind system provides a simple
9226 and elegant solution to all three components of the unified logon
9235 >11.3. What Winbind Provides</A
9238 >Winbind unifies UNIX and Windows NT account management by
9239 allowing a UNIX box to become a full member of a NT domain. Once
9240 this is done the UNIX box will see NT users and groups as if
9241 they were native UNIX users and groups, allowing the NT domain
9242 to be used in much the same manner that NIS+ is used within
9243 UNIX-only environments.</P
9245 >The end result is that whenever any
9246 program on the UNIX machine asks the operating system to lookup
9247 a user or group name, the query will be resolved by asking the
9248 NT domain controller for the specified domain to do the lookup.
9249 Because Winbind hooks into the operating system at a low level
9250 (via the NSS name resolution modules in the C library) this
9251 redirection to the NT domain controller is completely
9254 >Users on the UNIX machine can then use NT user and group
9255 names as they would use "native" UNIX names. They can chown files
9256 so that they are owned by NT domain users or even login to the
9257 UNIX machine and run a UNIX X-Window session as a domain user.</P
9259 >The only obvious indication that Winbind is being used is
9260 that user and group names take the form DOMAIN\user and
9261 DOMAIN\group. This is necessary as it allows Winbind to determine
9262 that redirection to a domain controller is wanted for a particular
9263 lookup and which trusted domain is being referenced.</P
9265 >Additionally, Winbind provides an authentication service
9266 that hooks into the Pluggable Authentication Modules (PAM) system
9267 to provide authentication via a NT domain to any PAM enabled
9268 applications. This capability solves the problem of synchronizing
9269 passwords between systems since all passwords are stored in a single
9270 location (on the domain controller).</P
9277 >11.3.1. Target Uses</A
9280 >Winbind is targeted at organizations that have an
9281 existing NT based domain infrastructure into which they wish
9282 to put UNIX workstations or servers. Winbind will allow these
9283 organizations to deploy UNIX workstations without having to
9284 maintain a separate account infrastructure. This greatly
9285 simplifies the administrative overhead of deploying UNIX
9286 workstations into a NT based organization.</P
9288 >Another interesting way in which we expect Winbind to
9289 be used is as a central part of UNIX based appliances. Appliances
9290 that provide file and print services to Microsoft based networks
9291 will be able to use Winbind to provide seamless integration of
9292 the appliance into the domain.</P
9301 >11.4. How Winbind Works</A
9304 >The winbind system is designed around a client/server
9305 architecture. A long running <B
9309 listens on a UNIX domain socket waiting for requests
9310 to arrive. These requests are generated by the NSS and PAM
9311 clients and processed sequentially.</P
9313 >The technologies used to implement winbind are described
9321 >11.4.1. Microsoft Remote Procedure Calls</A
9324 >Over the last two years, efforts have been underway
9325 by various Samba Team members to decode various aspects of
9326 the Microsoft Remote Procedure Call (MSRPC) system. This
9327 system is used for most network related operations between
9328 Windows NT machines including remote management, user authentication
9329 and print spooling. Although initially this work was done
9330 to aid the implementation of Primary Domain Controller (PDC)
9331 functionality in Samba, it has also yielded a body of code which
9332 can be used for other purposes.</P
9334 >Winbind uses various MSRPC calls to enumerate domain users
9335 and groups and to obtain detailed information about individual
9336 users or groups. Other MSRPC calls can be used to authenticate
9337 NT domain users and to change user passwords. By directly querying
9338 a Windows PDC for user and group information, winbind maps the
9339 NT account information onto UNIX user and group names.</P
9347 >11.4.2. Name Service Switch</A
9350 >The Name Service Switch, or NSS, is a feature that is
9351 present in many UNIX operating systems. It allows system
9352 information such as hostnames, mail aliases and user information
9353 to be resolved from different sources. For example, a standalone
9354 UNIX workstation may resolve system information from a series of
9355 flat files stored on the local filesystem. A networked workstation
9356 may first attempt to resolve system information from local files,
9357 and then consult a NIS database for user information or a DNS server
9358 for hostname information.</P
9360 >The NSS application programming interface allows winbind
9361 to present itself as a source of system information when
9362 resolving UNIX usernames and groups. Winbind uses this interface,
9363 and information obtained from a Windows NT server using MSRPC
9364 calls to provide a new source of account enumeration. Using standard
9365 UNIX library calls, one can enumerate the users and groups on
9366 a UNIX machine running winbind and see all users and groups in
9367 a NT domain plus any trusted domain as though they were local
9368 users and groups.</P
9370 >The primary control file for NSS is
9373 >/etc/nsswitch.conf</TT
9375 When a UNIX application makes a request to do a lookup
9376 the C library looks in <TT
9378 >/etc/nsswitch.conf</TT
9380 for a line which matches the service type being requested, for
9381 example the "passwd" service type is used when user or group names
9382 are looked up. This config line species which implementations
9383 of that service should be tried and in what order. If the passwd
9388 >passwd: files example</B
9391 >then the C library will first load a module called
9394 >/lib/libnss_files.so</TT
9398 >/lib/libnss_example.so</TT
9400 C library will dynamically load each of these modules in turn
9401 and call resolver functions within the modules to try to resolve
9402 the request. Once the request is resolved the C library returns the
9403 result to the application.</P
9405 >This NSS interface provides a very easy way for Winbind
9406 to hook into the operating system. All that needs to be done
9409 >libnss_winbind.so</TT
9414 then add "winbind" into <TT
9416 >/etc/nsswitch.conf</TT
9418 the appropriate place. The C library will then call Winbind to
9419 resolve user and group names.</P
9427 >11.4.3. Pluggable Authentication Modules</A
9430 >Pluggable Authentication Modules, also known as PAM,
9431 is a system for abstracting authentication and authorization
9432 technologies. With a PAM module it is possible to specify different
9433 authentication methods for different system applications without
9434 having to recompile these applications. PAM is also useful
9435 for implementing a particular policy for authorization. For example,
9436 a system administrator may only allow console logins from users
9437 stored in the local password file but only allow users resolved from
9438 a NIS database to log in over the network.</P
9440 >Winbind uses the authentication management and password
9441 management PAM interface to integrate Windows NT users into a
9442 UNIX system. This allows Windows NT users to log in to a UNIX
9443 machine and be authenticated against a suitable Primary Domain
9444 Controller. These users can also change their passwords and have
9445 this change take effect directly on the Primary Domain Controller.
9448 >PAM is configured by providing control files in the directory
9452 > for each of the services that
9453 require authentication. When an authentication request is made
9454 by an application the PAM code in the C library looks up this
9455 control file to determine what modules to load to do the
9456 authentication check and in what order. This interface makes adding
9457 a new authentication service for Winbind very easy, all that needs
9458 to be done is that the <TT
9466 control files for relevant services are updated to allow
9467 authentication via winbind. See the PAM documentation
9468 for more details.</P
9476 >11.4.4. User and Group ID Allocation</A
9479 >When a user or group is created under Windows NT
9480 is it allocated a numerical relative identifier (RID). This is
9481 slightly different to UNIX which has a range of numbers that are
9482 used to identify users, and the same range in which to identify
9483 groups. It is winbind's job to convert RIDs to UNIX id numbers and
9484 vice versa. When winbind is configured it is given part of the UNIX
9485 user id space and a part of the UNIX group id space in which to
9486 store Windows NT users and groups. If a Windows NT user is
9487 resolved for the first time, it is allocated the next UNIX id from
9488 the range. The same process applies for Windows NT groups. Over
9489 time, winbind will have mapped all Windows NT users and groups
9490 to UNIX user ids and group ids.</P
9492 >The results of this mapping are stored persistently in
9493 an ID mapping database held in a tdb database). This ensures that
9494 RIDs are mapped to UNIX IDs in a consistent way.</P
9502 >11.4.5. Result Caching</A
9505 >An active system can generate a lot of user and group
9506 name lookups. To reduce the network cost of these lookups winbind
9507 uses a caching scheme based on the SAM sequence number supplied
9508 by NT domain controllers. User or group information returned
9509 by a PDC is cached by winbind along with a sequence number also
9510 returned by the PDC. This sequence number is incremented by
9511 Windows NT whenever any user or group information is modified. If
9512 a cached entry has expired, the sequence number is requested from
9513 the PDC and compared against the sequence number of the cached entry.
9514 If the sequence numbers do not match, then the cached information
9515 is discarded and up to date information is requested directly
9525 >11.5. Installation and Configuration</A
9528 >Many thanks to John Trostel <A
9529 HREF="mailto:jtrostel@snapserver.com"
9531 >jtrostel@snapserver.com</A
9533 for providing the HOWTO for this section.</P
9535 >This HOWTO describes how to get winbind services up and running
9536 to control access and authenticate users on your Linux box using
9537 the winbind services which come with SAMBA 2.2.2.</P
9539 >There is also some Solaris specific information in
9542 >docs/textdocs/Solaris-Winbind-HOWTO.txt</TT
9544 Future revisions of this document will incorporate that
9552 >11.5.1. Introduction</A
9555 >This HOWTO describes the procedures used to get winbind up and
9556 running on my RedHat 7.1 system. Winbind is capable of providing access
9557 and authentication control for Windows Domain users through an NT
9558 or Win2K PDC for 'regular' services, such as telnet a nd ftp, as
9559 well for SAMBA services.</P
9561 >This HOWTO has been written from a 'RedHat-centric' perspective, so if
9562 you are using another distribution, you may have to modify the instructions
9563 somewhat to fit the way your distribution works.</P
9570 >Why should I to this?</EM
9574 >This allows the SAMBA administrator to rely on the
9575 authentication mechanisms on the NT/Win2K PDC for the authentication
9576 of domain members. NT/Win2K users no longer need to have separate
9577 accounts on the SAMBA server.
9583 >Who should be reading this document?</EM
9587 > This HOWTO is designed for system administrators. If you are
9588 implementing SAMBA on a file server and wish to (fairly easily)
9589 integrate existing NT/Win2K users from your PDC onto the
9590 SAMBA server, this HOWTO is for you. That said, I am no NT or PAM
9591 expert, so you may find a better or easier way to accomplish
9603 >11.5.2. Requirements</A
9606 >If you have a samba configuration file that you are currently
9609 > If your system already uses PAM,
9616 > If you haven't already made a boot disk,
9621 >Messing with the pam configuration files can make it nearly impossible
9622 to log in to yourmachine. That's why you want to be able to boot back
9623 into your machine in single user mode and restore your
9627 > back to the original state they were in if
9628 you get frustrated with the way things are going. ;-)</P
9630 >The latest version of SAMBA (version 2.2.2 as of this writing), now
9631 includes a functioning winbindd daemon. Please refer to the
9633 HREF="http://samba.org/"
9635 >main SAMBA web page</A
9637 better yet, your closest SAMBA mirror site for instructions on
9638 downloading the source code.</P
9640 >To allow Domain users the ability to access SAMBA shares and
9641 files, as well as potentially other services provided by your
9642 SAMBA machine, PAM (pluggable authentication modules) must
9643 be setup properly on your machine. In order to compile the
9644 winbind modules, you should have at least the pam libraries resident
9645 on your system. For recent RedHat systems (7.1, for instance), that
9649 >. For best results, it is helpful to also
9650 install the development packages in <TT
9652 >pam-devel-0.74-22</TT
9661 >11.5.3. Testing Things Out</A
9664 >Before starting, it is probably best to kill off all the SAMBA
9665 related daemons running on your server. Kill off all <B
9675 > processes that may
9676 be running. To use PAM, you will want to make sure that you have the
9677 standard PAM package (for RedHat) which supplies the <TT
9681 directory structure, including the pam modules are used by pam-aware
9682 services, several pam libraries, and the <TT
9689 > entries for pam. Winbind built better
9690 in SAMBA if the pam-devel package was also installed. This package includes
9691 the header files needed to compile pam-aware applications. For instance,
9692 my RedHat system has both <TT
9698 >pam-devel-0.74-22</TT
9699 > RPMs installed.</P
9706 >11.5.3.1. Configure and compile SAMBA</A
9709 >The configuration and compilation of SAMBA is pretty straightforward.
9710 The first three steps may not be necessary depending upon
9711 whether or not you have previously built the Samba binaries.</P
9720 CLASS="PROGRAMLISTING"
9747 >./configure --with-winbind</B
9768 >This will, by default, install SAMBA in <TT
9770 >/usr/local/samba</TT
9772 See the main SAMBA documentation if you want to install SAMBA somewhere else.
9773 It will also build the winbindd executable and libraries. </P
9781 >11.5.3.2. Configure <TT
9785 winbind libraries</A
9788 >The libraries needed to run the <B
9792 through nsswitch need to be copied to their proper locations, so</P
9799 >cp ../samba/source/nsswitch/libnss_winbind.so /lib</B
9802 >I also found it necessary to make the following symbolic link:</P
9809 >ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2</B
9812 >Now, as root you need to edit <TT
9814 >/etc/nsswitch.conf</TT
9816 allow user and group entries to be visible from the <B
9822 >/etc/nsswitch.conf</TT
9824 this after editing:</P
9833 CLASS="PROGRAMLISTING"
9834 > passwd: files winbind
9836 group: files winbind</PRE
9843 The libraries needed by the winbind daemon will be automatically
9847 > cache the next time
9848 your system reboots, but it
9849 is faster (and you don't need to reboot) if you do it manually:</P
9856 >/sbin/ldconfig -v | grep winbind</B
9862 > available to winbindd
9863 and echos back a check to you.</P
9871 >11.5.3.3. Configure smb.conf</A
9874 >Several parameters are needed in the smb.conf file to control
9882 > These are described in more detail in
9884 HREF="winbindd.8.html"
9891 > file was modified to
9892 include the following entries in the [global] section:</P
9901 CLASS="PROGRAMLISTING"
9904 # separate domain and username with '+', like DOMAIN+username
9906 HREF="winbindd.8.html#WINBINDSEPARATOR"
9908 >winbind separator</A
9910 # use uids from 10000 to 20000 for domain users
9912 HREF="winbindd.8.html#WINBINDUID"
9916 # use gids from 10000 to 20000 for domain groups
9918 HREF="winbindd.8.html#WINBINDGID"
9922 # allow enumeration of winbind users and groups
9924 HREF="winbindd.8.html#WINBINDENUMUSERS"
9926 >winbind enum users</A
9929 HREF="winbindd.8.html#WINBINDENUMGROUP"
9931 >winbind enum groups</A
9933 # give winbind users a real shell (only needed if they have telnet access)
9935 HREF="winbindd.8.html#TEMPLATEHOMEDIR"
9937 >template homedir</A
9938 > = /home/winnt/%D/%U
9940 HREF="winbindd.8.html#TEMPLATESHELL"
9955 >11.5.3.4. Join the SAMBA server to the PDC domain</A
9958 >Enter the following command to make the SAMBA server join the
9959 PDC domain, where <TT
9965 your Windows domain and <TT
9971 a domain user who has administrative privileges in the domain.</P
9978 >/usr/local/samba/bin/net rpc join -s PDC -U Administrator</B
9981 >The proper response to the command should be: "Joined the domain
9993 is your DOMAIN name.</P
10001 >11.5.3.5. Start up the winbindd daemon and test it!</A
10004 >Eventually, you will want to modify your smb startup script to
10005 automatically invoke the winbindd daemon when the other parts of
10006 SAMBA start, but it is possible to test out just the winbind
10007 portion first. To start up winbind services, enter the following
10008 command as root:</P
10015 >/usr/local/samba/bin/winbindd</B
10018 >I'm always paranoid and like to make sure the daemon
10019 is really running...</P
10026 >ps -ae | grep winbindd</B
10029 >This command should produce output like this, if the daemon is running</P
10031 >3025 ? 00:00:00 winbindd</P
10033 >Now... for the real test, try to get some information about the
10034 users on your PDC</P
10041 >/usr/local/samba/bin/wbinfo -u</B
10045 This should echo back a list of users on your Windows users on
10046 your PDC. For example, I get the following response:</P
10055 CLASS="PROGRAMLISTING"
10061 CEO+TsInternetUser</PRE
10067 >Obviously, I have named my domain 'CEO' and my <TT
10075 >You can do the same sort of thing to get group information from
10085 CLASS="PROGRAMLISTING"
10091 >/usr/local/samba/bin/wbinfo -g</B
10096 CEO+Domain Computers
10097 CEO+Domain Controllers
10098 CEO+Cert Publishers
10100 CEO+Enterprise Admins
10101 CEO+Group Policy Creator Owners</PRE
10107 >The function 'getent' can now be used to get unified
10108 lists of both local and PDC users and groups.
10109 Try the following command:</P
10119 >You should get a list that looks like your <TT
10123 list followed by the domain users with their new uids, gids, home
10124 directories and default shells.</P
10126 >The same thing can be done for groups with the command</P
10142 >11.5.3.6. Fix the <TT
10144 >/etc/rc.d/init.d/smb</TT
10151 > daemon needs to start up after the
10158 > daemons are running.
10159 To accomplish this task, you need to modify the <TT
10161 >/etc/init.d/smb</TT
10163 script to add commands to invoke this daemon in the proper sequence. My
10166 >/etc/init.d/smb</TT
10167 > file starts up <B
10180 >/usr/local/samba/bin</TT
10181 > directory directly. The 'start'
10182 function in the script looks like this:</P
10191 CLASS="PROGRAMLISTING"
10194 echo -n $"Starting $KIND services: "
10195 daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
10199 echo -n $"Starting $KIND services: "
10200 daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
10204 echo -n $"Starting $KIND services: "
10205 daemon /usr/local/samba/bin/winbindd
10208 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] && touch /var/lock/subsys/smb || \
10217 >The 'stop' function has a corresponding entry to shut down the
10218 services and look s like this:</P
10227 CLASS="PROGRAMLISTING"
10230 echo -n $"Shutting down $KIND services: "
10235 echo -n $"Shutting down $KIND services: "
10240 echo -n $"Shutting down $KIND services: "
10243 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] && rm -f /var/lock/subsys/smb
10252 >If you restart the <B
10262 > daemons at this point, you
10263 should be able to connect to the samba server as a domain member just as
10264 if you were a local user.</P
10272 >11.5.3.7. Configure Winbind and PAM</A
10275 >If you have made it this far, you know that winbindd and samba are working
10276 together. If you want to use winbind to provide authentication for other
10277 services, keep reading. The pam configuration files need to be altered in
10278 this step. (Did you remember to make backups of your original
10282 > files? If not, do it now.)</P
10284 >You will need a pam module to use winbindd with these other services. This
10285 module will be compiled in the <TT
10287 >../source/nsswitch</TT
10289 by invoking the command</P
10296 >make nsswitch/pam_winbind.so</B
10305 >pam_winbind.so</TT
10306 > file should be copied to the location of
10307 your other pam security modules. On my RedHat system, this was the
10318 >cp ../samba/source/nsswitch/pam_winbind.so /lib/security</B
10323 >/etc/pam.d/samba</TT
10324 > file does not need to be changed. I
10325 just left this fileas it was:</P
10334 CLASS="PROGRAMLISTING"
10335 >auth required /lib/security/pam_stack.so service=system-auth
10336 account required /lib/security/pam_stack.so service=system-auth</PRE
10342 >The other services that I modified to allow the use of winbind
10343 as an authentication service were the normal login on the console (or a terminal
10344 session), telnet logins, and ftp service. In order to enable these
10345 services, you may first need to change the entries in
10351 >/etc/inetd.conf</TT
10353 RedHat 7.1 uses the new xinetd.d structure, in this case you need
10354 to change the lines in <TT
10356 >/etc/xinetd.d/telnet</TT
10360 >/etc/xinetd.d/wu-ftp</TT
10370 CLASS="PROGRAMLISTING"
10386 CLASS="PROGRAMLISTING"
10394 For ftp services to work properly, you will also need to either
10395 have individual directories for the domain users already present on
10396 the server, or change the home directory template to a general
10397 directory for all domain users. These can be easily set using
10404 >template homedir</B
10409 >/etc/pam.d/ftp</TT
10410 > file can be changed
10411 to allow winbind ftp access in a manner similar to the
10414 >/etc/pam.d/ftp</TT
10416 changed to look like this:</P
10425 CLASS="PROGRAMLISTING"
10426 >auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
10427 auth sufficient /lib/security/pam_winbind.so
10428 auth required /lib/security/pam_stack.so service=system-auth
10429 auth required /lib/security/pam_shells.so
10430 account sufficient /lib/security/pam_winbind.so
10431 account required /lib/security/pam_stack.so service=system-auth
10432 session required /lib/security/pam_stack.so service=system-auth</PRE
10440 >/etc/pam.d/login</TT
10441 > file can be changed nearly the
10442 same way. It now looks like this:</P
10451 CLASS="PROGRAMLISTING"
10452 >auth required /lib/security/pam_securetty.so
10453 auth sufficient /lib/security/pam_winbind.so
10454 auth sufficient /lib/security/pam_unix.so use_first_pass
10455 auth required /lib/security/pam_stack.so service=system-auth
10456 auth required /lib/security/pam_nologin.so
10457 account sufficient /lib/security/pam_winbind.so
10458 account required /lib/security/pam_stack.so service=system-auth
10459 password required /lib/security/pam_stack.so service=system-auth
10460 session required /lib/security/pam_stack.so service=system-auth
10461 session optional /lib/security/pam_console.so</PRE
10467 >In this case, I added the <B
10469 >auth sufficient /lib/security/pam_winbind.so</B
10471 lines as before, but also added the <B
10473 >required pam_securetty.so</B
10475 above it, to disallow root logins over the network. I also added a
10478 >sufficient /lib/security/pam_unix.so use_first_pass</B
10483 > line to get rid of annoying
10484 double prompts for passwords.</P
10494 >11.6. Limitations</A
10497 >Winbind has a number of limitations in its current
10498 released version that we hope to overcome in future
10505 >Winbind is currently only available for
10506 the Linux operating system, although ports to other operating
10507 systems are certainly possible. For such ports to be feasible,
10508 we require the C library of the target operating system to
10509 support the Name Service Switch and Pluggable Authentication
10510 Modules systems. This is becoming more common as NSS and
10511 PAM gain support among UNIX vendors.</P
10515 >The mappings of Windows NT RIDs to UNIX ids
10516 is not made algorithmically and depends on the order in which
10517 unmapped users or groups are seen by winbind. It may be difficult
10518 to recover the mappings of rid to UNIX id mapping if the file
10519 containing this information is corrupted or destroyed.</P
10523 >Currently the winbind PAM module does not take
10524 into account possible workstation and logon time restrictions
10525 that may be been set for Windows NT users.</P
10535 >11.7. Conclusion</A
10538 >The winbind system, through the use of the Name Service
10539 Switch, Pluggable Authentication Modules, and appropriate
10540 Microsoft RPC calls have allowed us to provide seamless
10541 integration of Microsoft Windows NT domain users on a
10542 UNIX system. The result is a great reduction in the administrative
10543 cost of running a mixed UNIX and NT network.</P
10551 >Chapter 12. OS2 Client HOWTO</A
10567 >12.1.1. How can I configure OS/2 Warp Connect or
10568 OS/2 Warp 4 as a client for Samba?</A
10571 >A more complete answer to this question can be
10573 HREF="http://carol.wins.uva.nl/~leeuw/samba/warp.html"
10575 > http://carol.wins.uva.nl/~leeuw/samba/warp.html</A
10578 >Basically, you need three components:</P
10584 >The File and Print Client ('IBM Peer')
10589 >TCP/IP ('Internet support')
10594 >The "NetBIOS over TCP/IP" driver ('TCPBEUI')
10599 >Installing the first two together with the base operating
10600 system on a blank system is explained in the Warp manual. If Warp
10601 has already been installed, but you now want to install the
10602 networking support, use the "Selective Install for Networking"
10603 object in the "System Setup" folder.</P
10605 >Adding the "NetBIOS over TCP/IP" driver is not described
10606 in the manual and just barely in the online documentation. Start
10607 MPTS.EXE, click on OK, click on "Configure LAPS" and click
10608 on "IBM OS/2 NETBIOS OVER TCP/IP" in 'Protocols'. This line
10609 is then moved to 'Current Configuration'. Select that line,
10610 click on "Change number" and increase it from 0 to 1. Save this
10613 >If the Samba server(s) is not on your local subnet, you
10614 can optionally add IP names and addresses of these servers
10615 to the "Names List", or specify a WINS server ('NetBIOS
10616 Nameserver' in IBM and RFC terminology). For Warp Connect you
10617 may need to download an update for 'IBM Peer' to bring it on
10618 the same level as Warp 4. See the webpage mentioned above.</P
10626 >12.1.2. How can I configure OS/2 Warp 3 (not Connect),
10627 OS/2 1.2, 1.3 or 2.x for Samba?</A
10630 >You can use the free Microsoft LAN Manager 2.2c Client
10633 HREF="ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
10635 > ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/</A
10638 HREF="http://carol.wins.uva.nl/~leeuw/lanman.html"
10640 > http://carol.wins.uva.nl/~leeuw/lanman.html</A
10642 more information on how to install and use this client. In
10643 a nutshell, edit the file \OS2VER in the root directory of
10644 the OS/2 boot partition and add the lines:</P
10653 CLASS="PROGRAMLISTING"
10663 >before you install the client. Also, don't use the
10664 included NE2000 driver because it is buggy. Try the NE2000
10665 or NS2000 driver from
10667 HREF="ftp://ftp.cdrom.com/pub/os2/network/ndis/"
10669 > ftp://ftp.cdrom.com/pub/os2/network/ndis/</A
10679 >12.1.3. Are there any other issues when OS/2 (any version)
10680 is used as a client?</A
10683 >When you do a NET VIEW or use the "File and Print
10684 Client Resource Browser", no Samba servers show up. This can
10685 be fixed by a patch from <A
10686 HREF="http://carol.wins.uva.nl/~leeuw/samba/fix.html"
10688 > http://carol.wins.uva.nl/~leeuw/samba/fix.html</A
10690 The patch will be included in a later version of Samba. It also
10691 fixes a couple of other problems, such as preserving long
10692 filenames when objects are dragged from the Workplace Shell
10693 to the Samba server. </P
10701 >12.1.4. How do I get printer driver download working
10702 for OS/2 clients?</A
10705 >First, create a share called [PRINTDRV] that is
10706 world-readable. Copy your OS/2 driver files there. Note
10707 that the .EA_ files must still be separate, so you will need
10708 to use the original install files, and not copy an installed
10709 driver from an OS/2 system.</P
10711 >Install the NT driver first for that printer. Then,
10712 add to your smb.conf a parameter, "os2 driver map =
10714 CLASS="REPLACEABLE"
10718 >". Then, in the file
10720 CLASS="REPLACEABLE"
10725 name of the NT driver name to the OS/2 driver name as
10728 ><nt driver name> = <os2 driver
10729 name>.<device name>, e.g.:
10730 HP LaserJet 5L = LASERJET.HP LaserJet 5L</P
10732 >You can have multiple drivers mapped in this file.</P
10734 >If you only specify the OS/2 driver name, and not the
10735 device name, the first attempt to download the driver will
10736 actually download the files, but the OS/2 client will tell
10737 you the driver is not available. On the second attempt, it
10738 will work. This is fixed simply by adding the device name
10739 to the mapping, after which it will work on the first attempt.
10749 >Chapter 13. HOWTO Access Samba source code via CVS</A
10757 >13.1. Introduction</A
10760 >Samba is developed in an open environment. Developers use CVS
10761 (Concurrent Versioning System) to "checkin" (also known as
10762 "commit") new source code. Samba's various CVS branches can
10763 be accessed via anonymous CVS using the instructions
10764 detailed in this chapter.</P
10766 >This document is a modified version of the instructions found at
10768 HREF="http://samba.org/samba/cvs.html"
10770 >http://samba.org/samba/cvs.html</A
10779 >13.2. CVS Access to samba.org</A
10782 >The machine samba.org runs a publicly accessible CVS
10783 repository for access to the source code of several packages,
10784 including samba, rsync and jitterbug. There are two main ways of
10785 accessing the CVS server on this host.</P
10792 >13.2.1. Access via CVSweb</A
10795 >You can access the source code via your
10796 favourite WWW browser. This allows you to access the contents of
10797 individual files in the repository and also to look at the revision
10798 history and commit logs of individual files. You can also ask for a diff
10799 listing between any two versions on the repository.</P
10802 HREF="http://samba.org/cgi-bin/cvsweb"
10804 >http://samba.org/cgi-bin/cvsweb</A
10813 >13.2.2. Access via cvs</A
10816 >You can also access the source code via a
10817 normal cvs client. This gives you much more control over you can
10818 do with the repository and allows you to checkout whole source trees
10819 and keep them up to date via normal cvs commands. This is the
10820 preferred method of access if you are a developer and not
10821 just a casual browser.</P
10823 >To download the latest cvs source code, point your
10824 browser at the URL : <A
10825 HREF="http://www.cyclic.com/"
10827 >http://www.cyclic.com/</A
10829 and click on the 'How to get cvs' link. CVS is free software under
10830 the GNU GPL (as is Samba). Note that there are several graphical CVS clients
10831 which provide a graphical interface to the sometimes mundane CVS commands.
10832 Links to theses clients are also available from http://www.cyclic.com.</P
10834 >To gain access via anonymous cvs use the following steps.
10835 For this example it is assumed that you want a copy of the
10836 samba source code. For the other source code repositories
10837 on this system just substitute the correct package name</P
10844 > Install a recent copy of cvs. All you really need is a
10845 copy of the cvs client binary.
10855 >cvs -d :pserver:cvs@samba.org:/cvsroot login</B
10859 > When it asks you for a password type <TT
10874 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba</B
10878 > This will create a directory called samba containing the
10879 latest samba source code (i.e. the HEAD tagged cvs branch). This
10880 currently corresponds to the 3.0 development tree.
10883 > CVS branches other HEAD can be obtained by using the <TT
10889 and defining a tag name. A list of branch tag names can be found on the
10890 "Development" page of the samba web site. A common request is to obtain the
10891 latest 2.2 release code. This could be done by using the following command.
10896 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba</B
10902 > Whenever you want to merge in the latest code changes use
10903 the following command from within the samba directory:
10908 >cvs update -d -P</B
10923 >Primary Domain Controller,