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
41 >This book is a collection of HOWTOs added to Samba documentation over the years.
42 I try to ensure that all are current, but sometimes the is a larger job
43 than one person can maintain. The most recent version of this document
45 HREF=
"http://www.samba.org/"
47 >http://www.samba.org/
</A
49 on the
"Documentation" page. Please send updates to
<A
50 HREF=
"mailto:jerry@samba.org"
66 >How to Install and Test SAMBA
</A
73 >Step
0: Read the man pages
</A
78 >Step
1: Building the Binaries
</A
83 >Step
2: The all important step
</A
88 >Step
3: Create the smb configuration file.
</A
93 >Step
4: Test your config file with
102 >Step
5: Starting the smbd and nmbd
</A
109 >Step
5a: Starting from inetd.conf
</A
114 >Step
5b. Alternative: starting it as a daemon
</A
121 >Step
6: Try listing the shares available on your
127 >Step
7: Try connecting with the unix client
</A
132 >Step
8: Try connecting from a DOS, WfWg, Win9x, WinNT,
133 Win2k, OS/
2, etc... client
</A
138 >What If Things Don't Work?
</A
145 >Diagnosing Problems
</A
155 >Choosing the Protocol Level
</A
160 >Printing from UNIX to a Client PC
</A
170 >Mapping Usernames
</A
175 >Other Character Sets
</A
184 >Integrating MS Windows networks with Samba
</A
196 >Name Resolution in a pure Unix/Linux world
</A
213 >/etc/resolv.conf
</TT
229 >/etc/nsswitch.conf
</TT
237 >Name resolution as used within MS Windows networking
</A
244 >The NetBIOS Name Cache
</A
271 >How browsing functions and how to deploy stable and
272 dependable browsing using Samba
</A
277 >MS Windows security options and how to configure
278 Samba for seemless integration
</A
285 >Use MS Windows NT as an authentication server
</A
290 >Make Samba a member of an MS Windows NT security domain
</A
295 >Configure Samba as an authentication server
</A
307 >MS Windows NT Machine Accounts
</A
316 >Configuration of Samba as ...
</A
323 >LanMan and NT Password Encryption in Samba
2.x
</A
335 >How does it work?
</A
340 >Important Notes About Security
</A
347 >Advantages of SMB Encryption
</A
352 >Advantages of non-encrypted passwords
</A
360 NAME=
"SMBPASSWDFILEFORMAT"
362 >The smbpasswd file
</A
367 >The smbpasswd Command
</A
372 >Setting up Samba to support LanManager Encryption
</A
379 >Hosting a Microsoft Distributed File System tree on Samba
</A
402 >Printing Support in Samba
2.2.x
</A
421 >Creating [print$]
</A
426 >Setting Drivers for Existing Printers
</A
431 >Support a large number of printers
</A
436 >Adding New Printers via the Windows NT APW
</A
441 >Samba and Printer Ports
</A
448 >The Imprints Toolset
</A
455 >What is Imprints?
</A
460 >Creating Printer Driver Packages
</A
465 >The Imprints server
</A
470 >The Installation Client
</A
480 >Migration to from Samba
2.0.x to
2.2.x
</A
487 >security = domain in Samba
2.x
</A
494 >Joining an NT Domain with Samba
2.2</A
499 >Samba and Windows
2000 Domains
</A
504 >Why is this better than security = server?
</A
511 >How to Configure Samba
2.2 as a Primary Domain Controller
</A
518 >Prerequisite Reading
</A
528 >Configuring the Samba Domain Controller
</A
533 >Creating Machine Trust Accounts and Joining Clients
541 >Manually creating machine trust accounts
</A
546 >Creating machine trust accounts
"on the fly"</A
553 >Common Problems and Errors
</A
558 >System Policies and Profiles
</A
563 >What other help can I get ?
</A
568 >Domain Control for Windows
9x/ME
</A
575 >Configuration Instructions: Network Logons
</A
580 >Configuration Instructions: Setting up Roaming User Profiles
</A
587 >Windows NT Configuration
</A
592 >Windows
9X Configuration
</A
597 >Win9X and WinNT Configuration
</A
602 >Windows
9X Profile Setup
</A
607 >Windows NT Workstation
4.0</A
612 >Windows NT Server
</A
617 >Sharing Profiles between W95 and NT Workstation
4.0</A
626 >DOMAIN_CONTROL.txt : Windows NT Domain Control
& Samba
</A
633 >Unifed Logons between Windows NT and UNIX using Winbind
</A
650 >What Winbind Provides
</A
664 >How Winbind Works
</A
671 >Microsoft Remote Procedure Calls
</A
676 >Name Service Switch
</A
681 >Pluggable Authentication Modules
</A
686 >User and Group ID Allocation
</A
698 >Installation and Configuration
</A
715 >UNIX Permission Bits and WIndows NT Access Control Lists
</A
722 >Viewing and changing UNIX permissions using the NT
728 >How to view file security on a Samba share
</A
733 >Viewing file ownership
</A
738 >Viewing file or directory permissions
</A
750 >Directory Permissions
</A
757 >Modifying file or directory permissions
</A
762 >Interaction with the standard Samba create mask
768 >Interaction with the standard Samba file attribute
790 >How can I configure OS/
2 Warp Connect or
791 OS/
2 Warp
4 as a client for Samba?
</A
796 >How can I configure OS/
2 Warp
3 (not Connect),
797 OS/
2 1.2,
1.3 or
2.x for Samba?
</A
802 >Are there any other issues when OS/
2 (any version)
803 is used as a client?
</A
808 >How do I get printer driver download working
818 >HOWTO Access Samba source code via CVS
</A
830 >CVS Access to samba.org
</A
837 >Access via CVSweb
</A
855 >Chapter
1. How to Install and Test SAMBA
</A
863 >1.1. Step
0: Read the man pages
</A
866 >The man pages distributed with SAMBA contain
867 lots of useful info that will help to get you started.
868 If you don't know how to read man pages then try
877 >nroff -man smbd
.8 | more
882 >Other sources of information are pointed to
883 by the Samba web site,
<A
884 HREF=
"http://www.samba.org/"
886 > http://www.samba.org
</A
895 >1.2. Step
1: Building the Binaries
</A
898 >To do this, first run the program
<B
902 > in the source directory. This should automatically
903 configure Samba for your operating system. If you have unusual
904 needs then you may wish to run
</P
917 >first to see what special options you can enable.
930 >will create the binaries. Once it's successfully
931 compiled you can use
</P
943 >to install the binaries and manual pages. You can
944 separately install the binaries and/or man pages using
</P
970 >Note that if you are upgrading for a previous version
971 of Samba you might like to know that the old versions of
972 the binaries will be renamed with a
".old" extension. You
973 can go back to the previous version with
</P
986 >if you find this version a disaster!
</P
994 >1.3. Step
2: The all important step
</A
997 >At this stage you must fetch yourself a
998 coffee or other drink you find stimulating. Getting the rest
999 of the install right can sometimes be tricky, so you will
1000 probably need it.
</P
1002 >If you have installed samba before then you can skip
1011 >1.4. Step
3: Create the smb configuration file.
</A
1014 >There are sample configuration files in the examples
1015 subdirectory in the distribution. I suggest you read them
1016 carefully so you can see how the options go together in
1017 practice. See the man page for all the options.
</P
1019 >The simplest useful configuration file would be
1020 something like this:
</P
1029 CLASS=
"PROGRAMLISTING"
1042 >which would allow connections by anyone with an
1043 account on the server, using either their login name or
1044 "homes" as the service name. (Note that I also set the
1045 workgroup that Samba is part of. See BROWSING.txt for defails)
</P
1054 > file. You need to create it
1057 >Make sure you put the smb.conf file in the same place
1058 you specified in the
<TT
1061 > (the default is to
1064 >/usr/local/samba/lib/
</TT
1067 >For more information about security settings for the
1068 [homes] share please refer to the document UNIX_SECURITY.txt.
</P
1076 >1.5. Step
4: Test your config file with
1083 >It's important that you test the validity of your
1087 > file using the testparm program.
1088 If testparm runs OK then it will list the loaded services. If
1089 not it will give an error message.
</P
1091 >Make sure it runs OK and that the services look
1092 resonable before proceeding.
</P
1100 >1.6. Step
5: Starting the smbd and nmbd
</A
1103 >You must choose to start smbd and nmbd either
1104 as daemons or from
<B
1108 to do both! Either you can put them in
<TT
1111 > and have them started on demand
1115 >, or you can start them as
1116 daemons either from the command line or in
<TT
1119 >. See the man pages for details
1120 on the command line options. Take particular care to read
1121 the bit about what user you need to be in order to start
1122 Samba. In many cases you must be root.
</P
1124 >The main advantage of starting
<B
1131 > as a daemon is that they will
1132 respond slightly more quickly to an initial connection
1133 request. This is, however, unlikely to be a problem.
</P
1140 >1.6.1. Step
5a: Starting from inetd.conf
</A
1143 >NOTE; The following will be different if
1144 you use NIS or NIS+ to distributed services maps.
</P
1150 What is defined at port
139/tcp. If nothing is defined
1151 then add a line like this:
</P
1156 >netbios-ssn
139/tcp
</B
1160 >similarly for
137/udp you should have an entry like:
</P
1165 >netbios-ns
137/udp
</B
1171 >/etc/inetd.conf
</TT
1173 and add two lines something like this:
</P
1182 CLASS=
"PROGRAMLISTING"
1183 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
1184 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
1191 >The exact syntax of
<TT
1193 >/etc/inetd.conf
</TT
1195 varies between unixes. Look at the other entries in inetd.conf
1198 >NOTE: Some unixes already have entries like netbios_ns
1199 (note the underscore) in
<TT
1203 You must either edit
<TT
1209 >/etc/inetd.conf
</TT
1210 > to make them consistant.
</P
1212 >NOTE: On many systems you may need to use the
1213 "interfaces" option in smb.conf to specify the IP address
1214 and netmask of your interfaces. Run
<B
1218 as root if you don't know what the broadcast is for your
1222 > tries to determine it at run
1223 time, but fails on somunixes. See the section on
"testing nmbd"
1224 for a method of finding if you need to do this.
</P
1226 >!!!WARNING!!! Many unixes only accept around
5
1227 parameters on the command line in
<TT
1231 This means you shouldn't use spaces between the options and
1232 arguments, or you should use a script, and start the script
1241 >, perhaps just send
1242 it a HUP. If you have installed an earlier version of
<B
1245 > then you may need to kill nmbd as well.
</P
1253 >1.6.2. Step
5b. Alternative: starting it as a daemon
</A
1256 >To start the server as a daemon you should create
1257 a script something like this one, perhaps calling
1270 CLASS=
"PROGRAMLISTING"
1272 /usr/local/samba/bin/smbd -D
1273 /usr/local/samba/bin/nmbd -D
1280 >then make it executable with
<B
1286 >You can then run
<B
1290 hand or execute it from
<TT
1296 >To kill it send a kill signal to the processes
1305 >NOTE: If you use the SVR4 style init system then
1306 you may like to look at the
<TT
1308 >examples/svr4-startup
</TT
1310 script to make Samba fit into that system.
</P
1319 >1.7. Step
6: Try listing the shares available on your
1339 >Your should get back a list of shares available on
1340 your server. If you don't then something is incorrectly setup.
1341 Note that this method can also be used to see what shares
1342 are available on other LanManager clients (such as WfWg).
</P
1344 >If you choose user level security then you may find
1345 that Samba requests a password before it will list the shares.
1349 > man page for details. (you
1350 can force it to list the shares without a password by
1351 adding the option -U% to the command line. This will not work
1352 with non-Samba servers)
</P
1360 >1.8. Step
7: Try connecting with the unix client
</A
1372 > //yourhostname/aservice
</I
1384 would be the name of the host where you installed
<B
1393 any service you have defined in the
<TT
1397 file. Try your user name if you just have a [homes] section
1403 >For example if your unix host is bambi and your login
1404 name is fred you would type:
</P
1412 >smbclient //bambi/fred
1423 >1.9. Step
8: Try connecting from a DOS, WfWg, Win9x, WinNT,
1424 Win2k, OS/
2, etc... client
</A
1427 >Try mounting disks. eg:
</P
1431 >C:\WINDOWS\
> </TT
1435 >net use d: \\servername\service
1440 >Try printing. eg:
</P
1444 >C:\WINDOWS\
> </TT
1449 \\servername\spoolservice
</B
1455 >C:\WINDOWS\
> </TT
1464 >Celebrate, or send me a bug report!
</P
1472 >1.10. What If Things Don't Work?
</A
1475 >If nothing works and you start to think
"who wrote
1476 this pile of trash" then I suggest you do step
2 again (and
1477 again) till you calm down.
</P
1479 >Then you might read the file DIAGNOSIS.txt and the
1480 FAQ. If you are still stuck then try the mailing list or
1481 newsgroup (look in the README for details). Samba has been
1482 successfully installed at thousands of sites worldwide, so maybe
1483 someone else has hit your problem and has overcome it. You could
1484 also use the WWW site to scan back issues of the samba-digest.
</P
1486 >When you fix the problem PLEASE send me some updates to the
1487 documentation (or source code) so that the next person will find it
1495 >1.10.1. Diagnosing Problems
</A
1498 >If you have instalation problems then go to
1502 > to try to find the
1511 >1.10.2. Scope IDs
</A
1514 >By default Samba uses a blank scope ID. This means
1515 all your windows boxes must also have a blank scope ID.
1516 If you really want to use a non-blank scope ID then you will
1517 need to use the -i
<scope
> option to nmbd, smbd, and
1518 smbclient. All your PCs will need to have the same setting for
1519 this to work. I do not recommend scope IDs.
</P
1527 >1.10.3. Choosing the Protocol Level
</A
1530 >The SMB protocol has many dialects. Currently
1531 Samba supports
5, called CORE, COREPLUS, LANMAN1,
1534 >You can choose what maximum protocol to support
1538 > file. The default is
1539 NT1 and that is the best for the vast majority of sites.
</P
1541 >In older versions of Samba you may have found it
1542 necessary to use COREPLUS. The limitations that led to
1543 this have mostly been fixed. It is now less likely that you
1544 will want to use less than LANMAN1. The only remaining advantage
1545 of COREPLUS is that for some obscure reason WfWg preserves
1546 the case of passwords in this protocol, whereas under LANMAN1,
1547 LANMAN2 or NT1 it uppercases all passwords before sending them,
1548 forcing you to use the
"password level=" option in some cases.
</P
1550 >The main advantage of LANMAN2 and NT1 is support for
1551 long filenames with some clients (eg: smbclient, Windows NT
1554 >See the smb.conf(
5) manual page for more details.
</P
1556 >Note: To support print queue reporting you may find
1557 that you have to use TCP/IP as the default protocol under
1558 WfWg. For some reason if you leave Netbeui as the default
1559 it may break the print queue reporting on some systems.
1560 It is presumably a WfWg bug.
</P
1568 >1.10.4. Printing from UNIX to a Client PC
</A
1571 >To use a printer that is available via a smb-based
1572 server from a unix host you will need to compile the
1573 smbclient program. You then need to install the script
1574 "smbprint". Read the instruction in smbprint for more details.
1577 >There is also a SYSV style script that does much
1578 the same thing called smbprint.sysv. It contains instructions.
</P
1589 >One area which sometimes causes trouble is locking.
</P
1591 >There are two types of locking which need to be
1592 performed by a SMB server. The first is
"record locking"
1593 which allows a client to lock a range of bytes in a open file.
1594 The second is the
"deny modes" that are specified when a file
1597 >Samba supports
"record locking" using the fcntl() unix system
1598 call. This is often implemented using rpc calls to a rpc.lockd process
1599 running on the system that owns the filesystem. Unfortunately many
1600 rpc.lockd implementations are very buggy, particularly when made to
1601 talk to versions from other vendors. It is not uncommon for the
1602 rpc.lockd to crash.
</P
1604 >There is also a problem translating the
32 bit lock
1605 requests generated by PC clients to
31 bit requests supported
1606 by most unixes. Unfortunately many PC applications (typically
1607 OLE2 applications) use byte ranges with the top bit set
1608 as semaphore sets. Samba attempts translation to support
1609 these types of applications, and the translation has proved
1610 to be quite successful.
</P
1612 >Strictly a SMB server should check for locks before
1613 every read and write call on a file. Unfortunately with the
1614 way fcntl() works this can be slow and may overstress the
1615 rpc.lockd. It is also almost always unnecessary as clients
1616 are supposed to independently make locking calls before reads
1617 and writes anyway if locking is important to them. By default
1618 Samba only makes locking calls when explicitly asked
1619 to by a client, but if you set
"strict locking = yes" then it will
1620 make lock checking calls on every read and write.
</P
1622 >You can also disable by range locking completely
1623 using
"locking = no". This is useful for those shares that
1624 don't support locking or don't need it (such as cdroms). In
1625 this case Samba fakes the return codes of locking calls to
1626 tell clients that everything is OK.
</P
1628 >The second class of locking is the
"deny modes". These
1629 are set by an application when it opens a file to determine
1630 what types of access should be allowed simultaneously with
1631 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
1632 or DENY_ALL. There are also special compatability modes called
1633 DENY_FCB and DENY_DOS.
</P
1635 >You can disable share modes using
"share modes = no".
1636 This may be useful on a heavily loaded server as the share
1637 modes code is very slow. See also the FAST_SHARE_MODES
1638 option in the Makefile for a way to do full share modes
1639 very fast using shared memory (if your OS supports it).
</P
1647 >1.10.6. Mapping Usernames
</A
1650 >If you have different usernames on the PCs and
1651 the unix server then take a look at the
"username map" option.
1652 See the smb.conf man page for details.
</P
1660 >1.10.7. Other Character Sets
</A
1663 >If you have problems using filenames with accented
1664 characters in them (like the German, French or Scandinavian
1665 character sets) then I recommmend you look at the
"valid chars"
1666 option in smb.conf and also take a look at the validchars
1667 package in the examples directory.
</P
1676 >Chapter
2. Integrating MS Windows networks with Samba
</A
1687 >To identify the key functional mechanisms of MS Windows networking
1688 to enable the deployment of Samba as a means of extending and/or
1689 replacing MS Windows NT/
2000 technology.
</P
1691 >We will examine:
</P
1698 >Name resolution in a pure Unix/Linux TCP/IP
1704 >Name resolution as used within MS Windows
1710 >How browsing functions and how to deploy stable
1711 and dependable browsing using Samba
1716 >MS Windows security options and how to
1717 configure Samba for seemless integration
1722 >Configuration of Samba as:
</P
1729 >A stand-alone server
</P
1733 >An MS Windows NT
3.x/
4.0 security domain member
1738 >An alternative to an MS Windows NT
3.x/
4.0 Domain Controller
1751 >2.2. Name Resolution in a pure Unix/Linux world
</A
1754 >The key configuration files :
</P
1767 >Contains a static list of IP Addresses and names.
1777 CLASS=
"PROGRAMLISTING"
1778 > 127.0.0.1 localhost localhost.localdomain
1779 192.168.1.1 bigbox.caldera.com bigbox alias4box
</PRE
1789 name resolution mechanism so that uses do not need to remember
1792 >Network packets that are sent over the physical network transport
1793 layer communicate not via IP addresses but rather using the Media
1794 Access Control address, or MAC address. IP Addresses are currently
1795 32 bits in length and are typically presented as four (
4) decimal
1796 numbers that are separated by a dot (or period). eg:
168.192.1.1</P
1798 >MAC Addresses use
48 bits (or
6 bytes) and are typically represented
1799 as two digit hexadecimal numbers separated by colons. eg:
1800 40:
8e:
0a:
12:
34:
56</P
1802 >Every network interfrace must have an MAC address. Associated with
1803 a MAC address there may be one or more IP addresses. There is NO
1804 relationship between an IP address and a MAC address, all such assignments
1805 are arbitary or discretionary in nature. At the most basic level all
1806 network communications takes place using MAC addressing. Since MAC
1807 addresses must be globally unique, and generally remains fixed for
1808 any particular interface, the assignment of an IP address makes sense
1809 from a network management perspective. More than one IP address can
1810 be assigned per MAC address. One address must be the primary IP address,
1811 this is the address that will be returned in the ARP reply.
</P
1813 >When a user or a process wants to communicate with another machine
1814 the protocol implementation ensures that the
"machine name" or
"host
1815 name" is resolved to an IP address in a manner that is controlled
1816 by the TCP/IP configuration control files. The file
1820 > is one such file.
</P
1822 >When the IP address of the destination interface has been
1823 determined a protocol called ARP/RARP isused to identify
1824 the MAC address of the target interface. ARP stands for Address
1825 Resolution Protocol, and is a broadcast oriented method that
1826 uses UDP (User Datagram Protocol) to send a request to all
1827 interfaces on the local network segment using the all
1's MAC
1828 address. Network interfaces are programmed to respond to two
1829 MAC addresses only; their own unique address and the address
1830 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will
1831 contain the MAC address and the primary IP address for each
1837 > file is foundational to all
1838 Unix/Linux TCP/IP installations and as a minumum will contain
1839 the localhost and local network interface IP addresses and the
1840 primary names by which they are known within the local machine.
1841 This file helps to prime the pump so that a basic level of name
1842 resolution can exist before any other method of name resolution
1843 becomes available.
</P
1853 >/etc/resolv.conf
</TT
1857 >This file tells the name resolution libraries:
</P
1863 >The name of the domain to which the machine
1869 >The name(s) of any domains that should be
1870 automatically searched when trying to resolve unqualified
1871 host names to their IP address
1876 >The name or IP address of available Domain
1877 Name Servers that may be asked to perform name to address
1898 > is the primary means by
1899 which the setting in /etc/resolv.conf may be affected. It is a
1900 critical configuration file. This file controls the order by
1901 which name resolution may procede. The typical structure is:
</P
1910 CLASS=
"PROGRAMLISTING"
1918 >then both addresses should be returned. Please refer to the
1919 man page for host.conf for further details.
</P
1929 >/etc/nsswitch.conf
</TT
1933 >This file controls the actual name resolution targets. The
1934 file typically has resolver object specifications as follows:
</P
1943 CLASS=
"PROGRAMLISTING"
1944 > # /etc/nsswitch.conf
1946 # Name Service Switch configuration file.
1950 # Alternative entries for password authentication are:
1951 # passwd: compat files nis ldap winbind
1955 hosts: files nis dns
1956 # Alternative entries for host name resolution are:
1957 # hosts: files dns nis nis+ hesoid db compat ldap wins
1958 networks: nis files dns
1961 protocols: nis files
1963 services: nis files
</PRE
1969 >Of course, each of these mechanisms requires that the appropriate
1970 facilities and/or services are correctly configured.
</P
1972 >It should be noted that unless a network request/message must be
1973 sent, TCP/IP networks are silent. All TCP/IP communications assumes a
1974 principal of speaking only when necessary.
</P
1976 >Samba version
2.2.0 will add Linux support for extensions to
1977 the name service switch infrastructure so that linux clients will
1978 be able to obtain resolution of MS Windows NetBIOS names to IP
1979 Addresses. To gain this functionality Samba needs to be compiled
1980 with appropriate arguments to the make command (ie:
<B
1983 nsswitch/libnss_wins.so
</B
1984 >). The resulting library should
1985 then be installed in the
<TT
1989 the
"wins" parameter needs to be added to the
"hosts:" line in
1992 >/etc/nsswitch.conf
</TT
1993 > file. At this point it
1994 will be possible to ping any MS Windows machine by it's NetBIOS
1995 machine name, so long as that machine is within the workgroup to
1996 which both the samba machine and the MS Windows machine belong.
</P
2005 >2.3. Name resolution as used within MS Windows networking
</A
2008 >MS Windows networking is predicated about the name each machine
2009 is given. This name is known variously (and inconsistently) as
2010 the
"computer name",
"machine name",
"networking name",
"netbios name",
2011 "SMB name". All terms mean the same thing with the exception of
2012 "netbios name" which can apply also to the name of the workgroup or the
2013 domain name. The terms
"workgroup" and
"domain" are really just a
2014 simply name with which the machine is associated. All NetBIOS names
2015 are exactly
16 characters in length. The
16th character is reserved.
2016 It is used to store a one byte value that indicates service level
2017 information for the NetBIOS name that is registered. A NetBIOS machine
2018 name is therefore registered for each service type that is provided by
2019 the client/server.
</P
2021 >The following are typical NetBIOS name/service type registrations:
</P
2030 CLASS=
"PROGRAMLISTING"
2031 > Unique NetBIOS Names:
2032 MACHINENAME
<00> = Server Service is running on MACHINENAME
2033 MACHINENAME
<03> = Generic Machine Name (NetBIOS name)
2034 MACHINENAME
<20> = LanMan Server service is running on MACHINENAME
2035 WORKGROUP
<1b
> = Domain Master Browser
2038 WORKGROUP
<03> = Generic Name registered by all members of WORKGROUP
2039 WORKGROUP
<1c
> = Domain Controllers / Netlogon Servers
2040 WORKGROUP
<1d
> = Local Master Browsers
2041 WORKGROUP
<1e
> = Internet Name Resolvers
</PRE
2047 >It should be noted that all NetBIOS machines register their own
2048 names as per the above. This is in vast contrast to TCP/IP
2049 installations where traditionally the system administrator will
2050 determine in the /etc/hosts or in the DNS database what names
2051 are associated with each IP address.
</P
2053 >One further point of clarification should be noted, the
<TT
2057 file and the DNS records do not provide the NetBIOS name type information
2058 that MS Windows clients depend on to locate the type of service that may
2059 be needed. An example of this is what happens when an MS Windows client
2060 wants to locate a domain logon server. It find this service and the IP
2061 address of a server that provides it by performing a lookup (via a
2062 NetBIOS broadcast) for enumeration of all machines that have
2063 registered the name type *
<1c
>. A logon request is then sent to each
2064 IP address that is returned in the enumerated list of IP addresses. Which
2065 ever machine first replies then ends up providing the logon services.
</P
2067 >The name
"workgroup" or
"domain" really can be confusing since these
2068 have the added significance of indicating what is the security
2069 architecture of the MS Windows network. The term
"workgroup" indicates
2070 that the primary nature of the network environment is that of a
2071 peer-to-peer design. In a WORKGROUP all machines are responsible for
2072 their own security, and generally such security is limited to use of
2073 just a password (known as SHARE MORE security). In most situations
2074 with peer-to-peer networking the users who control their own machines
2075 will simply opt to have no security at all. It is possible to have
2076 USER MODE security in a WORKGROUP environment, thus requiring use
2077 of a user name and a matching password.
</P
2079 >MS Windows networking is thus predetermined to use machine names
2080 for all local and remote machine message passing. The protocol used is
2081 called Server Message Block (SMB) and this is implemented using
2082 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can
2083 be encapsulated using LLC (Logical Link Control) protocol - in which case
2084 the resulting protocol is called NetBEUI (Network Basic Extended User
2085 Interface). NetBIOS can also be run over IPX (Internetworking Packet
2086 Exchange) protocol as used by Novell NetWare, and it can be run
2087 over TCP/IP protocols - in which case the resulting protocol is called
2088 NBT or NetBT, the NetBIOS over TCP/IP.
</P
2090 >MS Windows machines use a complex array of name resolution mechanisms.
2091 Since we are primarily concerned with TCP/IP this demonstration is
2092 limited to this area.
</P
2099 >2.3.1. The NetBIOS Name Cache
</A
2102 >All MS Windows machines employ an in memory buffer in which is
2103 stored the NetBIOS names and their IP addresses for all external
2104 machines that that the local machine has communicated with over the
2105 past
10-
15 minutes. It is more efficient to obtain an IP address
2106 for a machine from the local cache than it is to go through all the
2107 configured name resolution mechanisms.
</P
2109 >If a machine whose name is in the local name cache has been shut
2110 down before the name had been expired and flushed from the cache, then
2111 an attempt to exchange a message with that machine will be subject
2112 to time-out delays. ie: It's name is in the cache, so a name resolution
2113 lookup will succeed, but the machine can not respond. This can be
2114 frustrating for users - but it is a characteristic of the protocol.
</P
2116 >The MS Windows utility that allows examination of the NetBIOS
2117 name cache is called
"nbtstat". The Samba equivalent of this
2118 is called
"nmblookup".
</P
2126 >2.3.2. The LMHOSTS file
</A
2129 >This file is usually located in MS Windows NT
4.0 or
2132 >C:\WINNT\SYSTEM32\DRIVERS\ETC
</TT
2134 the IP Address and the machine name in matched pairs. The
2138 > file performs NetBIOS name
2139 to IP address mapping oriented.
</P
2141 >It typically looks like:
</P
2150 CLASS=
"PROGRAMLISTING"
2151 > # Copyright (c)
1998 Microsoft Corp.
2153 # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
2154 # over TCP/IP) stack for Windows98
2156 # This file contains the mappings of IP addresses to NT computernames
2157 # (NetBIOS) names. Each entry should be kept on an individual line.
2158 # The IP address should be placed in the first column followed by the
2159 # corresponding computername. The address and the comptername
2160 # should be separated by at least one space or tab. The
"#" character
2161 # is generally used to denote the start of a comment (see the exceptions
2164 # This file is compatible with Microsoft LAN Manager
2.x TCP/IP lmhosts
2165 # files and offers the following extensions:
2168 # #DOM:
<domain
>
2169 # #INCLUDE
<filename
>
2172 # \
0xnn (non-printing character support)
2174 # Following any entry in the file with the characters
"#PRE" will cause
2175 # the entry to be preloaded into the name cache. By default, entries are
2176 # not preloaded, but are parsed only after dynamic name resolution fails.
2178 # Following an entry with the
"#DOM:<domain>" tag will associate the
2179 # entry with the domain specified by
<domain
>. This affects how the
2180 # browser and logon services behave in TCP/IP environments. To preload
2181 # the host name associated with #DOM entry, it is necessary to also add a
2182 # #PRE to the line. The
<domain
> is always preloaded although it will not
2183 # be shown when the name cache is viewed.
2185 # Specifying
"#INCLUDE <filename>" will force the RFC NetBIOS (NBT)
2186 # software to seek the specified
<filename
> and parse it as if it were
2187 # local.
<filename
> is generally a UNC-based name, allowing a
2188 # centralized lmhosts file to be maintained on a server.
2189 # It is ALWAYS necessary to provide a mapping for the IP address of the
2190 # server prior to the #INCLUDE. This mapping must use the #PRE directive.
2191 # In addtion the share
"public" in the example below must be in the
2192 # LanManServer list of
"NullSessionShares" in order for client machines to
2193 # be able to read the lmhosts file successfully. This key is under
2194 # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
2195 # in the registry. Simply add
"public" to the list found there.
2197 # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
2198 # statements to be grouped together. Any single successful include
2199 # will cause the group to succeed.
2201 # Finally, non-printing characters can be embedded in mappings by
2202 # first surrounding the NetBIOS name in quotations, then using the
2203 # \
0xnn notation to specify a hex value for a non-printing character.
2205 # The following example illustrates all of these extensions:
2207 #
102.54.94.97 rhino #PRE #DOM:networking #net group's DC
2208 #
102.54.94.102 "appname \0x14" #special app server
2209 #
102.54.94.123 popular #PRE #source server
2210 #
102.54.94.117 localsrv #PRE #needed for the include
2213 # #INCLUDE \\localsrv\public\lmhosts
2214 # #INCLUDE \\rhino\public\lmhosts
2217 # In the above example, the
"appname" server contains a special
2218 # character in its name, the
"popular" and
"localsrv" server names are
2219 # preloaded, and the
"rhino" server name is specified so it can be used
2220 # to later #INCLUDE a centrally maintained lmhosts file if the
"localsrv"
2221 # system is unavailable.
2223 # Note that the whole file is parsed including comments on each lookup,
2224 # so keeping the number of comments to a minimum will improve performance.
2225 # Therefore it is not advisable to simply add lmhosts file entries onto the
2226 # end of this file.
</PRE
2238 >2.3.3. HOSTS file
</A
2241 >This file is usually located in MS Windows NT
4.0 or
2000 in
2244 >C:\WINNT\SYSTEM32\DRIVERS\ETC
</TT
2246 the IP Address and the IP hostname in matched pairs. It can be
2247 used by the name resolution infrastructure in MS Windows, depending
2248 on how the TCP/IP environment is configured. This file is in
2249 every way the equivalent of the Unix/Linux
<TT
2260 >2.3.4. DNS Lookup
</A
2263 >This capability is configured in the TCP/IP setup area in the network
2264 configuration facility. If enabled an elaborate name resolution sequence
2265 is followed the precise nature of which isdependant on what the NetBIOS
2266 Node Type parameter is configured to. A Node Type of
0 means use
2267 NetBIOS broadcast (over UDP broadcast) is first used if the name
2268 that is the subject of a name lookup is not found in the NetBIOS name
2269 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to
2270 Node Type
8, then a NetBIOS Unicast (over UDP Unicast) is sent to the
2271 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast
2280 >2.3.5. WINS Lookup
</A
2283 >Refer to above details for section
<EM
2286 WINS (Windows Internet Name Server) service is the equivaent of the
2287 rfc1001/
1002 specified NBNS (NetBIOS Name Server). A WINS server stores
2288 the names and IP addresses that are registered by a Windows client
2289 if the TCP/IP setup has been given at least one WINS Server IP Address.
</P
2291 >To configure Samba to be a WINS server the following parameter needs
2292 to be added to the
<TT
2304 CLASS=
"PROGRAMLISTING"
2305 > wins support = Yes
</PRE
2311 >To configure Samba to use a WINS server the following parameters are
2312 needed in the smb.conf file:
</P
2321 CLASS=
"PROGRAMLISTING"
2340 of the WINS server.
</P
2349 >2.4. How browsing functions and how to deploy stable and
2350 dependable browsing using Samba
</A
2353 >As stated above, MS Windows machines register their NetBIOS names
2354 (ie: the machine name for each service type in operation) on start
2355 up. Also, as stated above, the exact method by which this name registration
2356 takes place is determined by whether or not the MS Windows client/server
2357 has been given a WINS server address, whether or not LMHOSTS lookup
2358 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.
</P
2360 >In the case where there is no WINS server all name registrations as
2361 well as name lookups are done by UDP broadcast. This isolates name
2362 resolution to the local subnet, unless LMHOSTS is used to list all
2363 names and IP addresses. In such situations Samba provides a means by
2364 which the samba server name may be forcibly injected into the browse
2365 list of a remote MS Windows network (using the
"remote announce" parameter).
</P
2367 >Where a WINS server is used, the MS Windows client will use UDP
2368 unicast to register with the WINS server. Such packets can be routed
2369 and thus WINS allows name resolution to function across routed networks.
</P
2371 >During the startup process an election will take place to create a
2372 local master browser if one does not already exist. On each NetBIOS network
2373 one machine will be elected to function as the domain master browser. This
2374 domain browsing has nothing to do with MS security domain control.
2375 Instead, the domain master browser serves the role of contacting each local
2376 master browser (found by asking WINS or from LMHOSTS) and exchanging browse
2377 list contents. This way every master browser will eventually obtain a complete
2378 list of all machines that are on the network. Every
11-
15 minutes an election
2379 is held to determine which machine will be the master browser. By nature of
2380 the election criteria used, the machine with the highest uptime, or the
2381 most senior protocol version, or other criteria, will win the election
2382 as domain master browser.
</P
2384 >Clients wishing to browse the network make use of this list, but also depend
2385 on the availability of correct name resolution to the respective IP
2386 address/addresses.
</P
2388 >Any configuration that breaks name resolution and/or browsing intrinsics
2389 will annoy users because they will have to put up with protracted
2390 inability to use the network services.
</P
2392 >Samba supports a feature that allows forced synchonisation
2393 of browse lists across routed networks using the
"remote
2394 browse sync" parameter in the smb.conf file. This causes Samba
2395 to contact the local master browser on a remote network and
2396 to request browse list synchronisation. This effectively bridges
2397 two networks that are separated by routers. The two remote
2398 networks may use either broadcast based name resolution or WINS
2399 based name resolution, but it should be noted that the
"remote
2400 browse sync" parameter provides browse list synchronisation - and
2401 that is distinct from name to address resolution, in other
2402 words, for cross subnet browsing to function correctly it is
2403 essential that a name to address resolution mechanism be provided.
2404 This mechanism could be via DNS,
<TT
2416 >2.5. MS Windows security options and how to configure
2417 Samba for seemless integration
</A
2420 >MS Windows clients may use encrypted passwords alone, or encrypted
2421 as well as plain text passwords in the authentication process. It
2422 should be realized that with the SMB protocol the password is passed
2423 over the network either in plain text or encrypted. When encrypted
2424 passwords are used a password that has been entered by the user is
2425 encrypted in two ways:
</P
2431 >The case preserved password is encrypted
2432 using an MD5/DES one way hash
2437 >The case is converted to upper case and then
2438 encrypted using an MD5/DES one way hash
</P
2442 >Both of these enrypted passwords are sent over the network
2443 in the one authentication datagram.
</P
2445 >MS Windows
95 pre-service pack
1, MS Windows NT versions
3.x
2446 and version
4.0 pre-service pack
3 will use either mode of
2447 password authentication. All versions of MS Windows that follow
2448 these versions no longer support plain text passwords by default.
</P
2450 >MS Windows clients have a habit of dropping network mappings that
2451 have been idle for
10 minutes or longer. When the user attempts to
2452 use the mapped drive connection that has been dropped the SMB protocol
2453 has a mechanism by which the connection can be re-established using
2454 a cached copy of the password.
</P
2456 >When Microsoft changed the default password mode, they dropped support for
2457 caching of the plain text password. This means that when the registry
2458 parameter is changed to re-enable use of plain text passwords it appears to
2459 work, but when a dropped mapping attempts to revalidate it will fail if
2460 the remote authentication server does not support encrypted passwords.
2461 This means that it is definitely not a good idea to re-enable plain text
2462 password support in such clients.
</P
2464 >It is recommended that the following parameters be added to the
2474 CLASS=
"PROGRAMLISTING"
2475 > passsword level =
8
2476 username level =
8</PRE
2482 >these configuration parameters will compensate for the fact that
2483 in some circumstances MS Windows and MS DOS clients may twiddle the
2484 password that has been supplied by the user by converting characters to
2485 upper case. The above entries will try every combination of upper and
2486 lower case for the first
8 characters. Please refer to the man page
2487 for smb.conf for more information on use of these parameters.
</P
2489 >The best option to adopt is to enable support for encrypted passwords
2490 where ever Samba is used. There are three configuration possibilities
2491 for support of encrypted passwords:
</P
2498 >2.5.1. Use MS Windows NT as an authentication server
</A
2501 >This method involves the additions of the following parameters
2502 in the smb.conf file:
</P
2511 CLASS=
"PROGRAMLISTING"
2512 > encrypt passwords = Yes
2514 password server =
"NetBIOS_name_of_PDC"</PRE
2520 >There are two ways of identifying whether or not a username and
2521 password pair was valid or not. One uses the reply information provided
2522 as part of the authentication messaging process, the other uses
2523 just and error code.
</P
2525 >The down-side of this mode of configuration is the fact that
2526 for security reasons Samba will send the password server a bogus
2527 username and a bogus password and if the remote server fails to
2528 reject the username and password pair then an alternative mode
2529 of identification of validation is used. Where a site uses password
2530 lock out after a certain number of failed authentication attempts
2531 this will result in user lockouts.
</P
2533 >Use of this mode of authentication does require there to be
2534 a standard Unix account for the user, this account can be blocked
2535 to prevent logons by other than MS Windows clients.
</P
2543 >2.5.2. Make Samba a member of an MS Windows NT security domain
</A
2546 >This method involves additon of the following paramters in the smb.conf file:
</P
2555 CLASS=
"PROGRAMLISTING"
2556 > encrypt passwords = Yes
2558 workgroup =
"name of NT domain"
2559 password server = *
</PRE
2565 >The use of the
"*" argument to
"password server" will cause samba
2566 to locate the domain controller in a way analogous to the way
2567 this is done within MS Windows NT.
</P
2569 >In order for this method to work the Samba server needs to join the
2570 MS Windows NT security domain. This is done as follows:
</P
2576 >On the MS Windows NT domain controller using
2577 the Server Manager add a machine account for the Samba server.
2582 >Next, on the Linux system execute:
2585 >smbpasswd -r PDC_NAME -j DOMAIN_NAME
</B
2591 >Use of this mode of authentication does require there to be
2592 a standard Unix account for the user, this account can be
2593 blocked to prevent logons by other than MS Windows clients.
</P
2601 >2.5.3. Configure Samba as an authentication server
</A
2604 >This mode of authentication demands that there be on the
2605 Unix/Linux system both a Unix style account as well as and
2606 smbpasswd entry for the user. The Unix system account can be
2607 locked if required as only the encrypted password will be
2608 used for SMB client authentication.
</P
2610 >This method involves addition of the following parameters to
2611 the smb.conf file:
</P
2620 CLASS=
"PROGRAMLISTING"
2621 > encrypt passwords = Yes
2622 security = user
</PRE
2628 >in order for this method to work a Unix system account needs
2629 to be created for each user, as well as for each MS Windows NT/
2000
2630 machine. The following structure is required.
</P
2640 >A user account that may provide a home directory should be
2641 created. The following Linux system commands are typical of
2642 the procedure for creating an account.
</P
2651 CLASS=
"PROGRAMLISTING"
2652 > # useradd -s /bin/bash -d /home/
"userid" -m
2661 # smbpasswd -a
"userid"
2679 >2.5.3.2. MS Windows NT Machine Accounts
</A
2682 >These are required only when Samba is used as a domain
2683 controller. Refer to the Samba-PDC-HOWTO for more details.
</P
2692 CLASS=
"PROGRAMLISTING"
2693 > # useradd -a /bin/false -d /dev/null
"machine_name"\$
2694 # passwd -l
"machine_name"\$
2695 # smbpasswd -a -m
"machine_name"</PRE
2709 >2.6. Configuration of Samba as ...
</A
2716 >A Stand-alone server - No special action is needed
2717 other than to create user accounts. Stand-alone servers do NOT
2718 provide network logon services, meaning that machines that use this
2719 server do NOT perform a domain logon but instead make use only of
2720 the MS Windows logon which is local to the MS Windows
2726 >An MS Windows NT
3.x/
4.0 security domain member -
2727 Refer to the previous section(s) above.
2732 >An alternative to an MS Windows NT
3.x/
4.0
2733 Domain Controller - In the smb.conf file the following parameters
2745 CLASS=
"PROGRAMLISTING"
2746 >## please refer to the Samba PDC HOWTO chapter later in
2747 ## this collection for more details
2750 ; an OS level of
33 or more is recommended
2754 path = /somewhare/in/file/system
2756 available = yes
</PRE
2768 >Chapter
3. LanMan and NT Password Encryption in Samba
2.x
</A
2776 >3.1. Introduction
</A
2779 >With the development of LanManager and Windows NT
2780 compatible password encryption for Samba, it is now able
2781 to validate user connections in exactly the same way as
2782 a LanManager or Windows NT server.
</P
2784 >This document describes how the SMB password encryption
2785 algorithm works and what issues there are in choosing whether
2786 you want to use it. You should read it carefully, especially
2787 the part about security and the
"PROS and CONS" section.
</P
2795 >3.2. How does it work?
</A
2798 >LanManager encryption is somewhat similar to UNIX
2799 password encryption. The server uses a file containing a
2800 hashed value of a user's password. This is created by taking
2801 the user's plaintext password, capitalising it, and either
2802 truncating to
14 bytes or padding to
14 bytes with null bytes.
2803 This
14 byte value is used as two
56 bit DES keys to encrypt
2804 a 'magic' eight byte value, forming a
16 byte value which is
2805 stored by the server and client. Let this value be known as
2806 the
"hashed password".
</P
2808 >Windows NT encryption is a higher quality mechanism,
2809 consisting of doing an MD4 hash on a Unicode version of the user's
2810 password. This also produces a
16 byte hash value that is
2813 >When a client (LanManager, Windows for WorkGroups, Windows
2814 95 or Windows NT) wishes to mount a Samba drive (or use a Samba
2815 resource), it first requests a connection and negotiates the
2816 protocol that the client and server will use. In the reply to this
2817 request the Samba server generates and appends an
8 byte, random
2818 value - this is stored in the Samba server after the reply is sent
2819 and is known as the
"challenge". The challenge is different for
2820 every client connection.
</P
2822 >The client then uses the hashed password (
16 byte values
2823 described above), appended with
5 null bytes, as three
56 bit
2824 DES keys, each of which is used to encrypt the challenge
8 byte
2825 value, forming a
24 byte value known as the
"response".
</P
2827 >In the SMB call SMBsessionsetupX (when user level security
2828 is selected) or the call SMBtconX (when share level security is
2829 selected), the
24 byte response is returned by the client to the
2830 Samba server. For Windows NT protocol levels the above calculation
2831 is done on both hashes of the user's password and both responses are
2832 returned in the SMB call, giving two
24 byte values.
</P
2834 >The Samba server then reproduces the above calculation, using
2835 its own stored value of the
16 byte hashed password (read from the
2839 > file - described later) and the challenge
2840 value that it kept from the negotiate protocol reply. It then checks
2841 to see if the
24 byte value it calculates matches the
24 byte value
2842 returned to it from the client.
</P
2844 >If these values match exactly, then the client knew the
2845 correct password (or the
16 byte hashed value - see security note
2846 below) and is thus allowed access. If not, then the client did not
2847 know the correct password and is denied access.
</P
2849 >Note that the Samba server never knows or stores the cleartext
2850 of the user's password - just the
16 byte hashed values derived from
2851 it. Also note that the cleartext password or
16 byte hashed values
2852 are never transmitted over the network - thus increasing security.
</P
2860 >3.3. Important Notes About Security
</A
2863 >The unix and SMB password encryption techniques seem similar
2864 on the surface. This similarity is, however, only skin deep. The unix
2865 scheme typically sends clear text passwords over the nextwork when
2866 logging in. This is bad. The SMB encryption scheme never sends the
2867 cleartext password over the network but it does store the
16 byte
2868 hashed values on disk. This is also bad. Why? Because the
16 byte hashed
2869 values are a
"password equivalent". You cannot derive the user's
2870 password from them, but they could potentially be used in a modified
2871 client to gain access to a server. This would require considerable
2872 technical knowledge on behalf of the attacker but is perfectly possible.
2873 You should thus treat the smbpasswd file as though it contained the
2874 cleartext passwords of all your users. Its contents must be kept
2875 secret, and the file should be protected accordingly.
</P
2877 >Ideally we would like a password scheme which neither requires
2878 plain text passwords on the net or on disk. Unfortunately this
2879 is not available as Samba is stuck with being compatible with
2880 other SMB systems (WinNT, WfWg, Win95 etc).
</P
2900 >Note that Windows NT
4.0 Service pack
3 changed the
2901 default for permissible authentication so that plaintext
2904 > sent over the wire.
2905 The solution to this is either to switch to encrypted passwords
2906 with Samba or edit the Windows NT registry to re-enable plaintext
2907 passwords. See the document WinNT.txt for details on how to do
2910 >Other Microsoft operating systems which also exhibit
2911 this behavior includes
</P
2917 >MS DOS Network client
3.0 with
2918 the basic network redirector installed
</P
2922 >Windows
95 with the network redirector
2937 >All current release of
2938 Microsoft SMB/CIFS clients support authentication via the
2939 SMB Challenge/Response mechanism described here. Enabling
2940 clear text authentication does not disable the ability
2941 of the client to particpate in encrypted authentication.
</P
2952 >3.3.1. Advantages of SMB Encryption
</A
2959 >plain text passwords are not passed across
2960 the network. Someone using a network sniffer cannot just
2961 record passwords going to the SMB server.
</P
2965 >WinNT doesn't like talking to a server
2966 that isn't using SMB encrypted passwords. It will refuse
2967 to browse the server if the server is also in user level
2968 security mode. It will insist on prompting the user for the
2969 password on each connection, which is very annoying. The
2970 only things you can do to stop this is to use SMB encryption.
2981 >3.3.2. Advantages of non-encrypted passwords
</A
2988 >plain text passwords are not kept
2993 >uses same password file as other unix
2994 services such as login and ftp
</P
2998 >you are probably already using other
2999 services (such as telnet and ftp) which send plain text
3000 passwords over the net, so sending them for SMB isn't
3013 NAME=
"SMBPASSWDFILEFORMAT"
3015 >The smbpasswd file
</A
3018 >In order for Samba to participate in the above protocol
3019 it must be able to look up the
16 byte hashed values given a user name.
3020 Unfortunately, as the UNIX password value is also a one way hash
3021 function (ie. it is impossible to retrieve the cleartext of the user's
3022 password given the UNIX hash of it), a separate password file
3023 containing this
16 byte value must be kept. To minimise problems with
3024 these two password files, getting out of sync, the UNIX
<TT
3034 >, is provided to generate
3035 a smbpasswd file from a UNIX
<TT
3041 >To generate the smbpasswd file from your
<TT
3045 > file use the following command :
</P
3053 >cat /etc/passwd | mksmbpasswd.sh
3054 > /usr/local/samba/private/smbpasswd
</B
3058 >If you are running on a system that uses NIS, use
</P
3066 >ypcat passwd | mksmbpasswd.sh
3067 > /usr/local/samba/private/smbpasswd
</B
3074 > program is found in
3075 the Samba source directory. By default, the smbpasswd file is
3080 >/usr/local/samba/private/smbpasswd
</TT
3083 >The owner of the
<TT
3085 >/usr/local/samba/private/
</TT
3087 directory should be set to root, and the permissions on it should
3090 >chmod
500 /usr/local/samba/private
</B
3094 >Likewise, the smbpasswd file inside the private directory should
3095 be owned by root and the permissions on is should be set to
0600
3098 >chmod
600 smbpasswd
</B
3101 >The format of the smbpasswd file is (The line has been
3102 wrapped here. It should appear as one entry per line in
3103 your smbpasswd file.)
</P
3112 CLASS=
"PROGRAMLISTING"
3113 >username:uid:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:
3114 [Account type]:LCT-
<last-change-time
>:Long name
3121 >Although only the
<TT
3135 > XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
</I
3146 > last-change-time
</I
3148 > sections are significant
3149 and are looked at in the Samba code.
</P
3153 > important that there by
32
3154 'X' characters between the two ':' characters in the XXX sections -
3155 the smbpasswd and Samba code will fail to validate any entries that
3156 do not have
32 characters between ':' characters. The first XXX
3157 section is for the Lanman password hash, the second is for the
3158 Windows NT version.
</P
3160 >When the password file is created all users have password entries
3161 consisting of
32 'X' characters. By default this disallows any access
3162 as this user. When a user has a password set, the 'X' characters change
3163 to
32 ascii hexadecimal digits (
0-
9, A-F). These are an ascii
3164 representation of the
16 byte hashed value of a user's password.
</P
3166 >To set a user to have no password (not recommended), edit the file
3167 using vi, and replace the first
11 characters with the ascii text
3171 > (minus the quotes).
</P
3173 >For example, to clear the password for user bob, his smbpasswd file
3174 entry would look like :
</P
3183 CLASS=
"PROGRAMLISTING"
3184 > bob:
100:NO PASSWORDXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-
00000000:Bob's full name:/bobhome:/bobshell
3191 >If you are allowing users to use the smbpasswd command to set
3192 their own passwords, you may want to give users NO PASSWORD initially
3193 so they do not have to enter a previous password when changing to their
3194 new password (not recommended). In order for you to allow this the
3198 > program must be able to connect to the
3202 > daemon as that user with no password. Enable this
3203 by adding the line :
</P
3207 >null passwords = yes
</B
3210 >to the [global] section of the smb.conf file (this is why
3211 the above scenario is not recommended). Preferably, allocate your
3212 users a default password to begin with, so you do not have
3213 to enable this on your server.
</P
3217 >This file should be protected very
3218 carefully. Anyone with access to this file can (with enough knowledge of
3219 the protocols) gain access to your SMB server. The file is thus more
3220 sensitive than a normal unix
<TT
3231 >3.5. The smbpasswd Command
</A
3234 >The smbpasswd command maintains the two
32 byte password fields
3235 in the smbpasswd file. If you wish to make it similar to the unix
3245 >/usr/local/samba/bin/
</TT
3247 main Samba binary directory).
</P
3249 >Note that as of Samba
1.9.18p4 this program
<EM
3252 > setuid root (the new
<B
3256 code enforces this restriction so it cannot be run this way by
3262 > now works in a client-server mode
3263 where it contacts the local smbd to change the user's password on its
3264 behalf. This has enormous benefits - as follows.
</P
3270 >smbpasswd no longer has to be setuid root -
3271 an enormous range of potential security problems is
3279 > now has the capability
3280 to change passwords on Windows NT servers (this only works when
3281 the request is sent to the NT Primary Domain Controller if you
3282 are changing an NT Domain user's password).
</P
3286 >To run smbpasswd as a normal user just type :
</P
3300 >Old SMB password:
</TT
3304 ><type old value here -
3305 or hit return if there was no old password
></B
3311 >New SMB Password:
</TT
3315 ><type new value
>
3322 >Repeat New SMB Password:
</TT
3326 ><re-type new value
3331 >If the old value does not match the current value stored for
3332 that user, or the two new values do not match each other, then the
3333 password will not be changed.
</P
3335 >If invoked by an ordinary user it will only allow the user
3336 to change his or her own Samba password.
</P
3338 >If run by the root user smbpasswd may take an optional
3339 argument, specifying the user name whose SMB password you wish to
3340 change. Note that when run as root smbpasswd does not prompt for
3341 or check the old password value, thus allowing root to set passwords
3342 for users who have forgotten their passwords.
</P
3347 > is designed to work in the same way
3348 and be familiar to UNIX users who use the
<B
3357 >For more details on using
<B
3361 to the man page which will always be the definitive reference.
</P
3369 >3.6. Setting up Samba to support LanManager Encryption
</A
3372 >This is a very brief description on how to setup samba to
3373 support password encryption.
</P
3380 >compile and install samba as usual
</P
3384 >enable encrypted passwords in
<TT
3387 > by adding the line
<B
3391 > in the [global] section
</P
3395 >create the initial
<TT
3399 password file in the place you specified in the Makefile
3400 (--prefix=
<dir
>). See the notes under the
<A
3401 HREF=
"#SMBPASSWDFILEFORMAT"
3402 >The smbpasswd File
</A
3404 section earlier in the document for details.
</P
3408 >Note that you can test things using smbclient.
</P
3416 >Chapter
4. Hosting a Microsoft Distributed File System tree on Samba
</A
3424 >4.1. Instructions
</A
3427 >The Distributed File System (or Dfs) provides a means of
3428 separating the logical view of files and directories that users
3429 see from the actual physical locations of these resources on the
3430 network. It allows for higher availability, smoother storage expansion,
3431 load balancing etc. For more information about Dfs, refer to
<A
3432 HREF=
"http://www.microsoft.com/NTServer/nts/downloads/winfeatures/NTSDistrFile/AdminGuide.asp"
3434 > Microsoft documentation
</A
3437 >This document explains how to host a Dfs tree on a Unix
3438 machine (for Dfs-aware clients to browse) using Samba.
</P
3440 >To enable SMB-based DFS for Samba, configure it with the
3446 > option. Once built, a
3447 Samba server can be made a Dfs server by setting the global
3449 HREF=
"smb.conf.5.html#HOSTMSDFS"
3457 > parameter in the
<TT
3461 > file. You designate a share as a Dfs root using the share
3463 HREF=
"smb.conf.5.html#MSDFSROOT"
3471 > parameter. A Dfs root directory on
3472 Samba hosts Dfs links in the form of symbolic links that point
3473 to other servers. For example, a symbolic link
3476 >junction-
>msdfs:storage1\share1
</TT
3478 the share directory acts as the Dfs junction. When Dfs-aware
3479 clients attempt to access the junction link, they are redirected
3480 to the storage location (in this case, \\storage1\share1).
</P
3482 >Dfs trees on Samba work with all Dfs-aware clients ranging
3483 from Windows
95 to
2000.
</P
3485 >Here's an example of setting up a Dfs tree on a Samba
3495 CLASS=
"PROGRAMLISTING"
3496 ># The smb.conf file:
3498 netbios name = SAMBA
3502 path = /export/dfsroot
3510 >In the /export/dfsroot directory we set up our dfs links to
3511 other servers on the network.
</P
3519 >cd /export/dfsroot
</B
3529 >chown root /export/dfsroot
</B
3539 >chmod
755 /export/dfsroot
</B
3549 >ln -s msdfs:storageA\\shareA linka
</B
3559 >ln -s msdfs:serverB\\share,serverC\\share linkb
</B
3563 >You should set up the permissions and ownership of
3564 the directory acting as the Dfs root such that only designated
3565 users can create, delete or modify the msdfs links. Also note
3566 that symlink names should be all lowercase. This limitation exists
3567 to have Samba avoid trying all the case combinations to get at
3568 the link name. Finally set up the symbolic links to point to the
3569 network shares you want, and start Samba.
</P
3571 >Users on Dfs-aware clients can now browse the Dfs tree
3572 on the Samba server at \\samba\dfs. Accessing
3573 links linka or linkb (which appear as directories to the client)
3574 takes users directly to the appropriate shares on the network.
</P
3588 >Windows clients need to be rebooted
3589 if a previously mounted non-dfs share is made a dfs
3590 root or vice versa. A better way is to introduce a
3591 new share and make it the dfs root.
</P
3595 >Currently there's a restriction that msdfs
3596 symlink names should all be lowercase.
</P
3600 >For security purposes, the directory
3601 acting as the root of the Dfs tree should have ownership
3602 and permissions set so that only designated users can
3603 modify the symbolic links in the directory.
</P
3614 >Chapter
5. Printing Support in Samba
2.2.x
</A
3622 >5.1. Introduction
</A
3625 >Beginning with the
2.2.0 release, Samba supports
3626 the native Windows NT printing mechanisms implemented via
3627 MS-RPC (i.e. the SPOOLSS named pipe). Previous versions of
3628 Samba only supported LanMan printing calls.
</P
3630 >The additional functionality provided by the new
3631 SPOOLSS support includes:
</P
3637 >Support for downloading printer driver
3638 files to Windows
95/
98/NT/
2000 clients upon demand.
3643 >Uploading of printer drivers via the
3644 Windows NT Add Printer Wizard (APW) or the
3645 Imprints tool set (refer to
<A
3646 HREF=
"http://imprints.sourceforge.net"
3648 >http://imprints.sourceforge.net
</A
3654 >Support for the native MS-RPC printing
3655 calls such as StartDocPrinter, EnumJobs(), etc... (See
3656 the MSDN documentation at
<A
3657 HREF=
"http://msdn.microsoft.com/"
3659 >http://msdn.microsoft.com/
</A
3661 for more information on the Win32 printing API)
3666 >Support for NT Access Control Lists (ACL)
3667 on printer objects
</P
3671 >Improved support for printer queue manipulation
3672 through the use of an internal databases for spooled job
3677 >There has been some initial confusion about what all this means
3678 and whether or not it is a requirement for printer drivers to be
3679 installed on a Samba host in order to support printing from Windows
3680 clients. A bug existed in Samba
2.2.0 which made Windows NT/
2000 clients
3681 require that the Samba server possess a valid driver for the printer.
3682 This is fixed in Samba
2.2.1 and once again, Windows NT/
2000 clients
3683 can use the local APW for installing drivers to be used with a Samba
3684 served printer. This is the same behavior exhibited by Windows
9x clients.
3685 As a side note, Samba does not use these drivers in any way to process
3686 spooled files. They are utilized entirely by the clients.
</P
3688 >The following MS KB article, may be of some help if you are dealing with
3689 Windows
2000 clients:
<EM
3690 >How to Add Printers with No User
3691 Interaction in Windows
2000</EM
3695 HREF=
"http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP"
3697 >http://support.microsoft.com/support/kb/articles/Q189/
1/
05.ASP
</A
3706 >5.2. Configuration
</A
3720 >[print$] vs. [printer$]
</B
3727 >Previous versions of Samba recommended using a share named [printer$].
3728 This name was taken from the printer$ service created by Windows
9x
3729 clients when a printer was shared. Windows
9x printer servers always have
3730 a printer$ service which provides read-only access via no
3731 password in order to support printer driver downloads.
</P
3733 >However, the initial implementation allowed for a
3737 >printer driver location
</I
3740 to be used on a per share basis to specify the location of
3741 the driver files associated with that printer. Another
3748 a means of defining the printer driver name to be sent to
3751 >These parameters, including
<TT
3757 > parameter, are being depreciated and should not
3758 be used in new installations. For more information on this change,
3759 you should refer to the
<A
3761 >Migration section
</A
3763 of this document.
</P
3774 >5.2.1. Creating [print$]
</A
3777 >In order to support the uploading of printer driver
3778 files, you must first configure a file share named [print$].
3779 The name of this share is hard coded in Samba's internals so
3780 the name is very important (print$ is the service used by
3781 Windows NT print servers to provide support for printer driver
3784 >You should modify the server's smb.conf file to create the
3785 following file share (of course, some of the parameter values,
3786 such as 'path' are arbitrary and should be replaced with
3787 appropriate values for your site):
</P
3796 CLASS=
"PROGRAMLISTING"
3798 path = /usr/local/samba/printers
3802 ; since this share is configured as read only, then we need
3803 ; a 'write list'. Check the file system permissions to make
3804 ; sure this account can copy files to the share. If this
3805 ; is setup to a non-root account, then it should also exist
3806 ; as a 'printer admin'
3807 write list = ntadmin
</PRE
3814 HREF=
"smb.conf.5.html#WRITELIST"
3822 > is used to allow administrative
3823 level user accounts to have write access in order to update files
3824 on the share. See the
<A
3825 HREF=
"smb./conf.5.html"
3829 > for more information on configuring file shares.
</P
3831 >The requirement for
<A
3832 HREF=
"smb.conf.5.html#GUESTOK"
3839 > depends upon how your
3840 site is configured. If users will be guaranteed to have
3841 an account on the Samba host, then this is a non-issue.
</P
3849 >The non-issue is that if all your Windows NT users are guaranteed to be
3850 authenticated by the Samba server (such as a domain member server and the NT
3851 user has already been validated by the Domain Controller in
3852 order to logon to the Windows NT console), then guest access
3853 is not necessary. Of course, in a workgroup environment where
3854 you just want to be able to print without worrying about
3855 silly accounts and security, then configure the share for
3856 guest access. You'll probably want to add
<A
3857 HREF=
"smb.conf.5.html#MAPTOGUEST"
3861 >map to guest = Bad User
</B
3863 > in the [global] section as well. Make sure
3864 you understand what this parameter does before using it
3869 >In order for a Windows NT print server to support
3870 the downloading of driver files by multiple client architectures,
3871 it must create subdirectories within the [print$] service
3872 which correspond to each of the supported client architectures.
3873 Samba follows this model as well.
</P
3875 >Next create the directory tree below the [print$] share
3876 for each architecture you wish to support.
</P
3885 CLASS=
"PROGRAMLISTING"
3887 |-W32X86 ;
"Windows NT x86"
3888 |-WIN40 ;
"Windows 95/98"
3889 |-W32ALPHA ;
"Windows NT Alpha_AXP"
3890 |-W32MIPS ;
"Windows NT R4000"
3891 |-W32PPC ;
"Windows NT PowerPC"</PRE
3908 >ATTENTION! REQUIRED PERMISSIONS
</B
3915 >In order to currently add a new driver to you Samba host,
3916 one of two conditions must hold true:
</P
3922 >The account used to connect to the Samba host
3923 must have a uid of
0 (i.e. a root account)
</P
3927 >The account used to connect to the Samba host
3928 must be a member of the
<A
3929 HREF=
"smb.conf.5.html#PRINTERADMIN"
3942 >Of course, the connected account must still possess access
3943 to add files to the subdirectories beneath [print$]. Remember
3944 that all file shares are set to 'read only' by default.
</P
3950 >Once you have created the required [print$] service and
3951 associated subdirectories, simply log onto the Samba server using
3958 from a Windows NT
4.0 client. Navigate to the
"Printers" folder
3959 on the Samba server. You should see an initial listing of printers
3960 that matches the printer shares defined on your Samba host.
</P
3968 >5.2.2. Setting Drivers for Existing Printers
</A
3971 >The initial listing of printers in the Samba host's
3972 Printers folder will have no real printer driver assigned
3973 to them. By default, in Samba
2.2.0 this driver name was set to
3975 >NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER
</EM
3977 Later versions changed this to a NULL string to allow the use
3978 tof the local Add Printer Wizard on NT/
2000 clients.
3979 Attempting to view the printer properties for a printer
3980 which has this default driver assigned will result in
3981 the error message:
</P
3984 >Device settings cannot be displayed. The driver
3985 for the specified printer is not installed, only spooler
3986 properties will be displayed. Do you want to install the
3990 >Click
"No" in the error dialog and you will be presented with
3991 the printer properties window. The way assign a driver to a
3992 printer is to either
</P
3998 >Use the
"New Driver..." button to install
3999 a new printer driver, or
</P
4003 >Select a driver from the popup list of
4004 installed drivers. Initially this list will be empty.
</P
4008 >If you wish to install printer drivers for client
4009 operating systems other than
"Windows NT x86", you will need
4010 to use the
"Sharing" tab of the printer properties dialog.
</P
4012 >Assuming you have connected with a root account, you
4013 will also be able modify other printer properties such as
4014 ACLs and device settings using this dialog box.
</P
4016 >A few closing comments for this section, it is possible
4017 on a Windows NT print server to have printers
4018 listed in the Printers folder which are not shared. Samba does
4019 not make this distinction. By definition, the only printers of
4020 which Samba is aware are those which are specified as shares in
4026 >Another interesting side note is that Windows NT clients do
4027 not use the SMB printer share, but rather can print directly
4028 to any printer on another Windows NT host using MS-RPC. This
4029 of course assumes that the printing client has the necessary
4030 privileges on the remote host serving the printer. The default
4031 permissions assigned by Windows NT to a printer gives the
"Print"
4032 permissions to the
"Everyone" well-known group.
</P
4040 >5.2.3. Support a large number of printers
</A
4043 >One issue that has arisen during the development
4044 phase of Samba
2.2 is the need to support driver downloads for
4045 100's of printers. Using the Windows NT APW is somewhat
4046 awkward to say the list. If more than one printer are using the
4048 HREF=
"rpcclient.1.html"
4053 setdriver command
</B
4055 > can be used to set the driver
4056 associated with an installed driver. The following is example
4057 of how this could be accomplished:
</P
4066 CLASS=
"PROGRAMLISTING"
4071 >rpcclient pogo -U root%secret -c
"enumdrivers"
4072 Domain=[NARNIA] OS=[Unix] Server=[Samba
2.2.0-alpha3]
4075 Printer Driver Info
1:
4076 Driver Name: [HP LaserJet
4000 Series PS]
4078 Printer Driver Info
1:
4079 Driver Name: [HP LaserJet
2100 Series PS]
4081 Printer Driver Info
1:
4082 Driver Name: [HP LaserJet
4Si/
4SiMX PS]
4087 >rpcclient pogo -U root%secret -c
"enumprinters"
4088 Domain=[NARNIA] OS=[Unix] Server=[Samba
2.2.0-alpha3]
4090 name:[\\POGO\hp-print]
4091 description:[POGO\\POGO\hp-print,NO DRIVER AVAILABLE FOR THIS PRINTER,]
4097 >rpcclient pogo -U root%secret \
4101 > -c
"setdriver hp-print \"HP LaserJet
4000 Series PS\
""
4102 Domain=[NARNIA] OS=[Unix] Server=[Samba
2.2.0-alpha3]
4103 Successfully set hp-print to driver HP LaserJet
4000 Series PS.
</PRE
4115 >5.2.4. Adding New Printers via the Windows NT APW
</A
4118 >By default, Samba offers all printer shares defined in
<TT
4122 in the
"Printers..." folder. Also existing in this folder is the Windows NT
4123 Add Printer Wizard icon. The APW will be show only if
</P
4129 >The connected user is able to successfully
4130 execute an OpenPrinterEx(\\server) with administrative
4131 priviledges (i.e. root or
<TT
4142 HREF=
"smb.conf.5.html#SHOWADDPRINTERWIZARD"
4148 add printer wizard = yes
</I
4156 >In order to be able to use the APW to successfully add a printer to a Samba
4158 HREF=
"smb.conf.5.html#ADDPRINTERCOMMAND"
4167 > must have a defined value. The program
4168 hook must successfully add the printer to the system (i.e.
4172 > or appropriate files) and
4178 >When using the APW from a client, if the named printer share does
4182 > will execute the
<TT
4188 > and reparse to the
<TT
4192 to attempt to locate the new printer share. If the share is still not defined,
4193 an error of
"Access Denied" is returned to the client. Note that the
4197 >add printer program
</I
4199 > is executed under the context
4200 of the connected user, not necessarily a root account.
</P
4202 >There is a complementing
<A
4203 HREF=
"smb.conf.5.html#DELETEPRINTERCOMMAND"
4212 > for removing entries from the
"Printers..."
4221 >5.2.5. Samba and Printer Ports
</A
4224 >Windows NT/
2000 print servers associate a port with each printer. These normally
4225 take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the
4226 concept of ports associated with a printer. By default, only one printer port,
4227 named
"Samba Printer Port", exists on a system. Samba does not really a port in
4228 order to print, rather it is a requirement of Windows clients.
</P
4230 >Note that Samba does not support the concept of
"Printer Pooling" internally
4231 either. This is when a logical printer is assigned to multiple ports as
4232 a form of load balancing or fail over.
</P
4234 >If you require that multiple ports be defined for some reason,
4239 HREF=
"smb.conf.5.html#ENUMPORTSCOMMAND"
4248 > which can be used to define an external program
4249 that generates a listing of ports on a system.
</P
4258 >5.3. The Imprints Toolset
</A
4261 >The Imprints tool set provides a UNIX equivalent of the
4262 Windows NT Add Printer Wizard. For complete information, please
4263 refer to the Imprints web site at
<A
4264 HREF=
"http://imprints.sourceforge.net/"
4266 > http://imprints.sourceforge.net/
</A
4267 > as well as the documentation
4268 included with the imprints source distribution. This section will
4269 only provide a brief introduction to the features of Imprints.
</P
4276 >5.3.1. What is Imprints?
</A
4279 >Imprints is a collection of tools for supporting the goals
4286 >Providing a central repository information
4287 regarding Windows NT and
95/
98 printer driver packages
</P
4291 >Providing the tools necessary for creating
4292 the Imprints printer driver packages.
</P
4296 >Providing an installation client which
4297 will obtain and install printer drivers on remote Samba
4298 and Windows NT
4 print servers.
</P
4308 >5.3.2. Creating Printer Driver Packages
</A
4311 >The process of creating printer driver packages is beyond
4312 the scope of this document (refer to Imprints.txt also included
4313 with the Samba distribution for more information). In short,
4314 an Imprints driver package is a gzipped tarball containing the
4315 driver files, related INF files, and a control file needed by the
4316 installation client.
</P
4324 >5.3.3. The Imprints server
</A
4327 >The Imprints server is really a database server that
4328 may be queried via standard HTTP mechanisms. Each printer
4329 entry in the database has an associated URL for the actual
4330 downloading of the package. Each package is digitally signed
4331 via GnuPG which can be used to verify that package downloaded
4332 is actually the one referred in the Imprints database. It is
4335 > recommended that this security check
4344 >5.3.4. The Installation Client
</A
4347 >More information regarding the Imprints installation client
4348 is available in the
<TT
4350 >Imprints-Client-HOWTO.ps
</TT
4352 file included with the imprints source package.
</P
4354 >The Imprints installation client comes in two forms.
</P
4360 >a set of command line Perl scripts
</P
4364 >a GTK+ based graphical interface to
4365 the command line perl scripts
</P
4369 >The installation client (in both forms) provides a means
4370 of querying the Imprints database server for a matching
4371 list of known printer model names as well as a means to
4372 download and install the drivers on remote Samba and Windows
4373 NT print servers.
</P
4375 >The basic installation process is in four steps and
4376 perl code is wrapped around
<B
4392 CLASS=
"PROGRAMLISTING"
4394 foreach (supported architecture for a given driver)
4396 1. rpcclient: Get the appropriate upload directory
4397 on the remote server
4398 2. smbclient: Upload the driver files
4399 3. rpcclient: Issues an AddPrinterDriver() MS-RPC
4402 4. rpcclient: Issue an AddPrinterEx() MS-RPC to actually
4403 create the printer
</PRE
4409 >One of the problems encountered when implementing
4410 the Imprints tool set was the name space issues between
4411 various supported client architectures. For example, Windows
4412 NT includes a driver named
"Apple LaserWriter II NTX v51.8"
4413 and Windows
95 callsits version of this driver
"Apple
4414 LaserWriter II NTX"</P
4416 >The problem is how to know what client drivers have
4417 been uploaded for a printer. As astute reader will remember
4418 that the Windows NT Printer Properties dialog only includes
4419 space for one printer driver name. A quick look in the
4420 Windows NT
4.0 system registry at
</P
4424 >HKLM\System\CurrentControlSet\Control\Print\Environment
4428 >will reveal that Windows NT always uses the NT driver
4429 name. This is ok as Windows NT always requires that at least
4430 the Windows NT version of the printer driver is present.
4431 However, Samba does not have the requirement internally.
4432 Therefore, how can you use the NT driver name if is has not
4433 already been installed?
</P
4435 >The way of sidestepping this limitation is to require
4436 that all Imprints printer driver packages include both the Intel
4437 Windows NT and
95/
98 printer drivers and that NT driver is
4450 >Migration to from Samba
2.0.x to
2.2.x
</A
4453 >Given that printer driver management has changed (we hope improved) in
4454 2.2 over prior releases, migration from an existing setup to
2.2 can
4455 follow several paths.
</P
4457 >Windows clients have a tendency to remember things for quite a while.
4458 For example, if a Windows NT client has attached to a Samba
2.0 server,
4459 it will remember the server as a LanMan printer server. Upgrading
4460 the Samba host to
2.2 makes support for MSRPC printing possible, but
4461 the NT client will still remember the previous setting.
</P
4463 >In order to give an NT client printing
"amesia" (only necessary if you
4464 want to use the newer MSRPC printing functionality in Samba), delete
4465 the registry keys associated with the print server contained in
4468 >[HKLM\SYSTEM\CurrentControlSet\Control\Print]
</TT
4470 spooler service on the client should be stopped prior to doing this:
</P
4474 >C:\WINNT\
></TT
4478 >net stop spooler
</B
4483 >All the normal disclaimers about editing the registry go
4485 > Be careful, and know what you are doing.
</P
4487 >The spooler service should be restarted after you have finished
4488 removing the appropriate registry entries by replacing the
4492 > command above with
<B
4497 >Windows
9x clients will continue to use LanMan printing calls
4498 with a
2.2 Samba server so there is no need to perform any of these
4499 modifications on non-NT clients.
</P
4519 >The following smb.conf parameters are considered to be depreciated and will
4520 be removed soon. Do not use them in new installations
</P
4529 >printer driver file (G)
</I
4539 >printer driver (S)
</I
4549 >printer driver location (S)
</I
4560 >Here are the possible scenarios for supporting migration:
</P
4566 >If you do not desire the new Windows NT
4567 print driver support, nothing needs to be done.
4568 All existing parameters work the same.
</P
4572 >If you want to take advantage of NT printer
4573 driver support but do not want to migrate the
4574 9x drivers to the new setup, the leave the existing
4575 printers.def file. When smbd attempts to locate a
4576 9x driver for the printer in the TDB and fails it
4577 will drop down to using the printers.def (and all
4578 associated parameters). The
<B
4582 tool will also remain for backwards compatibility but will
4583 be moved to the
"this tool is the old way of doing it"
4588 >If you install a Windows
9x driver for a printer
4589 on your Samba host (in the printing TDB), this information will
4590 take precedence and the three old printing parameters
4591 will be ignored (including print driver location).
</P
4595 >If you want to migrate an existing
<TT
4599 file into the new setup, the current only solution is to use the Windows
4600 NT APW to install the NT drivers and the
9x drivers. This can be scripted
4608 Imprints installation client at
<A
4609 HREF=
"http://imprints.sourceforge.net/"
4611 >http://imprints.sourceforge.net/
</A
4624 >Chapter
6. security = domain in Samba
2.x
</A
4632 >6.1. Joining an NT Domain with Samba
2.2</A
4635 >In order for a Samba-
2 server to join an NT domain,
4636 you must first add the NetBIOS name of the Samba server to the
4637 NT domain on the PDC using Server Manager for Domains. This creates
4638 the machine account in the domain (PDC) SAM. Note that you should
4639 add the Samba server as a
"Windows NT Workstation or Server",
4642 > as a Primary or backup domain controller.
</P
4644 >Assume you have a Samba-
2 server with a NetBIOS name of
4648 > and are joining an NT domain called
4652 >, which has a PDC with a NetBIOS name
4656 > and two backup domain controllers
4657 with NetBIOS names
<TT
4666 >In order to join the domain, first stop all Samba daemons
4667 and run the command:
</P
4675 >smbpasswd -j DOM -r DOMPDC
4680 >as we are joining the domain DOM and the PDC for that domain
4681 (the only machine that has write access to the domain SAM database)
4682 is DOMPDC. If this is successful you will see the message:
</P
4685 CLASS=
"COMPUTEROUTPUT"
4686 >smbpasswd: Joined domain DOM.
</TT
4690 >in your terminal window. See the
<A
4691 HREF=
"smbpasswd.8.html"
4694 > man page for more details.
</P
4696 >There is existing development code to join a domain
4697 without having to create the machine trust account on the PDC
4698 beforehand. This code will hopefully be available soon
4699 in release branches as well.
</P
4701 >This command goes through the machine account password
4702 change protocol, then writes the new (random) machine account
4703 password for this Samba server into a file in the same directory
4704 in which an smbpasswd file would be stored - normally :
</P
4708 >/usr/local/samba/private
</TT
4711 >In Samba
2.0.x, the filename looks like this:
</P
4718 ><NT DOMAIN NAME
></I
4732 > suffix stands for machine account
4733 password file. So in our example above, the file would be called:
</P
4740 >In Samba
2.2, this file has been replaced with a TDB
4741 (Trivial Database) file named
<TT
4747 >This file is created and owned by root and is not
4748 readable by any other user. It is the key to the domain-level
4749 security for your system, and should be treated as carefully
4750 as a shadow password file.
</P
4752 >Now, before restarting the Samba daemons you must
4754 HREF=
"smb.conf.5.html"
4761 > file to tell Samba it should now use domain security.
</P
4763 >Change (or add) your
<A
4764 HREF=
"smb.conf.5.html#SECURITY"
4772 > line in the [global] section
4773 of your smb.conf to read:
</P
4777 >security = domain
</B
4781 HREF=
"smb.conf.5.html#WORKGROUP"
4789 > line in the [global] section to read:
</P
4796 >as this is the name of the domain we are joining.
</P
4798 >You must also have the parameter
<A
4799 HREF=
"smb.conf.5.html#ENCRYPTPASSWORDS"
4804 >encrypt passwords
</I
4811 > in order for your users to authenticate to the NT PDC.
</P
4813 >Finally, add (or modify) a
<A
4814 HREF=
"smb.conf.5.html#PASSWORDSERVER"
4819 >password server =
</I
4822 > line in the [global]
4823 section to read:
</P
4827 >password server = DOMPDC DOMBDC1 DOMBDC2
</B
4830 >These are the primary and backup domain controllers Samba
4831 will attempt to contact in order to authenticate users. Samba will
4832 try to contact each of these servers in order, so you may want to
4833 rearrange this list in order to spread out the authentication load
4834 among domain controllers.
</P
4836 >Alternatively, if you want smbd to automatically determine
4837 the list of Domain controllers to use for authentication, you may
4838 set this line to be :
</P
4842 >password server = *
</B
4845 >This method, which was introduced in Samba
2.0.6,
4846 allows Samba to use exactly the same mechanism that NT does. This
4847 method either broadcasts or uses a WINS database in order to
4848 find domain controllers to authenticate against.
</P
4850 >Finally, restart your Samba daemons and get ready for
4851 clients to begin using domain security!
</P
4859 >6.2. Samba and Windows
2000 Domains
</A
4862 >Many people have asked regarding the state of Samba's ability to participate in
4863 a Windows
2000 Domain. Samba
2.2 is able to act as a member server of a Windows
4864 2000 domain operating in mixed or native mode.
</P
4866 >There is much confusion between the circumstances that require a
"mixed" mode
4867 Win2k DC and a when this host can be switched to
"native" mode. A
"mixed" mode
4868 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
4869 domain. By default, a Win2k DC in
"native" mode will still support
4870 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows
9x and
4871 NT
4.0. Samba has the same requirements as a Windows NT
4.0 member server.
</P
4873 >The steps for adding a Samba
2.2 host to a Win2k domain are the same as those
4874 for adding a Samba server to a Windows NT
4.0 domain. The only exception is that
4875 the
"Server Manager" from NT
4 has been replaced by the
"Active Directory Users and
4876 Computers" MMC (Microsoft Management Console) plugin.
</P
4884 >6.3. Why is this better than security = server?
</A
4887 >Currently, domain security in Samba doesn't free you from
4888 having to create local Unix users to represent the users attaching
4889 to your server. This means that if domain user
<TT
4893 > attaches to your domain security Samba server, there needs
4894 to be a local Unix user fred to represent that user in the Unix
4895 filesystem. This is very similar to the older Samba security mode
4897 HREF=
"smb.conf.5.html#SECURITYEQUALSSERVER"
4899 >security = server
</A
4901 where Samba would pass through the authentication request to a Windows
4902 NT server in the same way as a Windows
95 or Windows
98 server would.
4905 >Please refer to the
<A
4910 > for information on a system to automatically
4911 assign UNIX uids and gids to Windows NT Domain users and groups.
4912 This code is available in development branches only at the moment,
4913 but will be moved to release branches soon.
</P
4915 >The advantage to domain-level security is that the
4916 authentication in domain-level security is passed down the authenticated
4917 RPC channel in exactly the same way that an NT server would do it. This
4918 means Samba servers now participate in domain trust relationships in
4919 exactly the same way NT servers do (i.e., you can add Samba servers into
4920 a resource domain and have the authentication passed on from a resource
4921 domain PDC to an account domain PDC.
</P
4923 >In addition, with
<B
4925 >security = server
</B
4927 daemon on a server has to keep a connection open to the
4928 authenticating server for as long as that daemon lasts. This can drain
4929 the connection resources on a Microsoft NT server and cause it to run
4930 out of available connections. With
<B
4932 >security = domain
</B
4934 however, the Samba daemons connect to the PDC/BDC only for as long
4935 as is necessary to authenticate the user, and then drop the connection,
4936 thus conserving PDC connection resources.
</P
4938 >And finally, acting in the same manner as an NT server
4939 authenticating to a PDC means that as part of the authentication
4940 reply, the Samba server gets the user identification information such
4941 as the user SID, the list of NT groups the user belongs to, etc. All
4942 this information will allow Samba to be extended in the future into
4943 a mode the developers currently call appliance mode. In this mode,
4944 no local Unix users will be necessary, and Samba will generate Unix
4945 uids and gids from the information passed back from the PDC when a
4946 user is authenticated, making a Samba server truly plug and play
4947 in an NT domain environment. Watch for this code soon.
</P
4951 > Much of the text of this document
4952 was first published in the Web magazine
<A
4953 HREF=
"http://www.linuxworld.com"
4958 HREF=
"http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
4970 >Chapter
7. How to Configure Samba
2.2 as a Primary Domain Controller
</A
4978 >7.1. Prerequisite Reading
</A
4981 >Before you continue readingin this chapter, please make sure
4982 that you are comfortable with configuring basic files services
4983 in smb.conf and how to enable and administrate password
4984 encryption in Samba. Theses two topics are covered in the
4986 HREF=
"smb.conf.5.html"
4994 HREF=
"EMCRYPTION.html"
4996 >Encryption chapter
</A
4998 of this HOWTO Collection.
</P
5016 >Author's Note :
</EM
5017 > This document is a combination
5018 of David Bannon's Samba
2.2 PDC HOWTO and the Samba NT Domain FAQ.
5019 Both documents are superceeded by this one.
</P
5023 >Version of Samba prior to release
2.2 had marginal capabilities to
5024 act as a Windows NT
4.0 Primary Domain Controller (PDC). Beginning with
5025 Samba
2.2.0, we are proud to announce official support for Windows NT
4.0
5026 style domain logons from Windows NT
4.0 (through SP6) and Windows
2000 (through
5027 SP1) clients. This article outlines the steps necessary for configuring Samba
5028 as a PDC. It is necessary to have a working Samba server prior to implementing the
5029 PDC functionality. If you have not followed the steps outlined in
5031 HREF=
"UNIX_INSTALL.html"
5033 > UNIX_INSTALL.html
</A
5035 that your server is configured correctly before proceeding. Another good
5037 HREF=
"smb.conf.5.html"
5041 >. The following functionality should work in
2.2:
</P
5047 > domain logons for Windows NT
4.0/
2000 clients.
5052 > placing a Windows
9x client in user level security
5057 > retrieving a list of users and groups from a Samba PDC to
5058 Windows
9x/NT/
2000 clients
5063 > roving (roaming) user profiles
5068 > Windows NT
4.0 style system policies
5084 >Windows
2000 Service Pack
2 Clients
</B
5091 > Samba
2.2.1 is required for PDC functionality when using Windows
2000
5099 >The following pieces of functionality are not included in the
2.2 release:
</P
5105 > Windows NT
4 domain trusts
5110 > SAM replication with Windows NT
4.0 Domain Controllers
5111 (i.e. a Samba PDC and a Windows NT BDC or vice versa)
5116 > Adding users via the User Manager for Domains
5121 > Acting as a Windows
2000 Domain Controller (i.e. Kerberos and
5127 >Please note that Windows
9x clients are not true members of a domain
5128 for reasons outlined in this article. Therefore the protocol for
5129 support Windows
9x style domain logons is completely different
5130 from NT4 domain logons and has been officially supported for some
5133 >Implementing a Samba PDC can basically be divided into
2 broad
5141 > Configuring the Samba PDC
5146 > Creating machine trust accounts and joining clients
5152 >There are other minor details such as user profiles, system
5153 policies, etc... However, these are not necessarily specific
5154 to a Samba PDC as much as they are related to Windows NT networking
5155 concepts. They will be mentioned only briefly here.
</P
5163 >7.3. Configuring the Samba Domain Controller
</A
5166 >The first step in creating a working Samba PDC is to
5167 understand the parameters necessary in smb.conf. I will not
5168 attempt to re-explain the parameters here as they are more that
5169 adequately covered in
<A
5170 HREF=
"smb.conf.5.html"
5174 >. For convenience, the parameters have been
5175 linked with the actual smb.conf description.
</P
5177 >Here is an example smb.conf for acting as a PDC:
</P
5186 CLASS=
"PROGRAMLISTING"
5188 ; Basic server settings
5190 HREF=
"smb.conf.5.html#NETBIOSNAME"
5200 HREF=
"smb.conf.5.html#WORKGROUP"
5210 ; we should act as the domain and local master browser
5212 HREF=
"smb.conf.5.html#OSLEVEL"
5217 HREF=
"smb.conf.5.html#PERFERREDMASTER"
5219 >preferred master
</A
5222 HREF=
"smb.conf.5.html#DOMAINMASTER"
5227 HREF=
"smb.conf.5.html#LOCALMASTER"
5232 ; security settings (must user security = user)
5234 HREF=
"smb.conf.5.html#SECURITYEQUALSUSER"
5239 ; encrypted passwords are a requirement for a PDC
5241 HREF=
"smb.conf.5.html#ENCRYPTPASSWORDS"
5243 >encrypt passwords
</A
5246 ; support domain logons
5248 HREF=
"smb.conf.5.html#DOMAINLOGONS"
5253 ; where to store user profiles?
5255 HREF=
"smb.conf.5.html#LOGONPATH"
5258 > = \\%N\profiles\%u
5260 ; where is a user's home directory and where should it
5263 HREF=
"smb.conf.5.html#LOGONDRIVE"
5268 HREF=
"smb.conf.5.html#LOGONHOME"
5273 ; specify a generic logon script for all users
5274 ; this is a relative **DOS** path to the [netlogon] share
5276 HREF=
"smb.conf.5.html#LOGONSCRIPT"
5281 ; necessary share for domain controller
5284 HREF=
"smb.conf.5.html#PATH"
5287 > = /usr/local/samba/lib/netlogon
5289 HREF=
"smb.conf.5.html#WRITEABLE"
5294 HREF=
"smb.conf.5.html#WRITELIST"
5304 ; share for storing user profiles
5307 HREF=
"smb.conf.5.html#PATH"
5310 > = /export/smb/ntprofile
5312 HREF=
"smb.conf.5.html#WRITEABLE"
5317 HREF=
"smb.conf.5.html#CREATEMASK"
5322 HREF=
"smb.conf.5.html#DIRECTORYMASK"
5331 >There are a couple of points to emphasize in the above configuration.
</P
5337 > Encrypted passwords must be enabled. For more details on how
5338 to do this, refer to
<A
5339 HREF=
"ENCRYPTION.html"
5347 > The server must support domain logons and a
5356 > The server must be the domain master browser in order for Windows
5357 client to locate the server as a DC. Please refer to the various
5358 Network Browsing documentation included with this distribution for
5364 >As Samba
2.2 does not offer a complete implementation of group mapping between
5365 Windows NT groups and UNIX groups (this is really quite complicated to explain
5366 in a short space), you should refer to the
<A
5367 HREF=
"smb.conf.5.html#DOMAINADMINUSERS"
5372 HREF=
"smb.conf.5.html#DOMAINADMINGROUP"
5376 > smb.conf parameters for information of creating a Domain Admins
5385 >7.4. Creating Machine Trust Accounts and Joining Clients
5389 >A machine trust account is a samba user account owned by a computer.
5390 The account password acts as the shared secret for secure
5391 communication with the Domain Controller. This is a security feature
5392 to prevent an unauthorized machine with the same netbios name from
5393 joining the domain and gaining access to domain user/group accounts.
5394 Hence a Windows
9x host is never a true member of a domain because it does
5395 not posses a machine trust account, and thus has no shared secret with the DC.
</P
5397 >On a Windows NT PDC, these machine trust account passwords are stored
5398 in the registry. A Samba PDC stores these accounts in the same location
5399 as user LanMan and NT password hashes (currently
<TT
5403 However, machine trust accounts only possess and use the NT password hash.
</P
5405 >Because Samba requires machine accounts to possess a UNIX uid from
5406 which an Windows NT SID can be generated, all of these accounts
5407 must have an entry in
<TT
5411 Future releases will alleviate the need to create
5417 >There are two means of creating machine trust accounts.
</P
5423 > Manual creation before joining the client to the domain. In this case,
5424 the password is set to a known value -- the lower case of the
5425 machine's netbios name.
5430 > Creation of the account at the time of joining the domain. In
5431 this case, the session key of the administrative account used to join
5432 the client to the domain acts as an encryption key for setting the
5433 password to a random value (This is the recommended method).
5443 >7.4.1. Manually creating machine trust accounts
</A
5446 >The first step in creating a machine trust account by hand is to
5447 create an entry for the machine in /etc/passwd. This can be done
5451 > or any 'add userr' command which is normally
5452 used to create new UNIX accounts. The following is an example for a Linux
5453 based Samba server:
</P
5458 >/usr/sbin/useradd -g
100 -d /dev/null -c
<TT
5461 >machine_nickname
</I
5463 > -m -s /bin/false
<TT
5473 > entry will list the machine name
5474 with a $ appended, won't have a passwd, will have a null shell and no
5475 home directory. For example a machine called 'doppy' would have an
5479 > entry like this :
</P
5488 CLASS=
"PROGRAMLISTING"
5489 >doppy$:x:
505:
501:
<TT
5492 >machine_nickname
</I
5494 >:/dev/null:/bin/false
</PRE
5503 >machine_nickname
</I
5505 > can be any descriptive name for the
5506 pc i.e. BasementComputer. The
<TT
5511 > absolutely must be
5512 the netbios name of the pc to be added to the domain. The
"$" must append the netbios
5513 name of the pc or samba will not recognize this as a machine account
</P
5515 >Now that the UNIX account has been created, the next step is to create
5516 the smbpasswd entry for the machine containing the well known initial
5517 trust account password. This can be done using the
<A
5518 HREF=
"smbpasswd.6.html"
5530 > smbpasswd -a -m
<TT
5542 > is the machine's netbios
5556 >Join the client to the domain immediately
</B
5563 > Manually creating a machine trust account using this method is the
5564 equivalent of creating a machine account on a Windows NT PDC using
5565 the
"Server Manager". From the time at which the account is created
5566 to the time which th client joins the domain and changes the password,
5567 your domain is vulnerable to an intruder joining your domain using a
5568 a machine with the same netbios name. A PDC inherently trusts
5569 members of the domain and will serve out a large degree of user
5570 information to such clients. You have been warned!
5583 >7.4.2. Creating machine trust accounts
"on the fly"</A
5586 >The second, and most recommended way of creating machine trust accounts
5587 is to create them as needed at the time the client is joined to
5588 the domain. You will need to include a value for the
<A
5589 HREF=
"smb.conf.5.html#ADDUSERSCRIPT"
5593 parameter. Below is an example from a RedHat
6.2 Linux system.
</P
5602 CLASS=
"PROGRAMLISTING"
5603 >add user script = /usr/sbin/useradd -d /dev/null -g
100 -s /bin/false -M %u
</PRE
5609 >In Samba
2.2.1,
<EM
5610 >only the root account
</EM
5611 > can be used to create
5612 machine accounts like this. Therefore, it is required to create
5613 an entry in smbpasswd for
<EM
5618 > be set to s different password that the
5622 > entry for security reasons.
</P
5631 >7.5. Common Problems and Errors
</A
5641 >I cannot include a '$' in a machine name.
</EM
5645 > A 'machine name' in (typically)
<TT
5649 of the machine name with a '$' appended. FreeBSD (and other BSD
5650 systems ?) won't create a user with a '$' in their name.
5653 > The problem is only in the program used to make the entry, once
5654 made, it works perfectly. So create a user without the '$' and
5658 > to edit the entry, adding the '$'. Or create
5659 the whole entry with vipw if you like, make sure you use a
5666 >I get told
"You already have a connection to the Domain...."
5667 or
"Cannot join domain, the credentials supplied conflict with an
5668 existing set.." when creating a machine account.
</EM
5672 > This happens if you try to create a machine account from the
5673 machine itself and already have a connection (e.g. mapped drive)
5674 to a share (or IPC$) on the Samba PDC. The following command
5675 will remove all network drive connections:
5687 > Further, if the machine is a already a 'member of a workgroup' that
5688 is the same name as the domain you are joining (bad idea) you will
5689 get this message. Change the workgroup name to something else, it
5690 does not matter what, reboot, and try again.
5696 >The system can not log you on (C000019B)....
</EM
5700 >I joined the domain successfully but after upgrading
5701 to a newer version of the Samba code I get the message,
"The system
5702 can not log you on (C000019B), Please try a gain or consult your
5703 system administrator" when attempting to logon.
5706 > This occurs when the domain SID stored in
5709 >private/WORKGROUP.SID
</TT
5711 changed. For example, you remove the file and
<B
5715 creates a new one. Or you are swapping back and forth between
5716 versions
2.0.7, TNG and the HEAD branch code (not recommended). The
5717 only way to correct the problem is to restore the original domain
5718 SID or remove the domain client from the domain and rejoin.
5724 >The machine account for this computer either does not
5725 exist or is not accessible.
</EM
5729 > When I try to join the domain I get the message
"The machine account
5730 for this computer either does not exist or is not accessible". Whats
5734 > This problem is caused by the PDC not having a suitable machine account.
5735 If you are using the
<TT
5741 accounts then this would indicate that it has not worked. Ensure the domain
5742 admin user system is working.
5745 > Alternatively if you are creating account entries manually then they
5746 have not been created correctly. Make sure that you have the entry
5747 correct for the machine account in smbpasswd file on the Samba PDC.
5748 If you added the account using an editor rather than using the smbpasswd
5749 utility, make sure that the account name is the machine netbios name
5750 with a '$' appended to it ( ie. computer_name$ ). There must be an entry
5751 in both /etc/passwd and the smbpasswd file. Some people have reported
5752 that inconsistent subnet masks between the Samba server and the NT
5753 client have caused this problem. Make sure that these are consistent
5754 for both client and server.
5760 >When I attempt to login to a Samba Domain from a NT4/W2K workstation,
5761 I get a message about my account being disabled.
</EM
5765 > This problem is caused by a PAM related bug in Samba
2.2.0. This bug is
5766 fixed in
2.2.1. Other symptoms could be unaccessible shares on
5767 NT/W2K member servers in the domain or the following error in your smbd.log:
5768 passdb/pampass.c:pam_account(
268) PAM: UNKNOWN ERROR for User: %user%
5771 > At first be ensure to enable the useraccounts with
<B
5775 >, this is normaly done, when you create an account.
5778 > In order to work around this problem in
2.2.0, configure the
5787 >/etc/pam.d/samba
</TT
5798 CLASS=
"PROGRAMLISTING"
5799 > account required pam_permit.so
5806 > If you want to remain backward compatibility to samba
2.0.x use
5810 >, it's also possible to use
5814 >. There are some bugs if you try to
5818 >, if you need this, be ensure to use
5819 the most recent version of this file.
5830 >7.6. System Policies and Profiles
</A
5833 >Much of the information necessary to implement System Policies and
5834 Roving User Profiles in a Samba domain is the same as that for
5835 implementing these same items in a Windows NT
4.0 domain.
5836 You should read the white paper
<A
5837 HREF=
"http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp"
5840 Profiles and Policies in Windows NT
4.0</A
5841 > available from Microsoft.
</P
5843 >Here are some additional details:
</P
5850 >What about Windows NT Policy Editor ?
</EM
5854 > To create or edit
<TT
5858 the NT Server Policy Editor,
<B
5862 is included with NT Server but
<EM
5863 >not NT Workstation
</EM
5865 There is a Policy Editor on a NTws
5866 but it is not suitable for creating
<EM
5867 >Domain Policies
</EM
5869 Further, although the Windows
95
5870 Policy Editor can be installed on an NT Workstation/Server, it will not
5871 work with NT policies because the registry key that are set by the policy templates.
5872 However, the files from the NT Server will run happily enough on an NTws.
5875 >poledit.exe, common.adm
</TT
5880 to put the two *.adm files in
<TT
5884 the binary will look for them unless told otherwise. Note also that that
5885 directory is 'hidden'.
5888 > The Windows NT policy editor is also included with the Service Pack
3 (and
5889 later) for Windows NT
4.0. Extract the files using
<B
5891 >servicepackname /x
</B
5896 > for service pack
6a. The policy editor,
5900 > and the associated template files (*.adm) should
5901 be extracted as well. It is also possible to downloaded the policy template
5902 files for Office97 and get a copy of the policy editor. Another possible
5903 location is with the Zero Administration Kit available for download from Microsoft.
5909 >Can Win95 do Policies ?
</EM
5913 > Install the group policy handler for Win9x to pick up group
5914 policies. Look on the Win98 CD in
<TT
5916 >\tools\reskit\netadmin\poledit
</TT
5918 Install group policies on a Win9x client by double-clicking
5922 >. Log off and on again a couple of
5923 times and see if Win98 picks up group policies. Unfortunately this needs
5924 to be done on every Win9x machine that uses group policies....
5927 > If group policies don't work one reports suggests getting the updated
5928 (read: working) grouppol.dll for Windows
9x. The group list is grabbed
5935 >How do I get 'User Manager' and 'Server Manager'
</EM
5939 > Since I don't need to buy an NT Server CD now, how do I get
5940 the 'User Manager for Domains', the 'Server Manager' ?
5943 > Microsoft distributes a version of these tools called nexus for
5944 installation on Windows
95 systems. The tools set includes
5955 >User Manager for Domains
</P
5963 > Click here to download the archived file
<A
5964 HREF=
"ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE"
5966 >ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE
</A
5970 > The Windows NT
4.0 version of the 'User Manager for
5971 Domains' and 'Server Manager' are available from Microsoft via ftp
5973 HREF=
"ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE"
5975 >ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE
</A
5987 >7.7. What other help can I get ?
</A
5990 >There are many sources of information available in the form
5991 of mailing lists, RFC's and documentation. The docs that come
5992 with the samba distribution contain very good explanations of
5993 general SMB topics such as browsing.
</P
6000 >What are some diagnostics tools I can use to debug the domain logon
6001 process and where can I find them?
</EM
6005 > One of the best diagnostic tools for debugging problems is Samba itself.
6006 You can use the -d option for both smbd and nmbd to specifiy what
6007 'debug level' at which to run. See the man pages on smbd, nmbd and
6008 smb.conf for more information on debugging options. The debug
6009 level can range from
1 (the default) to
10 (
100 for debugging passwords).
6012 > Another helpful method of debugging is to compile samba using the
6016 > flag. This will include debug
6017 information in the binaries and allow you to attach gdb to the
6018 running smbd / nmbd process. In order to attach gdb to an smbd
6019 process for an NT workstation, first get the workstation to make the
6020 connection. Pressing ctrl-alt-delete and going down to the domain box
6021 is sufficient (at least, on the first time you join the domain) to
6022 generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation
6023 maintains an open connection, and therefore there will be an smbd
6024 process running (assuming that you haven't set a really short smbd
6025 idle timeout) So, in between pressing ctrl alt delete, and actually
6026 typing in your password, you can gdb attach and continue.
6029 > Some useful samba commands worth investigating:
6036 >testparam | more
</P
6040 >smbclient -L //{netbios name of server}
</P
6044 > An SMB enabled version of tcpdump is available from
6046 HREF=
"http://www.tcpdump.org/"
6048 >http://www.tcpdup.org/
</A
6050 Ethereal, another good packet sniffer for UNIX and Win32
6051 hosts, can be downloaded from
<A
6052 HREF=
"http://www.ethereal.com/"
6054 >http://www.ethereal.com
</A
6058 > For tracing things on the Microsoft Windows NT, Network Monitor
6059 (aka. netmon) is available on the Microsoft Developer Network CD's,
6060 the Windows NT Server install CD and the SMS CD's. The version of
6061 netmon that ships with SMS allows for dumping packets between any two
6062 computers (ie. placing the network interface in promiscuous mode).
6063 The version on the NT Server install CD will only allow monitoring
6064 of network traffic directed to the local NT box and broadcasts on the
6065 local subnet. Be aware that Ethereal can read and write netmon
6072 >How do I install 'Network Monitor' on an NT Workstation
6073 or a Windows
9x box?
</EM
6077 > Installing netmon on an NT workstation requires a couple
6078 of steps. The following are for installing Netmon V4.00
.349, which comes
6079 with Microsoft Windows NT Server
4.0, on Microsoft Windows NT
6080 Workstation
4.0. The process should be similar for other version of
6081 Windows NT / Netmon. You will need both the Microsoft Windows
6082 NT Server
4.0 Install CD and the Workstation
4.0 Install CD.
6085 > Initially you will need to install 'Network Monitor Tools and Agent'
6086 on the NT Server. To do this
6093 >Goto Start - Settings - Control Panel -
6094 Network - Services - Add
</P
6098 >Select the 'Network Monitor Tools and Agent' and
6103 >Click 'OK' on the Network Control Panel.
6108 >Insert the Windows NT Server
4.0 install CD
6113 > At this point the Netmon files should exist in
6116 >%SYSTEMROOT%\System32\netmon\*.*
</TT
6118 Two subdirectories exist as well,
<TT
6122 which contains the necessary DLL's for parsing the netmon packet
6129 > In order to install the Netmon tools on an NT Workstation, you will
6130 first need to install the 'Network Monitor Agent' from the Workstation
6138 >Goto Start - Settings - Control Panel -
6139 Network - Services - Add
</P
6143 >Select the 'Network Monitor Agent' and click
6148 >Click 'OK' on the Network Control Panel.
6153 >Insert the Windows NT Workstation
4.0 install
6154 CD when prompted.
</P
6158 > Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.*
6159 to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set
6160 permissions as you deem appropriate for your site. You will need
6161 administrative rights on the NT box to run netmon.
6164 > To install Netmon on a Windows
9x box install the network monitor agent
6165 from the Windows
9x CD (\admin\nettools\netmon). There is a readme
6166 file located with the netmon driver files on the CD if you need
6167 information on how to do this. Copy the files from a working
6168 Netmon installation.
6173 > The following is a list if helpful URLs and other links:
6180 >Home of Samba site
<A
6181 HREF=
"http://samba.org"
6183 > http://samba.org
</A
6184 >. We have a mirror near you !
</P
6191 on the Samba mirrors might mention your problem. If so,
6192 it might mean that the developers are working on it.
</P
6196 >See how Scott Merrill simulates a BDC behavior at
6198 HREF=
"http://www.skippy.net/linux/smb-howto.html"
6200 > http://www.skippy.net/linux/smb-howto.html
</A
6205 >Although
2.0.7 has almost had its day as a PDC, David Bannon will
6206 keep the
2.0.7 PDC pages at
<A
6207 HREF=
"http://bioserve.latrobe.edu.au/samba"
6209 > http://bioserve.latrobe.edu.au/samba
</A
6210 > going for a while yet.
</P
6214 >Misc links to CIFS information
6216 HREF=
"http://samba.org/cifs/"
6218 >http://samba.org/cifs/
</A
6223 >NT Domains for Unix
<A
6224 HREF=
"http://mailhost.cb1.com/~lkcl/ntdom/"
6226 > http://mailhost.cb1.com/~lkcl/ntdom/
</A
6231 >FTP site for older SMB specs:
6233 HREF=
"ftp://ftp.microsoft.com/developr/drg/CIFS/"
6235 > ftp://ftp.microsoft.com/developr/drg/CIFS/
</A
6247 >How do I get help from the mailing lists ?
</EM
6251 > There are a number of Samba related mailing lists. Go to
<A
6252 HREF=
"http://samba.org"
6254 >http://samba.org
</A
6255 >, click on your nearest mirror
6256 and then click on
<B
6259 > and then click on
<B
6261 > Samba related mailing lists
</B
6265 > For questions relating to Samba TNG go to
6267 HREF=
"http://www.samba-tng.org/"
6269 >http://www.samba-tng.org/
</A
6271 It has been requested that you don't post questions about Samba-TNG to the
6272 main stream Samba lists.
</P
6274 > If you post a message to one of the lists please observe the following guide lines :
6281 > Always remember that the developers are volunteers, they are
6282 not paid and they never guarantee to produce a particular feature at
6283 a particular time. Any time lines are 'best guess' and nothing more.
6288 > Always mention what version of samba you are using and what
6289 operating system its running under. You should probably list the
6290 relevant sections of your smb.conf file, at least the options
6291 in [global] that affect PDC support.
</P
6295 >In addition to the version, if you obtained Samba via
6296 CVS mention the date when you last checked it out.
</P
6300 > Try and make your question clear and brief, lots of long,
6301 convoluted questions get deleted before they are completely read !
6302 Don't post html encoded messages (if you can select colour or font
6307 > If you run one of those nifty 'I'm on holidays' things when
6308 you are away, make sure its configured to not answer mailing lists.
6313 > Don't cross post. Work out which is the best list to post to
6314 and see what happens, ie don't post to both samba-ntdom and samba-technical.
6315 Many people active on the lists subscribe to more
6316 than one list and get annoyed to see the same message two or more times.
6317 Often someone will see a message and thinking it would be better dealt
6318 with on another, will forward it on for you.
</P
6322 >You might include
<EM
6325 log files written at a debug level set to as much as
20.
6326 Please don't send the entire log but enough to give the context of the
6331 >(Possibly) If you have a complete netmon trace ( from the opening of
6332 the pipe to the error ) you can send the *.CAP file as well.
</P
6336 >Please think carefully before attaching a document to an email.
6337 Consider pasting the relevant parts into the body of the message. The samba
6338 mailing lists go to a huge number of people, do they all need a copy of your
6339 smb.conf in their attach directory ?
</P
6346 >How do I get off the mailing lists ?
</EM
6350 >To have your name removed from a samba mailing list, go to the
6351 same place you went to to get on it. Go to
<A
6352 HREF=
"http://lists.samba.org/"
6354 >http://lists.samba.org
</A
6356 click on your nearest mirror and then click on
<B
6362 > Samba related mailing lists
</B
6365 HREF=
"http://lists.samba.org/mailman/roster/samba-ntdom"
6371 > Please don't post messages to the list asking to be removed, you will just
6372 be referred to the above address (unless that process failed in some way...)
6383 >7.8. Domain Control for Windows
9x/ME
</A
6392 >The following section contains much of the original
6393 DOMAIN.txt file previously included with Samba. Much of
6394 the material is based on what went into the book Special
6395 Edition, Using Samba. (Richard Sharpe)
</P
6399 >A domain and a workgroup are exactly the same thing in terms of network
6400 browsing. The difference is that a distributable authentication
6401 database is associated with a domain, for secure login access to a
6402 network. Also, different access rights can be granted to users if they
6403 successfully authenticate against a domain logon server (NT server and
6404 other systems based on NT server support this, as does at least Samba TNG now).
</P
6406 >The SMB client logging on to a domain has an expectation that every other
6407 server in the domain should accept the same authentication information.
6408 Network browsing functionality of domains and workgroups is
6409 identical and is explained in BROWSING.txt. It should be noted, that browsing
6410 is total orthogonal to logon support.
</P
6412 >Issues related to the single-logon network model are discussed in this
6413 document. Samba supports domain logons, network logon scripts, and user
6414 profiles for MS Windows for workgroups and MS Windows
9X clients.
</P
6416 >When an SMB client in a domain wishes to logon it broadcast requests for a
6417 logon server. The first one to reply gets the job, and validates its
6418 password using whatever mechanism the Samba administrator has installed.
6419 It is possible (but very stupid) to create a domain where the user
6420 database is not shared between servers, ie they are effectively workgroup
6421 servers advertising themselves as participating in a domain. This
6422 demonstrates how authentication is quite different from but closely
6423 involved with domains.
</P
6425 >Another thing commonly associated with single-logon domains is remote
6426 administration over the SMB protocol. Again, there is no reason why this
6427 cannot be implemented with an underlying username database which is
6428 different from the Windows NT SAM. Support for the Remote Administration
6429 Protocol is planned for a future release of Samba.
</P
6431 >Network logon support as discussed in this section is aimed at Window for
6432 Workgroups, and Windows
9X clients.
</P
6434 >Support for profiles is confirmed as working for Win95, NT
4.0 and NT
3.51.
6435 It is possible to specify: the profile location; script file to be loaded
6436 on login; the user's home directory; and for NT a kick-off time could also
6437 now easily be supported. However, there are some differences between Win9X
6438 profile support and WinNT profile support. These are discussed below.
</P
6440 >With NT Workstations, all this does not require the use or intervention of
6441 an NT
4.0 or NT
3.51 server: Samba can now replace the logon services
6442 provided by an NT server, to a limited and experimental degree (for example,
6443 running
"User Manager for Domains" will not provide you with access to
6444 a domain created by a Samba Server).
</P
6446 >With Win95, the help of an NT server can be enlisted, both for profile storage
6447 and for user authentication. For details on user authentication, see
6448 security_level.txt. For details on profile storage, see below.
</P
6450 >Using these features you can make your clients verify their logon via
6451 the Samba server; make clients run a batch file when they logon to
6452 the network and download their preferences, desktop and start menu.
</P
6454 >Before launching into the configuration instructions, it is worthwhile looking
6455 at how a Win9X client performs a logon:
</P
6462 > The client broadcasts (to the IP broadcast address of the subnet it is in)
6463 a NetLogon request. This is sent to the NetBIOS address DOMAIN
<00> at the
6464 NetBIOS layer. The client chooses the first response it receives, which
6465 contains the NetBIOS name of the logon server to use in the format of
6471 > The client then connects to that server, logs on (does an SMBsessetupX) and
6472 then connects to the IPC$ share (using an SMBtconX).
6477 > The client then does a NetWkstaUserLogon request, which retrieves the name
6478 of the user's logon script.
6483 > The client then connects to the NetLogon share and searches for this
6484 and if it is found and can be read, is retrieved and executed by the client.
6485 After this, the client disconnects from the NetLogon share.
6490 > The client then sends a NetUserGetInfo request to the server, to retrieve
6491 the user's home share, which is used to search for profiles. Since the
6492 response to the NetUserGetInfo request does not contain much more
6493 the user's home share, profiles for Win9X clients MUST reside in the user
6499 > The client then connects to the user's home share and searches for the
6500 user's profile. As it turns out, you can specify the users home share as
6501 a sharename and path. For example, \\server\fred\.profile.
6502 If the profiles are found, they are implemented.
6507 > The client then disconnects from the user's home share, and reconnects to
6508 the NetLogon share and looks for CONFIG.POL, the policies file. If this is
6509 found, it is read and implemented.
6519 >7.8.1. Configuration Instructions: Network Logons
</A
6522 >To use domain logons and profiles you need to do the following:
</P
6529 > Create a share called [netlogon] in your smb.conf. This share should
6530 be readable by all users, and probably should not be writeable. This
6531 share will hold your network logon scripts, and the CONFIG.POL file
6532 (Note: for details on the CONFIG.POL file, how to use it, what it is,
6533 refer to the Microsoft Windows NT Administration documentation.
6534 The format of these files is not known, so you will need to use
6538 > For example I have used:
6548 CLASS=
"PROGRAMLISTING"
6550 path = /data/dos/netlogon
6558 > Note that it is important that this share is not writeable by ordinary
6559 users, in a secure environment: ordinary users should not be allowed
6560 to modify or add files that another user's computer would then download
6566 > in the [global] section of smb.conf set the following:
6576 CLASS=
"PROGRAMLISTING"
6577 >domain logons = yes
6578 logon script = %U.bat
6585 > The choice of batch file is, of course, up to you. The above would
6586 give each user a separate batch file as the %U will be changed to
6587 their username automatically. The other standard % macros may also be
6588 used. You can make the batch files come from a subdirectory by using
6599 CLASS=
"PROGRAMLISTING"
6600 >logon script = scripts\%U.bat
6609 > create the batch files to be run when the user logs in. If the batch
6610 file doesn't exist then no batch file will be run.
6613 > In the batch files you need to be careful to use DOS style cr/lf line
6614 endings. If you don't then DOS may get confused. I suggest you use a
6615 DOS editor to remotely edit the files if you don't know how to produce
6616 DOS style files under unix.
6621 > Use smbclient with the -U option for some users to make sure that
6622 the \\server\NETLOGON share is available, the batch files are
6623 visible and they are readable by the users.
6628 > you will probabaly find that your clients automatically mount the
6629 \\SERVER\NETLOGON share as drive z: while logging in. You can put
6630 some useful programs there to execute from the batch files.
6646 >security mode and master browsers
</B
6653 >There are a few comments to make in order to tie up some
6654 loose ends. There has been much debate over the issue of whether
6655 or not it is ok to configure Samba as a Domain Controller in security
6656 modes other than
<TT
6659 >. The only security mode
6660 which will not work due to technical reasons is
<TT
6671 mode security is really just a variation on SMB user level security.
</P
6673 >Actually, this issue is also closer tied to the debate on whether
6674 or not Samba must be the domain master browser for its workgroup
6675 when operating as a DC. While it may technically be possible
6676 to configure a server as such (after all, browsing and domain logons
6677 are two distinctly different functions), it is not a good idea to
6678 so. You should remember that the DC must register the DOMAIN#
1b netbios
6679 name. This is the name used by Windows clients to locate the DC.
6680 Windows clients do not distinguish between the DC and the DMB.
6681 For this reason, it is very wise to configure the Samba DC as the DMB.
</P
6683 >Now back to the issue of configuring a Samba DC to use a mode other
6684 than
"security = user". If a Samba host is configured to use
6685 another SMB server or DC in order to validate user connection
6686 requests, then it is a fact that some other machine on the network
6687 (the
"password server") knows more about user than the Samba host.
6688 99% of the time, this other host is a domain controller. Now
6689 in order to operate in domain mode security, the
"workgroup" parameter
6690 must be set to the name of the Windows NT domain (which already
6691 has a domain controller, right?)
</P
6693 >Therefore configuring a Samba box as a DC for a domain that
6694 already by definition has a PDC is asking for trouble.
6695 Therefore, you should always configure the Samba DC to be the DMB
6708 >7.8.2. Configuration Instructions: Setting up Roaming User Profiles
</A
6731 > Roaming profiles support is different
6732 for Win9X and WinNT.
</P
6738 >Before discussing how to configure roaming profiles, it is useful to see how
6739 Win9X and WinNT clients implement these features.
</P
6741 >Win9X clients send a NetUserGetInfo request to the server to get the user's
6742 profiles location. However, the response does not have room for a separate
6743 profiles location field, only the users home share. This means that Win9X
6744 profiles are restricted to being in the user's home directory.
</P
6746 >WinNT clients send a NetSAMLogon RPC request, which contains many fields,
6747 including a separate field for the location of the user's profiles.
6748 This means that support for profiles is different for Win9X and WinNT.
</P
6755 >7.8.2.1. Windows NT Configuration
</A
6758 >To support WinNT clients, inn the [global] section of smb.conf set the
6759 following (for example):
</P
6768 CLASS=
"PROGRAMLISTING"
6769 >logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath
</PRE
6775 >The default for this option is \\%N\%U\profile, namely
6776 \\sambaserver\username\profile. The \\N%\%U service is created
6777 automatically by the [homes] service.
6778 If you are using a samba server for the profiles, you _must_ make the
6779 share specified in the logon path browseable.
</P
6787 >[lkcl
26aug96 - we have discovered a problem where Windows clients can
6788 maintain a connection to the [homes] share in between logins. The
6789 [homes] share must NOT therefore be used in a profile path.]
</P
6799 >7.8.2.2. Windows
9X Configuration
</A
6802 >To support Win9X clients, you must use the
"logon home" parameter. Samba has
6803 now been fixed so that
"net use/home" now works as well, and it, too, relies
6804 on the
"logon home" parameter.
</P
6806 >By using the logon home parameter, you are restricted to putting Win9X
6807 profiles in the user's home directory. But wait! There is a trick you
6808 can use. If you set the following in the [global] section of your
6818 CLASS=
"PROGRAMLISTING"
6819 >logon home = \\%L\%U\.profiles
</PRE
6825 >then your Win9X clients will dutifully put their clients in a subdirectory
6826 of your home directory called .profiles (thus making them hidden).
</P
6828 >Not only that, but 'net use/home' will also work, because of a feature in
6829 Win9X. It removes any directory stuff off the end of the home directory area
6830 and only uses the server and share portion. That is, it looks like you
6831 specified \\%L\%U for
"logon home".
</P
6839 >7.8.2.3. Win9X and WinNT Configuration
</A
6842 >You can support profiles for both Win9X and WinNT clients by setting both the
6843 "logon home" and
"logon path" parameters. For example:
</P
6852 CLASS=
"PROGRAMLISTING"
6853 >logon home = \\%L\%U\.profiles
6854 logon path = \\%L\profiles\%U
</PRE
6866 >I have not checked what 'net use /home' does on NT when
"logon home" is
6877 >7.8.2.4. Windows
9X Profile Setup
</A
6880 >When a user first logs in on Windows
9X, the file user.DAT is created,
6881 as are folders
"Start Menu",
"Desktop",
"Programs" and
"Nethood".
6882 These directories and their contents will be merged with the local
6883 versions stored in c:\windows\profiles\username on subsequent logins,
6884 taking the most recent from each. You will need to use the [global]
6885 options
"preserve case = yes",
"short case preserve = yes" and
6886 "case sensitive = no" in order to maintain capital letters in shortcuts
6887 in any of the profile folders.
</P
6889 >The user.DAT file contains all the user's preferences. If you wish to
6890 enforce a set of preferences, rename their user.DAT file to user.MAN,
6891 and deny them write access to this file.
</P
6898 > On the Windows
95 machine, go to Control Panel | Passwords and
6899 select the User Profiles tab. Select the required level of
6900 roaming preferences. Press OK, but do _not_ allow the computer
6906 > On the Windows
95 machine, go to Control Panel | Network |
6907 Client for Microsoft Networks | Preferences. Select 'Log on to
6908 NT Domain'. Then, ensure that the Primary Logon is 'Client for
6909 Microsoft Networks'. Press OK, and this time allow the computer
6915 >Under Windows
95, Profiles are downloaded from the Primary Logon.
6916 If you have the Primary Logon as 'Client for Novell Networks', then
6917 the profiles and logon script will be downloaded from your Novell
6918 Server. If you have the Primary Logon as 'Windows Logon', then the
6919 profiles will be loaded from the local machine - a bit against the
6920 concept of roaming profiles, if you ask me.
</P
6922 >You will now find that the Microsoft Networks Login box contains
6923 [user, password, domain] instead of just [user, password]. Type in
6924 the samba server's domain name (or any other domain known to exist,
6925 but bear in mind that the user will be authenticated against this
6926 domain and profiles downloaded from it, if that domain logon server
6927 supports it), user name and user's password.
</P
6929 >Once the user has been successfully validated, the Windows
95 machine
6930 will inform you that 'The user has not logged on before' and asks you
6931 if you wish to save the user's preferences? Select 'yes'.
</P
6933 >Once the Windows
95 client comes up with the desktop, you should be able
6934 to examine the contents of the directory specified in the
"logon path"
6935 on the samba server and verify that the
"Desktop",
"Start Menu",
6936 "Programs" and
"Nethood" folders have been created.
</P
6938 >These folders will be cached locally on the client, and updated when
6939 the user logs off (if you haven't made them read-only by then :-).
6940 You will find that if the user creates further folders or short-cuts,
6941 that the client will merge the profile contents downloaded with the
6942 contents of the profile directory already on the local client, taking
6943 the newest folders and short-cuts from each set.
</P
6945 >If you have made the folders / files read-only on the samba server,
6946 then you will get errors from the w95 machine on logon and logout, as
6947 it attempts to merge the local and the remote profile. Basically, if
6948 you have any errors reported by the w95 machine, check the unix file
6949 permissions and ownership rights on the profile directory contents,
6950 on the samba server.
</P
6952 >If you have problems creating user profiles, you can reset the user's
6953 local desktop cache, as shown below. When this user then next logs in,
6954 they will be told that they are logging in
"for the first time".
</P
6961 > instead of logging in under the [user, password, domain] dialog,
6967 > run the regedit.exe program, and look in:
6970 > HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
6973 > you will find an entry, for each user, of ProfilePath. Note the
6974 contents of this key (likely to be c:\windows\profiles\username),
6975 then delete the key ProfilePath for the required user.
6978 > [Exit the registry editor].
6985 > - before deleting the contents of the
6987 the ProfilePath (this is likely to be c:\windows\profiles\username),
6988 ask them if they have any important files stored on their desktop
6989 or in their start menu. delete the contents of the directory
6990 ProfilePath (making a backup if any of the files are needed).
6993 > This will have the effect of removing the local (read-only hidden
6994 system file) user.DAT in their profile directory, as well as the
6995 local
"desktop",
"nethood",
"start menu" and
"programs" folders.
7000 > search for the user's .PWL password-cacheing file in the c:\windows
7001 directory, and delete it.
7006 > log off the windows
95 client.
7011 > check the contents of the profile path (see
"logon path" described
7012 above), and delete the user.DAT or user.MAN file for the user,
7013 making a backup if required.
7018 >If all else fails, increase samba's debug log levels to between
3 and
10,
7019 and / or run a packet trace program such as tcpdump or netmon.exe, and
7020 look for any error reports.
</P
7022 >If you have access to an NT server, then first set up roaming profiles
7023 and / or netlogons on the NT server. Make a packet trace, or examine
7024 the example packet traces provided with NT server, and see what the
7025 differences are with the equivalent samba trace.
</P
7033 >7.8.2.5. Windows NT Workstation
4.0</A
7036 >When a user first logs in to a Windows NT Workstation, the profile
7037 NTuser.DAT is created. The profile location can be now specified
7038 through the
"logon path" parameter.
</P
7046 >[lkcl
10aug97 - i tried setting the path to
7047 \\samba-server\homes\profile, and discovered that this fails because
7048 a background process maintains the connection to the [homes] share
7049 which does _not_ close down in between user logins. you have to
7050 have \\samba-server\%L\profile, where user is the username created
7051 from the [homes] share].
</P
7055 >There is a parameter that is now available for use with NT Profiles:
7056 "logon drive". This should be set to
"h:" or any other drive, and
7057 should be used in conjunction with the new
"logon home" parameter.
</P
7059 >The entry for the NT
4.0 profile is a _directory_ not a file. The NT
7060 help on profiles mentions that a directory is also created with a .PDS
7061 extension. The user, while logging in, must have write permission to
7062 create the full profile path (and the folder with the .PDS extension)
7063 [lkcl
10aug97 - i found that the creation of the .PDS directory failed,
7064 and had to create these manually for each user, with a shell script.
7065 also, i presume, but have not tested, that the full profile path must
7066 be browseable just as it is for w95, due to the manner in which they
7067 attempt to create the full profile path: test existence of each path
7068 component; create path component].
</P
7070 >In the profile directory, NT creates more folders than
95. It creates
7071 "Application Data" and others, as well as
"Desktop",
"Nethood",
7072 "Start Menu" and
"Programs". The profile itself is stored in a file
7073 NTuser.DAT. Nothing appears to be stored in the .PDS directory, and
7074 its purpose is currently unknown.
</P
7076 >You can use the System Control Panel to copy a local profile onto
7077 a samba server (see NT Help on profiles: it is also capable of firing
7078 up the correct location in the System Control Panel for you). The
7079 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
7080 turns a profile into a mandatory one.
</P
7088 >[lkcl
10aug97 - i notice that NT Workstation tells me that it is
7089 downloading a profile from a slow link. whether this is actually the
7090 case, or whether there is some configuration issue, as yet unknown,
7091 that makes NT Workstation _think_ that the link is a slow one is a
7092 matter to be resolved].
</P
7094 >[lkcl
20aug97 - after samba digest correspondance, one user found, and
7095 another confirmed, that profiles cannot be loaded from a samba server
7096 unless
"security = user" and
"encrypt passwords = yes" (see the file
7097 ENCRYPTION.txt) or
"security = server" and
"password server = ip.address.
7098 of.yourNTserver" are used. either of these options will allow the NT
7099 workstation to access the samba server using LAN manager encrypted
7100 passwords, without the user intervention normally required by NT
7101 workstation for clear-text passwords].
</P
7103 >[lkcl
25aug97 - more comments received about NT profiles: the case of
7104 the profile _matters_. the file _must_ be called NTuser.DAT or, for
7105 a mandatory profile, NTuser.MAN].
</P
7115 >7.8.2.6. Windows NT Server
</A
7118 >There is nothing to stop you specifying any path that you like for the
7119 location of users' profiles. Therefore, you could specify that the
7120 profile be stored on a samba server, or any other SMB server, as long as
7121 that SMB server supports encrypted passwords.
</P
7129 >7.8.2.7. Sharing Profiles between W95 and NT Workstation
4.0</A
7143 >Potentially outdated or incorrect material follows
</B
7150 >I think this is all bogus, but have not deleted it. (Richard Sharpe)
</P
7156 >The default logon path is \\%N\U%. NT Workstation will attempt to create
7157 a directory
"\\samba-server\username.PDS" if you specify the logon path
7158 as
"\\samba-server\username" with the NT User Manager. Therefore, you
7159 will need to specify (for example)
"\\samba-server\username\profile".
7160 NT
4.0 will attempt to create
"\\samba-server\username\profile.PDS", which
7161 is more likely to succeed.
</P
7163 >If you then want to share the same Start Menu / Desktop with W95, you will
7164 need to specify
"logon path = \\samba-server\username\profile" [lkcl
10aug97
7165 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
7166 to run from the c:\winnt\system32 directory. this directory is obviously
7167 unlikely to exist on a Win95-only host].
</P
7169 > If you have this set up correctly, you will find separate user.DAT and
7170 NTuser.DAT files in the same profile directory.
</P
7178 >[lkcl
25aug97 - there are some issues to resolve with downloading of
7179 NT profiles, probably to do with time/date stamps. i have found that
7180 NTuser.DAT is never updated on the workstation after the first time that
7181 it is copied to the local workstation profile directory. this is in
7182 contrast to w95, where it _does_ transfer / update profiles correctly].
</P
7194 >7.9. DOMAIN_CONTROL.txt : Windows NT Domain Control
& Samba
</A
7208 >Possibly Outdated Material
</B
7215 > This appendix was originally authored by John H Terpstra of
7216 the Samba Team and is included here for posterity.
7226 The term
"Domain Controller" and those related to it refer to one specific
7227 method of authentication that can underly an SMB domain. Domain Controllers
7228 prior to Windows NT Server
3.1 were sold by various companies and based on
7229 private extensions to the LAN Manager
2.1 protocol. Windows NT introduced
7230 Microsoft-specific ways of distributing the user authentication database.
7231 See DOMAIN.txt for examples of how Samba can participate in or create
7232 SMB domains based on shared authentication database schemes other than the
7235 >Windows NT Server can be installed as either a plain file and print server
7236 (WORKGROUP workstation or server) or as a server that participates in Domain
7237 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
7238 The same is true for OS/
2 Warp Server, Digital Pathworks and other similar
7239 products, all of which can participate in Domain Control along with Windows NT.
</P
7241 >To many people these terms can be confusing, so let's try to clear the air.
</P
7243 >Every Windows NT system (workstation or server) has a registry database.
7244 The registry contains entries that describe the initialization information
7245 for all services (the equivalent of Unix Daemons) that run within the Windows
7246 NT environment. The registry also contains entries that tell application
7247 software where to find dynamically loadable libraries that they depend upon.
7248 In fact, the registry contains entries that describes everything that anything
7249 may need to know to interact with the rest of the system.
</P
7251 >The registry files can be located on any Windows NT machine by opening a
7252 command prompt and typing:
</P
7257 > dir %SystemRoot%\System32\config
</P
7259 >The environment variable %SystemRoot% value can be obtained by typing:
</P
7264 >echo %SystemRoot%
</P
7266 >The active parts of the registry that you may want to be familiar with are
7267 the files called: default, system, software, sam and security.
</P
7269 >In a domain environment, Microsoft Windows NT domain controllers participate
7270 in replication of the SAM and SECURITY files so that all controllers within
7271 the domain have an exactly identical copy of each.
</P
7273 >The Microsoft Windows NT system is structured within a security model that
7274 says that all applications and services must authenticate themselves before
7275 they can obtain permission from the security manager to do what they set out
7278 >The Windows NT User database also resides within the registry. This part of
7279 the registry contains the user's security identifier, home directory, group
7280 memberships, desktop profile, and so on.
</P
7282 >Every Windows NT system (workstation as well as server) will have its own
7283 registry. Windows NT Servers that participate in Domain Security control
7284 have a database that they share in common - thus they do NOT own an
7285 independent full registry database of their own, as do Workstations and
7288 >The User database is called the SAM (Security Access Manager) database and
7289 is used for all user authentication as well as for authentication of inter-
7290 process authentication (ie: to ensure that the service action a user has
7291 requested is permitted within the limits of that user's privileges).
</P
7293 >The Samba team have produced a utility that can dump the Windows NT SAM into
7294 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
7295 /pub/samba/pwdump on your nearest Samba mirror for the utility. This
7296 facility is useful but cannot be easily used to implement SAM replication
7297 to Samba systems.
</P
7299 >Windows for Workgroups, Windows
95, and Windows NT Workstations and Servers
7300 can participate in a Domain security system that is controlled by Windows NT
7301 servers that have been correctly configured. At most every domain will have
7302 ONE Primary Domain Controller (PDC). It is desirable that each domain will
7303 have at least one Backup Domain Controller (BDC).
</P
7305 >The PDC and BDCs then participate in replication of the SAM database so that
7306 each Domain Controlling participant will have an up to date SAM component
7307 within its registry.
</P
7315 >Chapter
8. Unifed Logons between Windows NT and UNIX using Winbind
</A
7326 >Integration of UNIX and Microsoft Windows NT through
7327 a unified logon has been considered a
"holy grail" in heterogeneous
7328 computing environments for a long time. We present
<EM
7331 >, a component of the Samba suite of programs as a
7332 solution to the unied logon problem. Winbind uses a UNIX implementation
7333 of Microsoft RPC calls, Pluggable Authentication Modules, and the Name
7334 Service Switch to allow Windows NT domain users to appear and operate
7335 as UNIX users on a UNIX machine. This paper describes the winbind
7336 system, explaining the functionality it provides, how it is configured,
7337 and how it works internally.
</P
7345 >8.2. Introduction
</A
7348 >It is well known that UNIX and Microsoft Windows NT have
7349 different models for representing user and group information and
7350 use different technologies for implementing them. This fact has
7351 made it difficult to integrate the two systems in a satisfactory
7354 >One common solution in use today has been to create
7355 identically named user accounts on both the UNIX and Windows systems
7356 and use the Samba suite of programs to provide file and print services
7357 between the two. This solution is far from perfect however, as
7358 adding and deleting users on both sets of machines becomes a chore
7359 and two sets of passwords are required both of which which
7360 can lead to synchronization problems between the UNIX and Windows
7361 systems and confusion for users.
</P
7363 >We divide the unifed logon problem for UNIX machines into
7364 three smaller problems:
</P
7370 >Obtaining Windows NT user and group information
7375 >Authenticating Windows NT users
7380 >Password changing for Windows NT users
7385 >Ideally, a prospective solution to the unified logon problem
7386 would satisfy all the above components without duplication of
7387 information on the UNIX machines and without creating additional
7388 tasks for the system administrator when maintaining users and
7389 groups on either system. The winbind system provides a simple
7390 and elegant solution to all three components of the unifed logon
7399 >8.3. What Winbind Provides
</A
7402 >Winbind unifies UNIX and Windows NT account management by
7403 allowing a UNIX box to become a full member of a NT domain. Once
7404 this is done the UNIX box will see NT users and groups as if
7405 they were native UNIX users and groups, allowing the NT domain
7406 to be used in much the same manner that NIS+ is used within
7407 UNIX-only environments.
</P
7409 >The end result is that whenever any
7410 program on the UNIX machine asks the operating system to lookup
7411 a user or group name, the query will be resolved by asking the
7412 NT domain controller for the specied domain to do the lookup.
7413 Because Winbind hooks into the operating system at a low level
7414 (via the NSS name resolution modules in the C library) this
7415 redirection to the NT domain controller is completely
7418 >Users on the UNIX machine can then use NT user and group
7419 names as they would use
"native" UNIX names. They can chown files
7420 so that they are owned by NT domain users or even login to the
7421 UNIX machine and run a UNIX X-Window session as a domain user.
</P
7423 >The only obvious indication that Winbind is being used is
7424 that user and group names take the form DOMAIN\user and
7425 DOMAIN\group. This is necessary as it allows Winbind to determine
7426 that redirection to a domain controller is wanted for a particular
7427 lookup and which trusted domain is being referenced.
</P
7429 >Additionally, Winbind provides a authentication service
7430 that hooks into the Pluggable Authentication Modules (PAM) system
7431 to provide authentication via a NT domain to any PAM enabled
7432 applications. This capability solves the problem of synchronizing
7433 passwords between systems as all passwords are stored in a single
7434 location (on the domain controller).
</P
7441 >8.3.1. Target Uses
</A
7444 >Winbind is targeted at organizations that have an
7445 existing NT based domain infrastructure into which they wish
7446 to put UNIX workstations or servers. Winbind will allow these
7447 organizations to deploy UNIX workstations without having to
7448 maintain a separate account infrastructure. This greatly simplies
7449 the administrative overhead of deploying UNIX workstations into
7450 a NT based organization.
</P
7452 >Another interesting way in which we expect Winbind to
7453 be used is as a central part of UNIX based appliances. Appliances
7454 that provide file and print services to Microsoft based networks
7455 will be able to use Winbind to provide seamless integration of
7456 the appliance into the domain.
</P
7465 >8.4. How Winbind Works
</A
7468 >The winbind system is designed around a client/server
7469 architecture. A long running
<B
7473 listens on a UNIX domain socket waiting for requests
7474 to arrive. These requests are generated by the NSS and PAM
7475 clients and processed sequentially.
</P
7477 >The technologies used to implement winbind are described
7485 >8.4.1. Microsoft Remote Procedure Calls
</A
7488 >Over the last two years, efforts have been underway
7489 by various Samba Team members to decode various aspects of
7490 the Microsoft Remote Procedure Call (MSRPC) system. This
7491 system is used for most network related operations between
7492 Windows NT machines including remote management, user authentication
7493 and print spooling. Although initially this work was done
7494 to aid the implementation of Primary Domain Controller (PDC)
7495 functionality in Samba, it has also yielded a body of code which
7496 can be used for other purposes.
</P
7498 >Winbind uses various MSRPC calls to enumerate domain users
7499 and groups and to obtain detailed information about individual
7500 users or groups. Other MSRPC calls can be used to authenticate
7501 NT domain users and to change user passwords. By directly querying
7502 a Windows PDC for user and group information, winbind maps the
7503 NT account information onto UNIX user and group names.
</P
7511 >8.4.2. Name Service Switch
</A
7514 >The Name Service Switch, or NSS, is a feature that is
7515 present in many UNIX operating systems. It allows system
7516 information such as hostnames, mail aliases and user information
7517 to be resolved from dierent sources. For example, a standalone
7518 UNIX workstation may resolve system information from a series of
7519 flat files stored on the local lesystem. A networked workstation
7520 may first attempt to resolve system information from local files,
7521 then consult a NIS database for user information or a DNS server
7522 for hostname information.
</P
7524 >The NSS application programming interface allows winbind
7525 to present itself as a source of system information when
7526 resolving UNIX usernames and groups. Winbind uses this interface,
7527 and information obtained from a Windows NT server using MSRPC
7528 calls to provide a new source of account enumeration. Using standard
7529 UNIX library calls, one can enumerate the users and groups on
7530 a UNIX machine running winbind and see all users and groups in
7531 a NT domain plus any trusted domain as though they were local
7532 users and groups.
</P
7534 >The primary control le for NSS is
<TT
7538 >. When a UNIX application makes a request to do a lookup
7539 the C library looks in
<TT
7541 >/etc/nsswitch.conf
</TT
7543 for a line which matches the service type being requested, for
7544 example the
"passwd" service type is used when user or group names
7545 are looked up. This config line species which implementations
7546 of that service should be tried andin what order. If the passwd
7551 >passwd: files example
</B
7554 >then the C library will first load a module called
7557 >/lib/libnss_files.so
</TT
7561 >/lib/libnss_example.so
</TT
7563 C library will dynamically load each of these modules in turn
7564 and call resolver functions within the modules to try to resolve
7565 the request. Once the request is resolved the C library returns the
7566 result to the application.
</P
7568 >This NSS interface provides a very easy way for Winbind
7569 to hook into the operating system. All that needs to be done
7572 >libnss_winbind.so
</TT
7577 then add
"winbind" into
<TT
7579 >/etc/nsswitch.conf
</TT
7581 the appropriate place. The C library will then call Winbind to
7582 resolve user and group names.
</P
7590 >8.4.3. Pluggable Authentication Modules
</A
7593 >Pluggable Authentication Modules, also known as PAM,
7594 is a system for abstracting authentication and authorization
7595 technologies. With a PAM module it is possible to specify different
7596 authentication methods for dierent system applications without
7597 having to recompile these applications. PAM is also useful
7598 for implementing a particular policy for authorization. For example,
7599 a system administrator may only allow console logins from users
7600 stored in the local password file but only allow users resolved from
7601 a NIS database to log in over the network.
</P
7603 >Winbind uses the authentication management and password
7604 management PAM interface to integrate Windows NT users into a
7605 UNIX system. This allows Windows NT users to log in to a UNIX
7606 machine and be authenticated against a suitable Primary Domain
7607 Controller. These users can also change their passwords and have
7608 this change take eect directly on the Primary Domain Controller.
7611 >PAM is congured by providing control files in the directory
7615 > for each of the services that
7616 require authentication. When an authentication request is made
7617 by an application the PAM code in the C library looks up this
7618 control file to determine what modules to load to do the
7619 authentication check and in what order. This interface makes adding
7620 a new authentication service for Winbind very easy, all that needs
7621 to be done is that the
<TT
7629 control files for relevant services are updated to allow
7630 authentication via winbind. See the PAM documentation
7631 for more details.
</P
7639 >8.4.4. User and Group ID Allocation
</A
7642 >When a user or group is created under Windows NT
7643 is it allocated a numerical relative identier (RID). This is
7644 slightly dierent to UNIX which has a range of numbers which are
7645 used to identify users, and the same range in which to identify
7646 groups. It is winbind's job to convert RIDs to UNIX id numbers and
7647 vice versa. When winbind is congured it is given part of the UNIX
7648 user id space and a part of the UNIX group id space in which to
7649 store Windows NT users and groups. If a Windows NT user is
7650 resolved for the first time, it is allocated the next UNIX id from
7651 the range. The same process applies for Windows NT groups. Over
7652 time, winbind will have mapped all Windows NT users and groups
7653 to UNIX user ids and group ids.
</P
7655 >The results of this mapping are stored persistently in
7656 a ID mapping database held in a tdb database). This ensures that
7657 RIDs are mapped to UNIX IDs in a consistent way.
</P
7665 >8.4.5. Result Caching
</A
7668 >An active system can generate a lot of user and group
7669 name lookups. To reduce the network cost of these lookups winbind
7670 uses a caching scheme based on the SAM sequence number supplied
7671 by NT domain controllers. User or group information returned
7672 by a PDC is cached by winbind along with a sequence number also
7673 returned by the PDC. This sequence number is incremented by
7674 Windows NT whenever any user or group information is modied. If
7675 a cached entry has expired, the sequence number is requested from
7676 the PDC and compared against the sequence number of the cached entry.
7677 If the sequence numbers do not match, then the cached information
7678 is discarded and up to date information is requested directly
7688 >8.5. Installation and Configuration
</A
7691 >The easiest way to install winbind is by using the packages
7694 >pub/samba/appliance/
</TT
7696 directory on your nearest
7697 Samba mirror. These packages provide snapshots of the Samba source
7698 code and binaries already setup to provide the full functionality
7699 of winbind. This setup is a little more complex than a normal Samba
7700 build as winbind needs a small amount of functionality from a
7701 development code branch called SAMBA_TNG.
</P
7703 >Once you have installed the packages you should read
7707 > man page which will provide you
7708 with conguration information and give you sample conguration files.
7709 You may also wish to update the main Samba daemons smbd and nmbd)
7710 with a more recent development release, such as the recently
7711 announced Samba
2.2 alpha release.
</P
7719 >8.6. Limitations
</A
7722 >Winbind has a number of limitations in its current
7723 released version which we hope to overcome in future
7730 >Winbind is currently only available for
7731 the Linux operating system, although ports to other operating
7732 systems are certainly possible. For such ports to be feasible,
7733 we require the C library of the target operating system to
7734 support the Name Service Switch and Pluggable Authentication
7735 Modules systems. This is becoming more common as NSS and
7736 PAM gain support among UNIX vendors.
</P
7740 >The mappings of Windows NT RIDs to UNIX ids
7741 is not made algorithmically and depends on the order in which
7742 unmapped users or groups are seen by winbind. It may be difficult
7743 to recover the mappings of rid to UNIX id mapping if the file
7744 containing this information is corrupted or destroyed.
</P
7748 >Currently the winbind PAM module does not take
7749 into account possible workstation and logon time restrictions
7750 that may be been set for Windows NT users.
</P
7754 >Building winbind from source is currently
7755 quite tedious as it requires combining source code from two Samba
7756 branches. Work is underway to solve this by providing all
7757 the necessary functionality in the main Samba code branch.
</P
7770 >The winbind system, through the use of the Name Service
7771 Switch, Pluggable Authentication Modules, and appropriate
7772 Microsoft RPC calls have allowed us to provide seamless
7773 integration of Microsoft Windows NT domain users on a
7774 UNIX system. The result is a great reduction in the administrative
7775 cost of running a mixed UNIX and NT network.
</P
7783 >Chapter
9. UNIX Permission Bits and WIndows NT Access Control Lists
</A
7791 >9.1. Viewing and changing UNIX permissions using the NT
7795 >New in the Samba
2.0.4 release is the ability for Windows
7796 NT clients to use their native security settings dialog box to
7797 view and modify the underlying UNIX permissions.
</P
7799 >Note that this ability is careful not to compromise
7800 the security of the UNIX host Samba is running on, and
7801 still obeys all the file permission rules that a Samba
7802 administrator can set.
</P
7804 >In Samba
2.0.4 and above the default value of the
7806 HREF=
"smb.conf.5.html#NTACLSUPPORT"
7814 > has been changed from
7822 manipulation of permissions is turned on by default.
</P
7830 >9.2. How to view file security on a Samba share
</A
7833 >From an NT
4.0 client, single-click with the right
7834 mouse button on any file or directory in a Samba mounted
7835 drive letter or UNC path. When the menu pops-up, click
7838 > entry at the bottom of
7839 the menu. This brings up the normal file properties dialog
7840 box, but with Samba
2.0.4 this will have a new tab along the top
7843 >. Click on this tab and you
7844 will see three buttons,
<EM
7854 > button will cause either
7855 an error message
<SPAN
7857 >A requested privilege is not held
7859 > to appear if the user is not the
7860 NT Administrator, or a dialog which is intended to allow an
7861 Administrator to add auditing requirements to a file if the
7862 user is logged on as the NT Administrator. This dialog is
7863 non-functional with a Samba share at this time, as the only
7864 useful button, the
<B
7867 > button will not currently
7868 allow a list of users to be seen.
</P
7876 >9.3. Viewing file ownership
</A
7883 brings up a dialog box telling you who owns the given file. The
7884 owner name will be of the form :
</P
7888 >"SERVER\user (Long name)"</B
7896 > is the NetBIOS name of
7897 the Samba server,
<TT
7902 > is the user name of
7903 the UNIX user who owns the file, and
<TT
7909 is the discriptive string identifying the user (normally found in the
7910 GECOS field of the UNIX password database). Click on the
<B
7914 > button to remove this dialog.
</P
7916 >If the parameter
<TT
7925 > then the file owner will
7926 be shown as the NT user
<B
7934 > button will not allow
7935 you to change the ownership of this file to yourself (clicking on
7936 it will display a dialog box complaining that the user you are
7937 currently logged onto the NT client cannot be found). The reason
7938 for this is that changing the ownership of a file is a privilaged
7939 operation in UNIX, available only to the
<EM
7942 user. As clicking on this button causes NT to attempt to change
7943 the ownership of a file to the current user logged into the NT
7944 client this will not work with Samba at this time.
</P
7946 >There is an NT chown command that will work with Samba
7947 and allow a user with Administrator privillage connected
7948 to a Samba
2.0.4 server as root to change the ownership of
7949 files on both a local NTFS filesystem or remote mounted NTFS
7950 or Samba drive. This is available as part of the
<EM
7953 > NT security library written by Jeremy Allison of
7954 the Samba Team, available from the main Samba ftp site.
</P
7962 >9.4. Viewing file or directory permissions
</A
7965 >The third button is the
<B
7969 button. Clicking on this brings up a dialog box that shows both
7970 the permissions and the UNIX owner of the file or directory.
7971 The owner is displayed in the form :
</P
7975 >"SERVER\user (Long name)"</B
7983 > is the NetBIOS name of
7984 the Samba server,
<TT
7989 > is the user name of
7990 the UNIX user who owns the file, and
<TT
7996 is the discriptive string identifying the user (normally found in the
7997 GECOS field of the UNIX password database).
</P
7999 >If the parameter
<TT
8008 > then the file owner will
8009 be shown as the NT user
<B
8013 permissions will be shown as NT
"Full Control".
</P
8015 >The permissions field is displayed differently for files
8016 and directories, so I'll describe the way file permissions
8017 are displayed first.
</P
8024 >9.4.1. File Permissions
</A
8027 >The standard UNIX user/group/world triple and
8028 the correspinding
"read",
"write",
"execute" permissions
8029 triples are mapped by Samba into a three element NT ACL
8030 with the 'r', 'w', and 'x' bits mapped into the corresponding
8031 NT permissions. The UNIX world permissions are mapped into
8032 the global NT group
<B
8036 by the list of permissions allowed for UNIX world. The UNIX
8037 owner and group permissions are displayed as an NT
8045 > icon respectively followed by the list
8046 of permissions allowed for the UNIX user and group.
</P
8048 >As many UNIX permission sets don't map into common
8059 usually the permissions will be prefixed by the words
<B
8061 > "Special Access"</B
8062 > in the NT display list.
</P
8064 >But what happens if the file has no permissions allowed
8065 for a particular UNIX user group or world component ? In order
8066 to allow
"no permissions" to be seen and modified then Samba
8069 >"Take Ownership"</B
8071 (which has no meaning in UNIX) and reports a component with
8072 no permissions as having the NT
<B
8076 This was chosen of course to make it look like a zero, meaning
8077 zero permissions. More details on the decision behind this will
8086 >9.4.2. Directory Permissions
</A
8089 >Directories on an NT NTFS file system have two
8090 different sets of permissions. The first set of permissions
8091 is the ACL set on the directory itself, this is usually displayed
8092 in the first set of parentheses in the normal
<B
8096 NT style. This first set of permissions is created by Samba in
8097 exactly the same way as normal file permissions are, described
8098 above, and is displayed in the same way.
</P
8100 >The second set of directory permissions has no real meaning
8101 in the UNIX permissions world and represents the
<B
8104 > permissions that any file created within
8105 this directory would inherit.
</P
8107 >Samba synthesises these inherited permissions for NT by
8108 returning as an NT ACL the UNIX permission mode that a new file
8109 created by Samba on this share would receive.
</P
8118 >9.5. Modifying file or directory permissions
</A
8121 >Modifying file and directory permissions is as simple
8122 as changing the displayed permissions in the dialog box, and
8126 > button. However, there are
8127 limitations that a user needs to be aware of, and also interactions
8128 with the standard Samba permission masks and mapping of DOS
8129 attributes that need to also be taken into account.
</P
8131 >If the parameter
<TT
8140 > then any attempt to set
8141 security permissions will fail with an
<B
8147 >The first thing to note is that the
<B
8151 button will not return a list of users in Samba
2.0.4 (it will give
8152 an error message of
<B
8154 >"The remote proceedure call failed
8155 and did not execute"</B
8156 >). This means that you can only
8157 manipulate the current user/group/world permissions listed in
8158 the dialog box. This actually works quite well as these are the
8159 only permissions that UNIX actually has.
</P
8161 >If a permission triple (either user, group, or world)
8162 is removed from the list of permissions in the NT dialog box,
8166 > button is pressed it will
8167 be applied as
"no permissions" on the UNIX side. If you then
8168 view the permissions again the
"no permissions" entry will appear
8172 > flag, as described above. This
8173 allows you to add permissions back to a file or directory once
8174 you have removed them from a triple component.
</P
8176 >As UNIX supports only the
"r",
"w" and
"x" bits of
8177 an NT ACL then if other NT security attributes such as
"Delete
8178 access" are selected then they will be ignored when applied on
8179 the Samba server.
</P
8181 >When setting permissions on a directory the second
8182 set of permissions (in the second set of parentheses) is
8183 by default applied to all files within that directory. If this
8184 is not what you want you must uncheck the
<B
8187 permissions on existing files"</B
8188 > checkbox in the NT
8189 dialog before clicking
<B
8194 >If you wish to remove all permissions from a
8195 user/group/world component then you may either highlight the
8196 component and click the
<B
8200 or set the component to only have the special
<B
8204 > permission (dsplayed as
<B
8216 >9.6. Interaction with the standard Samba create mask
8220 >Note that with Samba
2.0.5 there are four new parameters
8221 to control this interaction. These are :
</P
8233 >force security mode
</I
8240 >directory security mask
</I
8247 >force directory security mode
</I
8251 >Once a user clicks
<B
8255 permissions Samba maps the given permissions into a user/group/world
8256 r/w/x triple set, and then will check the changed permissions for a
8257 file against the bits set in the
<A
8258 HREF=
"smb.conf.5.html#SECURITYMASK"
8267 > parameter. Any bits that
8268 were changed that are not set to '
1' in this parameter are left alone
8269 in the file permissions.
</P
8271 >Essentially, zero bits in the
<TT
8277 mask may be treated as a set of bits the user is
<EM
8280 allowed to change, and one bits are those the user is allowed to change.
8283 >If not set explicitly this parameter is set to the same value as
8285 HREF=
"smb.conf.5.html#CREATEMASK"
8294 > parameter to provide compatibility with Samba
2.0.4
8295 where this permission change facility was introduced. To allow a user to
8296 modify all the user/group/world permissions on a file, set this parameter
8299 >Next Samba checks the changed permissions for a file against
8300 the bits set in the
<A
8301 HREF=
"smb.conf.5.html#FORCESECURITYMODE"
8306 >force security mode
</I
8309 > parameter. Any bits
8310 that were changed that correspond to bits set to '
1' in this parameter
8311 are forced to be set.
</P
8313 >Essentially, bits set in the
<TT
8316 >force security mode
8319 > parameter may be treated as a set of bits that, when
8320 modifying security on a file, the user has always set to be 'on'.
</P
8322 >If not set explicitly this parameter is set to the same value
8324 HREF=
"smb.conf.5.html#FORCECREATEMODE"
8333 > parameter to provide compatibility
8334 with Samba
2.0.4 where the permission change facility was introduced.
8335 To allow a user to modify all the user/group/world permissions on a file,
8336 with no restrictions set this parameter to
000.
</P
8349 > parameters are applied to the change
8350 request in that order.
</P
8352 >For a directory Samba will perform the same operations as
8353 described above for a file except using the parameter
<TT
8356 > directory security mask
</I
8367 >force directory security mode
8370 > parameter instead of
<TT
8373 >force security mode
8381 >directory security mask
</I
8384 by default is set to the same value as the
<TT
8390 > parameter and the
<TT
8393 >force directory security
8396 > parameter by default is set to the same value as
8400 >force directory mode
</I
8402 > parameter to provide
8403 compatibility with Samba
2.0.4 where the permission change facility
8406 >In this way Samba enforces the permission restrictions that
8407 an administrator can set on a Samba share, whilst still allowing users
8408 to modify the permission bits within that restriction.
</P
8410 >If you want to set up a share that allows users full control
8411 in modifying the permission bits on their files and directories and
8412 doesn't force any particular bits to be set 'on', then set the following
8413 parameters in the
<A
8414 HREF=
"smb.conf.5.html"
8421 > file in that share specific section :
</P
8426 >security mask =
0777</I
8433 >force security mode =
0</I
8440 >directory security mask =
0777</I
8447 >force directory security mode =
0</I
8451 >As described, in Samba
2.0.4 the parameters :
</P
8463 >force create mode
</I
8477 >force directory mode
</I
8481 >were used instead of the parameters discussed here.
</P
8489 >9.7. Interaction with the standard Samba file attribute
8493 >Samba maps some of the DOS attribute bits (such as
"read
8494 only") into the UNIX permissions of a file. This means there can
8495 be a conflict between the permission bits set via the security
8496 dialog and the permission bits set by the file attribute mapping.
8499 >One way this can show up is if a file has no UNIX read access
8500 for the owner it will show up as
"read only" in the standard
8501 file attributes tabbed dialog. Unfortunately this dialog is
8502 the same one that contains the security info in another tab.
</P
8504 >What this can mean is that if the owner changes the permissions
8505 to allow themselves read access using the security dialog, clicks
8509 > to get back to the standard attributes tab
8510 dialog, and then clicks
<B
8513 > on that dialog, then
8514 NT will set the file permissions back to read-only (as that is what
8515 the attributes still say in the dialog). This means that after setting
8516 permissions and clicking
<B
8519 > to get back to the
8520 attributes dialog you should always hit
<B
8527 > to ensure that your changes
8528 are not overridden.
</P
8536 >Chapter
10. OS2 Client HOWTO
</A
8552 >10.1.1. How can I configure OS/
2 Warp Connect or
8553 OS/
2 Warp
4 as a client for Samba?
</A
8556 >A more complete answer to this question can be
8558 HREF=
"http://carol.wins.uva.nl/~leeuw/samba/warp.html"
8560 > http://carol.wins.uva.nl/~leeuw/samba/warp.html
</A
8563 >Basically, you need three components:
</P
8569 >The File and Print Client ('IBM Peer')
8574 >TCP/IP ('Internet support')
8579 >The
"NetBIOS over TCP/IP" driver ('TCPBEUI')
8584 >Installing the first two together with the base operating
8585 system on a blank system is explained in the Warp manual. If Warp
8586 has already been installed, but you now want to install the
8587 networking support, use the
"Selective Install for Networking"
8588 object in the
"System Setup" folder.
</P
8590 >Adding the
"NetBIOS over TCP/IP" driver is not described
8591 in the manual and just barely in the online documentation. Start
8592 MPTS.EXE, click on OK, click on
"Configure LAPS" and click
8593 on
"IBM OS/2 NETBIOS OVER TCP/IP" in 'Protocols'. This line
8594 is then moved to 'Current Configuration'. Select that line,
8595 click on
"Change number" and increase it from
0 to
1. Save this
8598 >If the Samba server(s) is not on your local subnet, you
8599 can optionally add IP names and addresses of these servers
8600 to the
"Names List", or specify a WINS server ('NetBIOS
8601 Nameserver' in IBM and RFC terminology). For Warp Connect you
8602 may need to download an update for 'IBM Peer' to bring it on
8603 the same level as Warp
4. See the webpage mentioned above.
</P
8611 >10.1.2. How can I configure OS/
2 Warp
3 (not Connect),
8612 OS/
2 1.2,
1.3 or
2.x for Samba?
</A
8615 >You can use the free Microsoft LAN Manager
2.2c Client
8618 HREF=
"ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/"
8620 > ftp://ftp.microsoft.com/BusSys/Clients/LANMAN.OS2/
</A
8623 HREF=
"http://carol.wins.uva.nl/~leeuw/lanman.html"
8625 > http://carol.wins.uva.nl/~leeuw/lanman.html
</A
8627 more information on how to install and use this client. In
8628 a nutshell, edit the file \OS2VER in the root directory of
8629 the OS/
2 boot partition and add the lines:
</P
8638 CLASS=
"PROGRAMLISTING"
8648 >before you install the client. Also, don't use the
8649 included NE2000 driver because it is buggy. Try the NE2000
8650 or NS2000 driver from
8652 HREF=
"ftp://ftp.cdrom.com/pub/os2/network/ndis/"
8654 > ftp://ftp.cdrom.com/pub/os2/network/ndis/
</A
8664 >10.1.3. Are there any other issues when OS/
2 (any version)
8665 is used as a client?
</A
8668 >When you do a NET VIEW or use the
"File and Print
8669 Client Resource Browser", no Samba servers show up. This can
8670 be fixed by a patch from
<A
8671 HREF=
"http://carol.wins.uva.nl/~leeuw/samba/fix.html"
8673 > http://carol.wins.uva.nl/~leeuw/samba/fix.html
</A
8675 The patch will be included in a later version of Samba. It also
8676 fixes a couple of other problems, such as preserving long
8677 filenames when objects are dragged from the Workplace Shell
8678 to the Samba server.
</P
8686 >10.1.4. How do I get printer driver download working
8687 for OS/
2 clients?
</A
8690 >First, create a share called [PRINTDRV] that is
8691 world-readable. Copy your OS/
2 driver files there. Note
8692 that the .EA_ files must still be separate, so you will need
8693 to use the original install files, and not copy an installed
8694 driver from an OS/
2 system.
</P
8696 >Install the NT driver first for that printer. Then,
8697 add to your smb.conf a paramater,
"os2 driver map =
8703 >". Then, in the file
8710 name of the NT driver name to the OS/
2 driver name as
8713 ><nt driver name
> =
<os2 driver
8714 name
>.
<device name
>, e.g.:
8715 HP LaserJet
5L = LASERJET.HP LaserJet
5L</P
8717 >You can have multiple drivers mapped in this file.
</P
8719 >If you only specify the OS/
2 driver name, and not the
8720 device name, the first attempt to download the driver will
8721 actually download the files, but the OS/
2 client will tell
8722 you the driver is not available. On the second attempt, it
8723 will work. This is fixed simply by adding the device name
8724 to the mapping, after which it will work on the first attempt.
8734 >Chapter
11. HOWTO Access Samba source code via CVS
</A
8742 >11.1. Introduction
</A
8745 >Samba is developed in an open environnment. Developers use CVS
8746 (Concurrent Versioning System) to
"checkin" (also known as
8747 "commit") new source code. Samba's various CVS branches can
8748 be accessed via anonymouns CVS using the instructions
8749 detailed in this chapter.
</P
8751 >This document is a modified version of the instructions found at
8753 HREF=
"http://samba.org/samba/cvs.html"
8755 >http://samba.org/samba/cvs.html
</A
8764 >11.2. CVS Access to samba.org
</A
8767 >The machine samba.org runs a publicly accessible CVS
8768 repository for access to the source code of several packages,
8769 including samba, rsync and jitterbug. There are two main ways of
8770 accessing the CVS server on this host.
</P
8777 >11.2.1. Access via CVSweb
</A
8780 >You can access the source code via your
8781 favourite WWW browser. This allows you to access the contents of
8782 individual files in the repository and also to look at the revision
8783 history and commit logs of individual files. You can also ask for a diff
8784 listing between any two versions on the repository.
</P
8787 HREF=
"http://samba.org/cgi-bin/cvsweb"
8789 >http://samba.org/cgi-bin/cvsweb
</A
8798 >11.2.2. Access via cvs
</A
8801 >You can also access the source code via a
8802 normal cvs client. This gives you much more control over you can
8803 do with the repository and allows you to checkout whole source trees
8804 and keep them uptodate via normal cvs commands. This is the
8805 preferred method of access if you are a developer and not
8806 just a casual browser.
</P
8808 >To download the latest cvs source code, point your
8809 browser at the URL :
<A
8810 HREF=
"http://www.cyclic.com/"
8812 >http://www.cyclic.com/
</A
8814 and click on the 'How to get cvs' link. CVS is free software under
8815 the GNU GPL (as is Samba). Note that there are several graphical CVS clients
8816 which provide a graphical interface to the sometimes mundane CVS commands.
8817 Links to theses clients are also available from http://www.cyclic.com.
</P
8819 >To gain access via anonymous cvs use the following steps.
8820 For this example it is assumed that you want a copy of the
8821 samba source code. For the other source code repositories
8822 on this system just substitute the correct package name
</P
8829 > Install a recent copy of cvs. All you really need is a
8830 copy of the cvs client binary.
8840 >cvs -d :pserver:cvs@samba.org:/cvsroot login
</B
8844 > When it asks you for a password type
<TT
8859 >cvs -d :pserver:cvs@samba.org:/cvsroot co samba
</B
8863 > This will create a directory called samba containing the
8864 latest samba source code (i.e. the HEAD tagged cvs branch). This
8865 currently corresponds to the
3.0 development tree.
8868 > CVS branches other HEAD can be obtained by using the
<TT
8874 and defining a tag name. A list of branch tag names can be found on the
8875 "Development" page of the samba web site. A common request is to obtain the
8876 latest
2.2 release code. This could be done by using the following command.
8881 >cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_2_2 samba
</B
8887 > Whenever you want to merge in the latest code changes use
8888 the following command from within the samba directory:
8893 >cvs update -d -P
</B