From ff78c3bf5c3a73cf90f6517d9b2d6b8c12d22d68 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 18 Feb 2003 22:14:04 +0000 Subject: Regenerate (This used to be commit 1ab5a3b17feb677425bb1071357c3dbabcc46c7e) --- docs/htmldocs/Samba-HOWTO-Collection.html | 8652 +++++++++++++++-------------- 1 file changed, 4520 insertions(+), 4132 deletions(-) (limited to 'docs/htmldocs/Samba-HOWTO-Collection.html') diff --git a/docs/htmldocs/Samba-HOWTO-Collection.html b/docs/htmldocs/Samba-HOWTO-Collection.html index 2bb324d9f3..d758fbbe11 100644 --- a/docs/htmldocs/Samba-HOWTO-Collection.html +++ b/docs/htmldocs/Samba-HOWTO-Collection.html @@ -5,7 +5,7 @@ >SAMBA Project DocumentationLast Update : Thu Aug 15 12:48:45 CDT 2002

: Wed Jan 15

This book is a collection of HOWTOs added to Samba documentation over the years. I try to ensure that all are current, but sometimes the is a larger job @@ -59,6 +59,11 @@ on the "Documentation" page. Please send updates to jerry@samba.org or +jelmer@samba.org.

This documentation is distributed under the GNU General Public License (GPL) @@ -79,7 +84,7 @@ CLASS="TOC" >

I. General installation
1.1. Read the man pages
1.2. Building the Binaries
1.3. The all important step
1.4. Create the smb configuration file.
1.5. Test your config file with
1.6. Starting the smbd and nmbd
1.7. Try listing the shares available on your server
1.8. Try connecting with the unix client
1.9. Try connecting from a DOS, WfWg, Win9x, WinNT, Win2k, OS/2, etc... client
1.10. What If Things Don't Work?
2. Improved browsing in sambaQuick Cross Subnet Browsing / Cross Workgroup Browsing guide
2.1. Overview of browsingDiscussion
2.2. Browsing support in sambaUse of the "Remote Announce" parameter
2.3. Problem resolutionUse of the "Remote Browse Sync" parameter
2.4. Browsing across subnetsUse of WINS
2.5. Setting up a WINS serverDo NOT use more than one (1) protocol on MS Windows machines
2.6. Setting up Browsing in a WORKGROUP
2.7. Setting up Browsing in a DOMAIN
2.8. Forcing samba to be the master
2.9. Making samba the domain master
2.10. Note about broadcast addresses
2.11. Multiple interfacesName Resolution Order
3. OplocksUser information database
3.1. What are oplocks?
4. Quick Cross Subnet Browsing / Cross Workgroup Browsing guide
4.1. Discussion
4.2. Use of the "Remote Announce" parameter
4.3. Use of the "Remote Browse Sync" parameterIntroduction
4.4. Use of WINS3.2. Important Notes About Security
4.5. Do NOT use more than one (1) protocol on MS Windows machines3.3. The smbpasswd Command
4.6. Name Resolution Order3.4. Plain text
5. LanMan and NT Password Encryption in Samba3.5. TDB
5.1. Introduction3.6. LDAP
5.2. Important Notes About Security3.7. MySQL
5.3. The smbpasswd Command3.8. Passdb XML plugin
II. Type of installation
6. 4. User and Share security level (for servers not in a domain)
5. How to Configure Samba as a NT4 Primary Domain ControllerSamba as a NT4 or Win2k Primary Domain Controller
6.1. 5.1. Prerequisite Reading
6.2. 5.2. Background
6.3. 5.3. Configuring the Samba Domain Controller
6.4. 5.4. Creating Machine Trust Accounts and Joining Clients to the Domain
6.5. 5.5. Common Problems and Errors
6.6. 5.6. System Policies and Profiles
6.7. 5.7. What other help can I get?
6.8. 5.8. Domain Control for Windows 9x/ME
6.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba5.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba
7. 6. How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain
7.1. 6.1. Prerequisite Reading
7.2. 6.2. Background
7.3. 6.3. What qualifies a Domain Controller on the network?
7.4. Can Samba be a Backup Domain Controller?6.4. Can Samba be a Backup Domain Controller to an NT PDC?
7.5. 6.5. How do I set up a Samba BDC?
8. 7. Samba as a ADS domain member
8.1. 7.1. Installing the required packages for Debian
8.2. 7.2. Installing the required packages for RedHat
8.3. 7.3. Compile Samba
8.4. 7.4. Setup your /etc/krb5.conf
8.5. 7.5. Create the computer account
8.6. 7.6. Test your server setup
8.7. 7.7. Testing with smbclient
8.8. 7.8. Notes
9. 8. Samba as a NT4 domain memberSamba as a NT4 or Win2k domain member
9.1. Joining an NT Domain with Samba 2.28.1. Joining an NT Domain with Samba 3.0
9.2. 8.2. Samba and Windows 2000 Domains
9.3. 8.3. Why is this better than security = server?
III. Optional configuration
10. 9. Integrating MS Windows networks with Samba
10.1. 9.1. Agenda
10.2. 9.2. Name Resolution in a pure Unix/Linux world
10.3. 9.3. Name resolution as used within MS Windows networking
10.4. 9.4. How browsing functions and how to deploy stable and dependable browsing using Samba
10.5. 9.5. MS Windows security options and how to configure Samba for seemless integration
10.6. 9.6. Conclusions
11. 10. UNIX Permission Bits and Windows NT Access Control Lists
11.1. 10.1. Viewing and changing UNIX permissions using the NT security dialogs
11.2. 10.2. How to view file security on a Samba share
11.3. 10.3. Viewing file ownership
11.4. 10.4. Viewing file or directory permissions
11.5. 10.5. Modifying file or directory permissions
11.6. 10.6. Interaction with the standard Samba create mask parameters
11.7. 10.7. Interaction with the standard Samba file attribute mapping
12. 11. Configuring PAM for distributed but centrally managed authentication
12.1. 11.1. Samba and PAM
12.2. 11.2. Distributed Authentication
12.3. 11.3. PAM Configuration in smb.conf
13. 12. Hosting a Microsoft Distributed File System tree on Samba
13.1. 12.1. Instructions
14. 13. Printing Support
14.1. 13.1. Introduction
14.2. 13.2. Configuration
14.3. 13.3. The Imprints Toolset
14.4. 13.4. Diagnosis
15. Security levels
15.1. Introduction
15.2. More complete description of security levels
16. 14. Unified Logons between Windows NT and UNIX using Winbind
16.1. 14.1. Abstract
16.2. 14.2. Introduction
16.3. 14.3. What Winbind Provides
16.4. 14.4. How Winbind Works
16.5. 14.5. Installation and Configuration
16.6. 14.6. Limitations
16.7. 14.7. Conclusion
17. Passdb MySQL plugin15. Improved browsing in samba
17.1. Building
17.2. Configuring
17.3. Using plaintext passwords or encrypted password
17.4. Getting non-column data from the table15.1. Overview of browsing
18. Passdb XML plugin15.2. Browsing support in samba
18.1. Building15.3. Problem resolution
18.2. Usage15.4. Browsing across subnets
19. Storing Samba's User/Machine Account information in an LDAP Directory15.5. Setting up a WINS server
19.1. Purpose15.6. Setting up Browsing in a WORKGROUP
19.2. Introduction15.7. Setting up Browsing in a DOMAIN
19.3. Supported LDAP Servers15.8. Forcing samba to be the master
19.4. Schema and Relationship to the RFC 2307 posixAccount15.9. Making samba the domain master
19.5. Configuring Samba with LDAP15.10. Note about broadcast addresses
19.6. Accounts and Groups management15.11. Multiple interfaces
19.7. Security and sambaAccount16. Stackable VFS modules
19.8. LDAP specials attributes for sambaAccounts16.1. Introduction and configuration
19.9. Example LDIF Entries for a sambaAccount16.2. Included modules
19.10. Comments16.3. VFS modules available elsewhere
20. 17. HOWTO Access Samba source code via CVSAccess Samba source code via CVS
20.1. 17.1. Introduction
20.2. 17.2. CVS Access to samba.org
21. 18. Group mapping HOWTO
22. 19. Samba performance issues
22.1. 19.1. Comparisons
22.2. Oplocks
22.3. 19.2. Socket options
22.4. 19.3. Read size
22.5. 19.4. Max xmit
22.6. Locking
22.7. Share modes
22.8. 19.5. Log level
22.9. Wide lines
22.10. 19.6. Read raw
22.11. 19.7. Write raw
22.12. Read prediction19.8. Slow Clients
22.13. Memory mapping19.9. Slow Logins
22.14. Slow Clients19.10. Client tuning
22.15. Slow Logins20. Creating Group Profiles
22.16. Client tuning20.1. Windows '9x
20.2. Windows NT 4
22.17. My Results20.3. Windows 2000/XP
IV. Appendixes
23. 21. Portability
23.1. 21.1. HPUX
23.2. 21.2. SCO Unix
23.3. 21.3. DNIX
23.4. 21.4. RedHat Linux Rembrandt-II
24. 22. Samba and other CIFS clients
24.1. 22.1. Macintosh clients?
24.2. 22.2. OS2 Client
24.3. 22.3. Windows for Workgroups
24.4. 22.4. Windows '95/'98
24.5. 22.5. Windows 2000 Service Pack 2
25. 23. Reporting Bugs
25.1. 23.1. Introduction
25.2. 23.2. General info
25.3. 23.3. Debug levels
25.4. 23.4. Internal errors
25.5. 23.5. Attaching to a running process
25.6. 23.6. Patches
26. 24. Diagnosing your samba server
26.1. 24.1. Introduction
26.2. 24.2. Assumptions
26.3. 24.3. Tests
26.4. 24.4. Still having troubles?

Introduction

1.1. Read the man pages
1.2. Building the Binaries
1.3. The all important step
1.4. Create the smb configuration file.
1.5. Test your config file with
1.6. Starting the smbd and nmbd
1.6.1. Starting from inetd.conf
1.6.2. Alternative: starting it as a daemon
1.7. Try listing the shares available on your server
1.8. Try connecting with the unix client
1.9. Try connecting from a DOS, WfWg, Win9x, WinNT, Win2k, OS/2, etc... client
1.10. What If Things Don't Work?
1.10.1. Diagnosing Problems
1.10.2. Scope IDs
1.10.3. Choosing the Protocol Level
1.10.4. Printing from UNIX to a Client PC
1.10.5. Locking
1.10.6. Mapping Usernames
2. Improved browsing in sambaQuick Cross Subnet Browsing / Cross Workgroup Browsing guide
2.1. Overview of browsingDiscussion
2.2. Browsing support in sambaUse of the "Remote Announce" parameter
2.3. Problem resolutionUse of the "Remote Browse Sync" parameter
2.4. Browsing across subnets
2.4.1. How does cross subnet browsing work ?Use of WINS
2.5. Setting up a WINS serverDo NOT use more than one (1) protocol on MS Windows machines
2.6. Setting up Browsing in a WORKGROUPName Resolution Order
2.7. Setting up Browsing in a DOMAIN3. User information database
2.8. Forcing samba to be the master3.1. Introduction
2.9. Making samba the domain master3.2. Important Notes About Security
2.10. Note about broadcast addresses3.2.1. Advantages of SMB Encryption
2.11. Multiple interfaces3.2.2. Advantages of non-encrypted passwords
3. Oplocks3.3. The smbpasswd Command
3.1. What are oplocks?3.4. Plain text
4. Quick Cross Subnet Browsing / Cross Workgroup Browsing guide3.5. TDB
3.6. LDAP
4.1. Discussion3.6.1. Introduction
4.2. Use of the "Remote Announce" parameter3.6.2. Introduction
4.3. Use of the "Remote Browse Sync" parameter3.6.3. Supported LDAP Servers
4.4. Use of WINS3.6.4. Schema and Relationship to the RFC 2307 posixAccount
4.5. Do NOT use more than one (1) protocol on MS Windows machines3.6.5. Configuring Samba with LDAP
4.6. Name Resolution Order3.6.6. Accounts and Groups management
3.6.7. Security and sambaAccount
3.6.8. LDAP specials attributes for sambaAccounts
3.6.9. Example LDIF Entries for a sambaAccount
5. LanMan and NT Password Encryption in Samba3.7. MySQL
5.1. Introduction3.7.1. Building
5.2. Important Notes About Security3.7.2. Creating the database
5.2.1. Advantages of SMB Encryption3.7.3. Configuring
5.2.2. Advantages of non-encrypted passwords3.7.4. Using plaintext passwords or encrypted password
3.7.5. Getting non-column data from the table
5.3. The smbpasswd Command3.8. Passdb XML plugin
3.8.1. Building
3.8.2. Usage

1.1. Read the man pages


1.2. Building the Binaries


1.3. The all important step


1.4. Create the smb configuration file.


1.5. Test your config file with

1.6. Starting the smbd and nmbd


1.6.1. Starting from inetd.conf


1.6.2. Alternative: starting it as a daemon


1.7. Try listing the shares available on your server


1.8. Try connecting with the unix client


1.9. Try connecting from a DOS, WfWg, Win9x, WinNT, Win2k, OS/2, etc... client


1.10. What If Things Don't Work?


1.10.1. Diagnosing Problems


1.10.2. Scope IDs


1.10.3. Choosing the Protocol Level


1.10.4. Printing from UNIX to a Client PC


1.10.5. Locking


1.10.6. Mapping Usernames


Chapter 2. Improved browsing in samba

Chapter 2. Quick Cross Subnet Browsing / Cross Workgroup Browsing guide

This document should be read in conjunction with Browsing and may +be taken as the fast track guide to implementing browsing across subnets +and / or across workgroups (or domains). WINS is the best tool for resolution +of NetBIOS names to IP addesses. WINS is NOT involved in browse list handling +except by way of name to address mapping.


2.1. Overview of browsing

2.1. Discussion

SMB networking provides a mechanism by which clients can access a list -of machines in a network, a so-called "browse list". This list -contains machines that are ready to offer file and/or print services -to other machines within the network. Thus it does not include -machines which aren't currently able to do server tasks. The browse -list is heavily used by all SMB clients. Configuration of SMB -browsing has been problematic for some Samba users, hence this -document.

Firstly, all MS Windows networking is based on SMB (Server Message +Block) based messaging. SMB messaging is implemented using NetBIOS. Samba +implements NetBIOS by encapsulating it over TCP/IP. MS Windows products can +do likewise. NetBIOS based networking uses broadcast messaging to affect +browse list management. When running NetBIOS over TCP/IP this uses UDP +based messaging. UDP messages can be broadcast or unicast.

Browsing will NOT work if name resolution from NetBIOS names to IP -addresses does not function correctly. Use of a WINS server is highly -recommended to aid the resolution of NetBIOS (SMB) names to IP addresses. -WINS allows remote segment clients to obtain NetBIOS name_type information -that can NOT be provided by any other means of name resolution.

Normally, only unicast UDP messaging can be forwarded by routers. The +"remote announce" parameter to smb.conf helps to project browse announcements +to remote network segments via unicast UDP. Similarly, the "remote browse sync" +parameter of smb.conf implements browse list collation using unicast UDP.

Secondly, in those networks where Samba is the only SMB server technology +wherever possible nmbd should be configured on one (1) machine as the WINS +server. This makes it easy to manage the browsing environment. If each network +segment is configured with it's own Samba WINS server, then the only way to +get cross segment browsing to work is by using the "remote announce" and +the "remote browse sync" parameters to your smb.conf file.

If only one WINS server is used then the use of the "remote announce" and the +"remote browse sync" parameters should NOT be necessary.

Samba WINS does not support MS-WINS replication. This means that when setting up +Samba as a WINS server there must only be one nmbd configured as a WINS server +on the network. Some sites have used multiple Samba WINS servers for redundancy +(one server per subnet) and then used "remote browse sync" and "remote announce" +to affect browse list collation across all segments. Note that this means +clients will only resolve local names, and must be configured to use DNS to +resolve names on other subnets in order to resolve the IP addresses of the +servers they can see on other subnets. This setup is not recommended, but is +mentioned as a practical consideration (ie: an 'if all else fails' scenario).

Lastly, take note that browse lists are a collection of unreliable broadcast +messages that are repeated at intervals of not more than 15 minutes. This means +that it will take time to establish a browse list and it can take up to 45 +minutes to stabilise, particularly across network segments.


2.2. Browsing support in samba

Samba now fully supports browsing. The browsing is supported by nmbd -and is also controlled by options in the smb.conf file (see smb.conf(5)).

Samba can act as a local browse master for a workgroup and the ability -for samba to support domain logons and scripts is now available. See -DOMAIN.txt for more information on domain logons.

Samba can also act as a domain master browser for a workgroup. This -means that it will collate lists from local browse masters into a -wide area network server list. In order for browse clients to -resolve the names they may find in this list, it is recommended that -both samba and your clients use a WINS server.

Note that you should NOT set Samba to be the domain master for a -workgroup that has the same name as an NT Domain: on each wide area -network, you must only ever have one domain master browser per workgroup, -regardless of whether it is NT, Samba or any other type of domain master -that is providing this service.

2.2. Use of the "Remote Announce" parameter

[Note that nmbd can be configured as a WINS server, but it is not -necessary to specifically use samba as your WINS server. NTAS can -be configured as your WINS server. In a mixed NT server and -samba environment on a Wide Area Network, it is recommended that -you use the NT server's WINS server capabilities. In a samba-only -environment, it is recommended that you use one and only one nmbd -as your WINS server].

The "remote announce" parameter of smb.conf can be used to forcibly ensure +that all the NetBIOS names on a network get announced to a remote network. +The syntax of the "remote announce" parameter is: +
	remote announce = a.b.c.d [e.f.g.h] ...
+_or_ +
	remote announce = a.b.c.d/WORKGROUP [e.f.g.h/WORKGROUP] ...
+ +where: +

a.b.c.d and e.f.g.h

To get browsing to work you need to run nmbd as usual, but will need -to use the "workgroup" option in smb.conf to control what workgroup -Samba becomes a part of.

is either the LMB (Local Master Browser) IP address +or the broadcst address of the remote network. +ie: the LMB is at 192.168.1.10, or the address +could be given as 192.168.1.255 where the netmask +is assumed to be 24 bits (255.255.255.0). +When the remote announcement is made to the broadcast +address of the remote network every host will receive +our announcements. This is noisy and therefore +undesirable but may be necessary if we do NOT know +the IP address of the remote LMB.

WORKGROUP

Samba also has a useful option for a Samba server to offer itself for -browsing on another subnet. It is recommended that this option is only -used for 'unusual' purposes: announcements over the internet, for -example. See "remote announce" in the smb.conf man page.

is optional and can be either our own workgroup +or that of the remote network. If you use the +workgroup name of the remote network then our +NetBIOS machine names will end up looking like +they belong to that workgroup, this may cause +name resolution problems and should be avoided.


2.3. Problem resolution

2.3. Use of the "Remote Browse Sync" parameter

If something doesn't work then hopefully the log.nmb file will help -you track down the problem. Try a debug level of 2 or 3 for finding -problems. Also note that the current browse list usually gets stored -in text form in a file called browse.dat.

The "remote browse sync" parameter of smb.conf is used to announce to +another LMB that it must synchronise it's NetBIOS name list with our +Samba LMB. It works ONLY if the Samba server that has this option is +simultaneously the LMB on it's network segment.

Note that if it doesn't work for you, then you should still be able to -type the server name as \\SERVER in filemanager then hit enter and -filemanager should display the list of available shares.

The syntax of the "remote browse sync" parameter is: + +
remote browse sync = a.b.c.d
+ +where a.b.c.d is either the IP address of the remote LMB or else is the network broadcast address of the remote segment.


2.4. Use of WINS

Some people find browsing fails because they don't have the global -"guest account" set to a valid account. Remember that the IPC$ -connection that lists the shares is done as guest, and thus you must -have a valid guest account.

Use of WINS (either Samba WINS _or_ MS Windows NT Server WINS) is highly +recommended. Every NetBIOS machine registers it's name together with a +name_type value for each of of several types of service it has available. +eg: It registers it's name directly as a unique (the type 0x03) name. +It also registers it's name if it is running the lanmanager compatible +server service (used to make shares and printers available to other users) +by registering the server (the type 0x20) name.

Also, a lot of people are getting bitten by the problem of too many -parameters on the command line of nmbd in inetd.conf. This trick is to -not use spaces between the option and the parameter (eg: -d2 instead -of -d 2), and to not use the -B and -N options. New versions of nmbd -are now far more likely to correctly find your broadcast and network -address, so in most cases these aren't needed.

All NetBIOS names are up to 15 characters in length. The name_type variable +is added to the end of the name - thus creating a 16 character name. Any +name that is shorter than 15 characters is padded with spaces to the 15th +character. ie: All NetBIOS names are 16 characters long (including the +name_type information).

The other big problem people have is that their broadcast address, -netmask or IP address is wrong (specified with the "interfaces" option -in smb.conf)

WINS can store these 16 character names as they get registered. A client +that wants to log onto the network can ask the WINS server for a list +of all names that have registered the NetLogon service name_type. This saves +broadcast traffic and greatly expedites logon processing. Since broadcast +name resolution can not be used across network segments this type of +information can only be provided via WINS _or_ via statically configured +"lmhosts" files that must reside on all clients in the absence of WINS.

WINS also serves the purpose of forcing browse list synchronisation by all +LMB's. LMB's must synchronise their browse list with the DMB (domain master +browser) and WINS helps the LMB to identify it's DMB. By definition this +will work only within a single workgroup. Note that the domain master browser +has NOTHING to do with what is referred to as an MS Windows NT Domain. The +later is a reference to a security environment while the DMB refers to the +master controller for browse list information only.

Use of WINS will work correctly only if EVERY client TCP/IP protocol stack +has been configured to use the WINS server/s. Any client that has not been +configured to use the WINS server will continue to use only broadcast based +name registration so that WINS may NEVER get to know about it. In any case, +machines that have not registered with a WINS server will fail name to address +lookup attempts by other clients and will therefore cause workstation access +errors.

To configure Samba as a WINS server just add "wins support = yes" to the +smb.conf file [globals] section.

To configure Samba to register with a WINS server just add +"wins server = a.b.c.d" to your smb.conf file [globals] section.

DO NOT EVER use both "wins support = yes" together with "wins server = a.b.c.d" +particularly not using it's own IP address.


2.4. Browsing across subnets

2.5. Do NOT use more than one (1) protocol on MS Windows machines

With the release of Samba 1.9.17(alpha1 and above) Samba has been -updated to enable it to support the replication of browse lists -across subnet boundaries. New code and options have been added to -achieve this. This section describes how to set this feature up -in different settings.

A very common cause of browsing problems results from installing more than +one protocol on an MS Windows machine.

To see browse lists that span TCP/IP subnets (ie. networks separated -by routers that don't pass broadcast traffic) you must set up at least -one WINS server. The WINS server acts as a DNS for NetBIOS names, allowing -NetBIOS name to IP address translation to be done by doing a direct -query of the WINS server. This is done via a directed UDP packet on -port 137 to the WINS server machine. The reason for a WINS server is -that by default, all NetBIOS name to IP address translation is done -by broadcasts from the querying machine. This means that machines -on one subnet will not be able to resolve the names of machines on -another subnet without using a WINS server.

Every NetBIOS machine take part in a process of electing the LMB (and DMB) +every 15 minutes. A set of election criteria is used to determine the order +of precidence for winning this election process. A machine running Samba or +Windows NT will be biased so that the most suitable machine will predictably +win and thus retain it's role.

Remember, for browsing across subnets to work correctly, all machines, -be they Windows 95, Windows NT, or Samba servers must have the IP address -of a WINS server given to them by a DHCP server, or by manual configuration -(for Win95 and WinNT, this is in the TCP/IP Properties, under Network -settings) for Samba this is in the smb.conf file.

The election process is "fought out" so to speak over every NetBIOS network +interface. In the case of a Windows 9x machine that has both TCP/IP and IPX +installed and has NetBIOS enabled over both protocols the election will be +decided over both protocols. As often happens, if the Windows 9x machine is +the only one with both protocols then the LMB may be won on the NetBIOS +interface over the IPX protocol. Samba will then lose the LMB role as Windows +9x will insist it knows who the LMB is. Samba will then cease to function +as an LMB and thus browse list operation on all TCP/IP only machines will +fail.

The safest rule of all to follow it this - USE ONLY ONE PROTOCOL!



2.4.1. How does cross subnet browsing work ?

Cross subnet browsing is a complicated dance, containing multiple -moving parts. It has taken Microsoft several years to get the code -that achieves this correct, and Samba lags behind in some areas. -However, with the 1.9.17 release, Samba is capable of cross subnet -browsing when configured correctly.

2.6. Name Resolution Order

Consider a network set up as follows :

Resolution of NetBIOS names to IP addresses can take place using a number +of methods. The only ones that can provide NetBIOS name_type information +are:

                                   (DMB)
-             N1_A      N1_B        N1_C       N1_D        N1_E
-              |          |           |          |           |
-          -------------------------------------------------------
-            |          subnet 1                       |
-          +---+                                      +---+
-          |R1 | Router 1                  Router 2   |R2 |
-          +---+                                      +---+
-            |                                          |
-            |  subnet 2              subnet 3          |
-  --------------------------       ------------------------------------
-  |     |     |      |               |        |         |           |
- N2_A  N2_B  N2_C   N2_D           N3_A     N3_B      N3_C        N3_D 
-                    (WINS)

WINS: the best tool!
LMHOSTS: is static and hard to maintain.
Broadcast: uses UDP and can not resolve names across remote segments.

Consisting of 3 subnets (1, 2, 3) connected by two routers -(R1, R2) - these do not pass broadcasts. Subnet 1 has 5 machines -on it, subnet 2 has 4 machines, subnet 3 has 4 machines. Assume -for the moment that all these machines are configured to be in the -same workgroup (for simplicities sake). Machine N1_C on subnet 1 -is configured as Domain Master Browser (ie. it will collate the -browse lists for the workgroup). Machine N2_D is configured as -WINS server and all the other machines are configured to register -their NetBIOS names with it.

As all these machines are booted up, elections for master browsers -will take place on each of the three subnets. Assume that machine -N1_C wins on subnet 1, N2_B wins on subnet 2, and N3_D wins on -subnet 3 - these machines are known as local master browsers for -their particular subnet. N1_C has an advantage in winning as the -local master browser on subnet 1 as it is set up as Domain Master -Browser.

Alternative means of name resolution includes:

On each of the three networks, machines that are configured to -offer sharing services will broadcast that they are offering -these services. The local master browser on each subnet will -receive these broadcasts and keep a record of the fact that -the machine is offering a service. This list of records is -the basis of the browse list. For this case, assume that -all the machines are configured to offer services so all machines -will be on the browse list.

For each network, the local master browser on that network is -considered 'authoritative' for all the names it receives via -local broadcast. This is because a machine seen by the local -master browser via a local broadcast must be on the same -network as the local master browser and thus is a 'trusted' -and 'verifiable' resource. Machines on other networks that -the local master browsers learn about when collating their -browse lists have not been directly seen - these records are -called 'non-authoritative'.

At this point the browse lists look as follows (these are -the machines you would see in your network neighborhood if -you looked in it on a particular network right now).

Subnet           Browse Master   List
-------           -------------   ----
-Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E
-
-Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
-
-Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D

/etc/hosts: is static, hard to maintain, and lacks name_type info
DNS: is a good choice but lacks essential name_type info.

Note that at this point all the subnets are separate, no -machine is seen across any of the subnets.

Now examine subnet 2. As soon as N2_B has become the local -master browser it looks for a Domain master browser to synchronize -its browse list with. It does this by querying the WINS server -(N2_D) for the IP address associated with the NetBIOS name -WORKGROUP>1B<. This name was registerd by the Domain master -browser (N1_C) with the WINS server as soon as it was booted.

Once N2_B knows the address of the Domain master browser it -tells it that is the local master browser for subnet 2 by -sending a MasterAnnouncement packet as a UDP port 138 packet. -It then synchronizes with it by doing a NetServerEnum2 call. This -tells the Domain Master Browser to send it all the server -names it knows about. Once the domain master browser receives -the MasterAnnouncement packet it schedules a synchronization -request to the sender of that packet. After both synchronizations -are done the browse lists look like :

Subnet           Browse Master   List
-------           -------------   ----
-Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
-                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*)
-
-Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
-                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
-
-Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
-
-Servers with a (*) after them are non-authoritative names.

At this point users looking in their network neighborhood on -subnets 1 or 2 will see all the servers on both, users on -subnet 3 will still only see the servers on their own subnet.

The same sequence of events that occured for N2_B now occurs -for the local master browser on subnet 3 (N3_D). When it -synchronizes browse lists with the domain master browser (N1_A) -it gets both the server entries on subnet 1, and those on -subnet 2. After N3_D has synchronized with N1_C and vica-versa -the browse lists look like.

Many sites want to restrict DNS lookups and want to avoid broadcast name
+resolution traffic. The "name resolve order" parameter is of great help here.
+The syntax of the "name resolve order" parameter is:
+
Subnet           Browse Master   List
-------           -------------   ----
-Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
-                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*),
-                                 N3_A(*), N3_B(*), N3_C(*), N3_D(*)
-
-Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
-                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
-
-Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
-                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*),
-                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*)
-
-Servers with a (*) after them are non-authoritative names.

At this point users looking in their network neighborhood on -subnets 1 or 3 will see all the servers on all sunbets, users on -subnet 2 will still only see the servers on subnets 1 and 2, but not 3.

Finally, the local master browser for subnet 2 (N2_B) will sync again -with the domain master browser (N1_C) and will recieve the missing -server entries. Finally - and as a steady state (if no machines -are removed or shut off) the browse lists will look like :

name resolve order = wins lmhosts bcast host
+_or_ +
Subnet           Browse Master   List
-------           -------------   ----
-Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
-                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*),
-                                 N3_A(*), N3_B(*), N3_C(*), N3_D(*)
-
-Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
-                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
-                                 N3_A(*), N3_B(*), N3_C(*), N3_D(*)
-
-Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
-                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*),
-                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*)
-	
-Servers with a (*) after them are non-authoritative names.

Synchronizations between the domain master browser and local -master browsers will continue to occur, but this should be a -steady state situation.

If either router R1 or R2 fails the following will occur:

  1. name resolve order = wins lmhosts (eliminates bcast and host)
+The default is: +
name  resolve order = host lmhost wins bcast
. +where "host" refers the the native methods used by the Unix system +to implement the gethostbyname() function call. This is normally +controlled by /etc/host.conf, /etc/nsswitch.conf and /etc/resolv.conf.


Chapter 3. User information database

3.1. Introduction

Names of computers on each side of the inaccessible network fragments - will be maintained for as long as 36 minutes, in the network neighbourhood - lists. +>Old windows clients send plain text passwords over the wire. + Samba can check these passwords by crypting them and comparing them + to the hash stored in the unix user database.

  • Attempts to connect to these inaccessible computers will fail, but the - names will not be removed from the network neighbourhood lists. +> Newer windows clients send encrypted passwords (so-called + Lanman and NT hashes) over + the wire, instead of plain text passwords. The newest clients + will only send encrypted passwords and refuse to send plain text + passwords, unless their registry is tweaked.

  • If one of the fragments is cut off from the WINS server, it will only - be able to access servers on its local subnet, by using subnet-isolated - broadcast NetBIOS name resolution. The effects are similar to that of - losing access to a DNS server. +>These passwords can't be converted to unix style encrypted + passwords. Because of that you can't use the standard unix + user database, and you have to store the Lanman and NT hashes + somewhere else.

    Next to a differently encrypted passwords, + windows also stores certain data for each user + that is not stored in a unix user database, e.g. + workstations the user may logon from, the location where his/her + profile is stored, etc. + Samba retrieves and stores this information using a "passdb backend". + Commonly + available backends are LDAP, plain text file, MySQL and nisplus. + For more information, see the documentation about the + passdb backend = parameter.


  • 2.5. Setting up a WINS server

    Either a Samba machine or a Windows NT Server machine may be set up -as a WINS server. To set a Samba machine to be a WINS server you must -add the following option to the smb.conf file on the selected machine : -in the [globals] section add the line

    3.2. Important Notes About Security

    wins support = yes

    The unix and SMB password encryption techniques seem similar + on the surface. This similarity is, however, only skin deep. The unix + scheme typically sends clear text passwords over the network when + logging in. This is bad. The SMB encryption scheme never sends the + cleartext password over the network but it does store the 16 byte + hashed values on disk. This is also bad. Why? Because the 16 byte hashed + values are a "password equivalent". You cannot derive the user's + password from them, but they could potentially be used in a modified + client to gain access to a server. This would require considerable + technical knowledge on behalf of the attacker but is perfectly possible. + You should thus treat the data stored in whatever + passdb backend you use (smbpasswd file, ldap, mysql) as though it contained the + cleartext passwords of all your users. Its contents must be kept + secret, and the file should be protected accordingly.

    Versions of Samba previous to 1.9.17 had this parameter default to -yes. If you have any older versions of Samba on your network it is -strongly suggested you upgrade to 1.9.17 or above, or at the very -least set the parameter to 'no' on all these machines.

    Ideally we would like a password scheme which neither requires + plain text passwords on the net or on disk. Unfortunately this + is not available as Samba is stuck with being compatible with + other SMB systems (WinNT, WfWg, Win95 etc).

    Machines with "wins support = yes" will keep a list of -all NetBIOS names registered with them, acting as a DNS for NetBIOS names.

    You should set up only ONE wins server. Do NOT set the -"wins support = yes" option on more than one Samba -server.

    To set up a Windows NT Server as a WINS server you need to set up -the WINS service - see your NT documentation for details. Note that -Windows NT WINS Servers can replicate to each other, allowing more -than one to be set up in a complex subnet environment. As Microsoft -refuse to document these replication protocols Samba cannot currently -participate in these replications. It is possible in the future that -a Samba->Samba WINS replication protocol may be defined, in which -case more than one Samba machine could be set up as a WINS server -but currently only one Samba server should have the "wins support = yes" -parameter set.

    Note that Windows NT 4.0 Service pack 3 changed the + default for permissible authentication so that plaintext + passwords are never sent over the wire. + The solution to this is either to switch to encrypted passwords + with Samba or edit the Windows NT registry to re-enable plaintext + passwords. See the document WinNT.txt for details on how to do + this.

    After the WINS server has been configured you must ensure that all -machines participating on the network are configured with the address -of this WINS server. If your WINS server is a Samba machine, fill in -the Samba machine IP address in the "Primary WINS Server" field of -the "Control Panel->Network->Protocols->TCP->WINS Server" dialogs -in Windows 95 or Windows NT. To tell a Samba server the IP address -of the WINS server add the following line to the [global] section of -all smb.conf files :

    Other Microsoft operating systems which also exhibit + this behavior includes

    wins server = >name or IP address<

    MS DOS Network client 3.0 with + the basic network redirector installed
    Windows 95 with the network redirector + update installed
    Windows 98 [se]
    Windows 2000

    where >name or IP address< is either the DNS name of the WINS server -machine or its IP address.

    Note that this line MUST NOT BE SET in the smb.conf file of the Samba -server acting as the WINS server itself. If you set both the -"wins support = yes" option and the -"wins server = >name<" option then -nmbd will fail to start.

    There are two possible scenarios for setting up cross subnet browsing. -The first details setting up cross subnet browsing on a network containing -Windows 95, Samba and Windows NT machines that are not configured as -part of a Windows NT Domain. The second details setting up cross subnet -browsing on networks that contain NT Domains.

    Note :All current release of + Microsoft SMB/CIFS clients support authentication via the + SMB Challenge/Response mechanism described here. Enabling + clear text authentication does not disable the ability + of the client to participate in encrypted authentication.



    2.6. Setting up Browsing in a WORKGROUP

    To set up cross subnet browsing on a network containing machines -in up to be in a WORKGROUP, not an NT Domain you need to set up one -Samba server to be the Domain Master Browser (note that this is *NOT* -the same as a Primary Domain Controller, although in an NT Domain the -same machine plays both roles). The role of a Domain master browser is -to collate the browse lists from local master browsers on all the -subnets that have a machine participating in the workgroup. Without -one machine configured as a domain master browser each subnet would -be an isolated workgroup, unable to see any machines on any other -subnet. It is the presense of a domain master browser that makes -cross subnet browsing possible for a workgroup.

    In an WORKGROUP environment the domain master browser must be a -Samba server, and there must only be one domain master browser per -workgroup name. To set up a Samba server as a domain master browser, -set the following option in the [global] section of the smb.conf file :

    domain master = yes

    The domain master browser should also preferrably be the local master -browser for its own subnet. In order to achieve this set the following -options in the [global] section of the smb.conf file :

            domain master = yes
    -        local master = yes
    -        preferred master = yes
    -        os level = 65

    The domain master browser may be the same machine as the WINS -server, if you require.

    Next, you should ensure that each of the subnets contains a -machine that can act as a local master browser for the -workgroup. Any NT machine should be able to do this, as will -Windows 95 machines (although these tend to get rebooted more -often, so it's not such a good idea to use these). To make a -Samba server a local master browser set the following -options in the [global] section of the smb.conf file :

    3.2.1. Advantages of SMB Encryption

            domain master = no
    -        local master = yes
    -        preferred master = yes
    -        os level = 65

    plain text passwords are not passed across + the network. Someone using a network sniffer cannot just + record passwords going to the SMB server.
    WinNT doesn't like talking to a server + that isn't using SMB encrypted passwords. It will refuse + to browse the server if the server is also in user level + security mode. It will insist on prompting the user for the + password on each connection, which is very annoying. The + only things you can do to stop this is to use SMB encryption. +

    Do not do this for more than one Samba server on each subnet, -or they will war with each other over which is to be the local -master browser.

    The "local master" parameter allows Samba to act as a local master -browser. The "preferred master" causes nmbd to force a browser -election on startup and the "os level" parameter sets Samba high -enough so that it should win any browser elections.

    If you have an NT machine on the subnet that you wish to -be the local master browser then you can disable Samba from -becoming a local master browser by setting the following -options in the [global] section of the smb.conf file :

            domain master = no
    -        local master = no
    -        preferred master = no
    -        os level = 0



    2.7. Setting up Browsing in a DOMAIN

    If you are adding Samba servers to a Windows NT Domain then -you must not set up a Samba server as a domain master browser. -By default, a Windows NT Primary Domain Controller for a Domain -name is also the Domain master browser for that name, and many -things will break if a Samba server registers the Domain master -browser NetBIOS name (DOMAIN>1B<) with WINS instead of the PDC.

    For subnets other than the one containing the Windows NT PDC -you may set up Samba servers as local master browsers as -described. To make a Samba server a local master browser set -the following options in the [global] section of the smb.conf -file :

    3.2.2. Advantages of non-encrypted passwords

            domain master = no
    -        local master = yes
    -        preferred master = yes
    -        os level = 65

    plain text passwords are not kept + on disk.
    uses same password file as other unix + services such as login and ftp
    you are probably already using other + services (such as telnet and ftp) which send plain text + passwords over the net, so sending them for SMB isn't + such a big deal.

    If you wish to have a Samba server fight the election with machines -on the same subnet you may set the "os level" parameter to lower -levels. By doing this you can tune the order of machines that -will become local master browsers if they are running. For -more details on this see the section "FORCING SAMBA TO BE THE MASTER" -below.

    If you have Windows NT machines that are members of the domain -on all subnets, and you are sure they will always be running then -you can disable Samba from taking part in browser elections and -ever becoming a local master browser by setting following options -in the [global] section of the smb.conf file :

    domain master = no - local master = no - preferred master = no - os level = 0


    2.8. Forcing samba to be the master

    3.3. The smbpasswd Command

    Who becomes the "master browser" is determined by an election process -using broadcasts. Each election packet contains a number of parameters -which determine what precedence (bias) a host should have in the -election. By default Samba uses a very low precedence and thus loses -elections to just about anyone else.

    If you want Samba to win elections then just set the "os level" global -option in smb.conf to a higher number. It defaults to 0. Using 34 -would make it win all elections over every other system (except other -samba systems!)

    A "os level" of 2 would make it beat WfWg and Win95, but not NTAS. A -NTAS domain controller uses level 32.

    The maximum os level is 255

    If you want samba to force an election on startup, then set the -"preferred master" global option in smb.conf to "yes". Samba will -then have a slight advantage over other potential master browsers -that are not preferred master browsers. Use this parameter with -care, as if you have two hosts (whether they are windows 95 or NT or -samba) on the same local subnet both set with "preferred master" to -"yes", then periodically and continually they will force an election -in order to become the local master browser.

    If you want samba to be a "domain master browser", then it is -recommended that you also set "preferred master" to "yes", because -samba will not become a domain master browser for the whole of your -LAN or WAN if it is not also a local master browser on its own -broadcast isolated subnet.

    It is possible to configure two samba servers to attempt to become -the domain master browser for a domain. The first server that comes -up will be the domain master browser. All other samba servers will -attempt to become the domain master browser every 5 minutes. They -will find that another samba server is already the domain master -browser and will fail. This provides automatic redundancy, should -the current domain master browser fail.


    2.9. Making samba the domain master

    The smbpasswd utility is a utility similar to the + passwd or yppasswd programs. + It maintains the two 32 byte password fields + in the passdb backend.

    The domain master is responsible for collating the browse lists of -multiple subnets so that browsing can occur between subnets. You can -make samba act as the domain master by setting "domain master = yes" -in smb.conf. By default it will not be a domain master.

    smbpasswd works in a client-server mode + where it contacts the local smbd to change the user's password on its + behalf. This has enormous benefits - as follows.

    Note that you should NOT set Samba to be the domain master for a -workgroup that has the same name as an NT Domain.

    smbpasswd has the capability + to change passwords on Windows NT servers (this only works when + the request is sent to the NT Primary Domain Controller if you + are changing an NT Domain user's password).

    When samba is the domain master and the master browser it will listen -for master announcements (made roughly every twelve minutes) from local -master browsers on other subnets and then contact them to synchronise -browse lists.

    To run smbpasswd as a normal user just type :

    If you want samba to be the domain master then I suggest you also set -the "os level" high enough to make sure it wins elections, and set -"preferred master" to "yes", to get samba to force an election on -startup.

    $ smbpasswd

    Note that all your servers (including samba) and clients should be -using a WINS server to resolve NetBIOS names. If your clients are only -using broadcasting to resolve NetBIOS names, then two things will occur:

    Old SMB password: <type old value here - + or hit return if there was no old password>

    New SMB Password: <type new value> +

    1. your local master browsers will be unable to find a domain master - browser, as it will only be looking on the local subnet. -

    2. Repeat New SMB Password: <re-type new value +

      if a client happens to get hold of a domain-wide browse list, and - a user attempts to access a host in that list, it will be unable to - resolve the NetBIOS name of that host. -

    If the old value does not match the current value stored for + that user, or the two new values do not match each other, then the + password will not be changed.

    If, however, both samba and your clients are using a WINS server, then:

    If invoked by an ordinary user it will only allow the user + to change his or her own Samba password.

    1. If run by the root user smbpasswd may take an optional + argument, specifying the user name whose SMB password you wish to + change. Note that when run as root smbpasswd does not prompt for + or check the old password value, thus allowing root to set passwords + for users who have forgotten their passwords.

      your local master browsers will contact the WINS server and, as long as - samba has registered that it is a domain master browser with the WINS - server, your local master browser will receive samba's ip address - as its domain master browser. -

    2. smbpasswd is designed to work in the same way + and be familiar to UNIX users who use the passwd or + yppasswd commands.

      when a client receives a domain-wide browse list, and a user attempts - to access a host in that list, it will contact the WINS server to - resolve the NetBIOS name of that host. as long as that host has - registered its NetBIOS name with the same WINS server, the user will - be able to see that host. -

    For more details on using smbpasswd refer + to the man page which will always be the definitive reference.


    2.10. Note about broadcast addresses

    3.4. Plain text

    If your network uses a "0" based broadcast address (for example if it -ends in a 0) then you will strike problems. Windows for Workgroups -does not seem to support a 0's broadcast and you will probably find -that browsing and name lookups won't work.

    Older versions of samba retrieved user information from the unix user database +and eventually some other fields from the file /etc/samba/smbpasswd +or /etc/smbpasswd. When password encryption is disabled, no +data is stored at all.


    2.11. Multiple interfaces

    3.5. TDB

    Samba now supports machines with multiple network interfaces. If you -have multiple interfaces then you will need to use the "interfaces" -option in smb.conf to configure them. See smb.conf(5) for details.

    Samba can also store the user data in a "TDB" (Trivial Database). Using this backend +doesn't require any additional configuration. This backend is recommended for new installations who +don't require LDAP.


    Chapter 3. Oplocks


    3.1. What are oplocks?

    When a client opens a file it can request an "oplock" or file -lease. This is (to simplify a bit) a guarentee that no one else -has the file open simultaneously. It allows the client to not -send any updates on the file to the server, thus reducing a -network file access to local access (once the file is in -client cache). An "oplock break" is when the server sends -a request to the client to flush all its changes back to -the server, so the file is in a consistent state for other -opens to succeed. If a client fails to respond to this -asynchronous request then the file can be corrupted. Hence -the "turn off oplocks" answer if people are having multi-user -file access problems.

    Unless the kernel is "oplock aware" (SGI IRIX and Linux are -the only two UNIXes that are at the moment) then if a local -UNIX process accesses the file simultaneously then Samba -has no way of telling this is occuring, so the guarentee -to the client is broken. This can corrupt the file. Short -answer - it you have UNIX clients accessing the same file -as smbd locally or via NFS and you're not running Linux or -IRIX then turn off oplocks for that file or share.

    "Share modes". These are modes of opening a file, that -guarentee an invarient - such as DENY_WRITE - which means -that if any other opens are requested with write access after -this current open has succeeded then they should be denied -with a "sharing violation" error message. Samba handles these -internally inside smbd. UNIX clients accessing the same file -ignore these invarients. Just proving that if you need simultaneous -file access from a Windows and UNIX client you *must* have an -application that is written to lock records correctly on both -sides. Few applications are written like this, and even fewer -are cross platform (UNIX and Windows) so in practice this isn't -much of a problem.

    "Locking". This really means "byte range locking" - such as -lock 10 bytes at file offset 24 for write access. This is the -area in which well written UNIX and Windows apps will cooperate. -Windows locks (at least from NT or above) are 64-bit unsigned -offsets. UNIX locks are either 31 bit or 63 bit and are signed -(the top bit is used for the sign). Samba handles these by -first ensuring that all the Windows locks don't conflict (ie. -if other Windows clients have competing locks then just reject -immediately) - this allows us to support 64-bit Windows locks -on 32-bit filesystems. Secondly any locks that are valid are -then mapped onto UNIX fcntl byte range locks. These are the -locks that will be seen by UNIX processes. If there is a conflict -here the lock is rejected.

    Note that if a client has an oplock then it "knows" that no -other client can have the file open so usually doesn't bother -to send to lock request to the server - this means once again -if you need to share files between UNIX and Windows processes -either use IRIX or Linux, or turn off oplocks for these -files/shares.


    Chapter 4. Quick Cross Subnet Browsing / Cross Workgroup Browsing guide

    This document should be read in conjunction with Browsing and may -be taken as the fast track guide to implementing browsing across subnets -and / or across workgroups (or domains). WINS is the best tool for resolution -of NetBIOS names to IP addesses. WINS is NOT involved in browse list handling -except by way of name to address mapping.

    3.6. LDAP

    4.1. Discussion

    3.6.1. Introduction

    Firstly, all MS Windows networking is based on SMB (Server Message -Block) based messaging. SMB messaging is implemented using NetBIOS. Samba -implements NetBIOS by encapsulating it over TCP/IP. MS Windows products can -do likewise. NetBIOS based networking uses broadcast messaging to affect -browse list management. When running NetBIOS over TCP/IP this uses UDP -based messaging. UDP messages can be broadcast or unicast.

    This document describes how to use an LDAP directory for storing Samba user +account information traditionally stored in the smbpasswd(5) file. It is +assumed that the reader already has a basic understanding of LDAP concepts +and has a working directory server already installed. For more information +on LDAP architectures and Directories, please refer to the following sites.

    Normally, only unicast UDP messaging can be forwarded by routers. The -"remote announce" parameter to smb.conf helps to project browse announcements -to remote network segments via unicast UDP. Similarly, the "remote browse sync" -parameter of smb.conf implements browse list collation using unicast UDP.

    • Secondly, in those networks where Samba is the only SMB server technology -wherever possible nmbd should be configured on one (1) machine as the WINS -server. This makes it easy to manage the browsing environment. If each network -segment is configured with it's own Samba WINS server, then the only way to -get cross segment browsing to work is by using the "remote announce" and -the "remote browse sync" parameters to your smb.conf file.

      OpenLDAP - http://www.openldap.org/

    • If only one WINS server is used then the use of the "remote announce" and the -"remote browse sync" parameters should NOT be necessary.

      iPlanet Directory Server - http://iplanet.netscape.com/directory

    Samba WINS does not support MS-WINS replication. This means that when setting up -Samba as a WINS server there must only be one nmbd configured as a WINS server -on the network. Some sites have used multiple Samba WINS servers for redundancy -(one server per subnet) and then used "remote browse sync" and "remote announce" -to affect browse list collation across all segments. Note that this means -clients will only resolve local names, and must be configured to use DNS to -resolve names on other subnets in order to resolve the IP addresses of the -servers they can see on other subnets. This setup is not recommended, but is -mentioned as a practical consideration (ie: an 'if all else fails' scenario).

    Note that O'Reilly Publishing is working on +a guide to LDAP for System Administrators which has a planned release date of +early summer, 2002.

    Lastly, take note that browse lists are a collection of unreliable broadcast -messages that are repeated at intervals of not more than 15 minutes. This means -that it will take time to establish a browse list and it can take up to 45 -minutes to stabilise, particularly across network segments.

    Two additional Samba resources which may prove to be helpful are

    • The Samba-PDC-LDAP-HOWTO + maintained by Ignacio Coupeau.

    • The NT migration scripts from IDEALX that are + geared to manage users and group in such a Samba-LDAP Domain Controller configuration. +



    4.2. Use of the "Remote Announce" parameter

    3.6.2. Introduction

    The "remote announce" parameter of smb.conf can be used to forcibly ensure -that all the NetBIOS names on a network get announced to a remote network. -The syntax of the "remote announce" parameter is: -

    	remote announce = a.b.c.d [e.f.g.h] ...
    Traditionally, when configuring "encrypt +passwords = yes" in Samba's smb.conf file, user account +information such as username, LM/NT password hashes, password change times, and account +flags have been stored in the smbpasswd(5) file. There are several +disadvantages to this approach for sites with very large numbers of users (counted +in the thousands).

    • The first is that all lookups must be performed sequentially. Given that +there are approximately two lookups per domain logon (one for a normal +session connection such as when mapping a network drive or printer), this +is a performance bottleneck for lareg sites. What is needed is an indexed approach +such as is used in databases.

    • The second problem is that administrators who desired to replicate a +smbpasswd file to more than one Samba server were left to use external +tools such as rsync(1) and ssh(1) -_or_ -

      	remote announce = a.b.c.d/WORKGROUP [e.f.g.h/WORKGROUP] ...
    • And finally, the amount of information which is stored in an +smbpasswd entry leaves no room for additional attributes such as +a home directory, password expiration time, or even a Relative +Identified (RID).

    As a result of these defeciencies, a more robust means of storing user attributes +used by smbd was developed. The API which defines access to user accounts +is commonly referred to as the samdb interface (previously this was called the passdb +API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support +for a samdb backend (e.g. --with-ldapsam or +--with-tdbsam) requires compile time support.

    When compiling Samba to include the --with-ldapsam autoconf +option, smbd (and associated tools) will store and lookup user accounts in +an LDAP directory. In reality, this is very easy to understand. If you are +comfortable with using an smbpasswd file, simply replace "smbpasswd" with +"LDAP directory" in all the documentation.

    There are a few points to stress about what the --with-ldapsam - -where: -

    a.b.c.d and e.f.g.h
    • is either the LMB (Local Master Browser) IP address -or the broadcst address of the remote network. -ie: the LMB is at 192.168.1.10, or the address -could be given as 192.168.1.255 where the netmask -is assumed to be 24 bits (255.255.255.0). -When the remote announcement is made to the broadcast -address of the remote network every host will receive -our announcements. This is noisy and therefore -undesirable but may be necessary if we do NOT know -the IP address of the remote LMB.

    WORKGROUP
    A means of retrieving user account information from + an Windows 2000 Active Directory server.

  • is optional and can be either our own workgroup -or that of the remote network. If you use the -workgroup name of the remote network then our -NetBIOS machine names will end up looking like -they belong to that workgroup, this may cause -name resolution problems and should be avoided.

  • A means of replacing /etc/passwd.

    The second item can be accomplished by using LDAP NSS and PAM modules. LGPL +versions of these libraries can be obtained from PADL Software +(http://www.padl.com/). However, +the details of configuring these packages are beyond the scope of this document.



    4.3. Use of the "Remote Browse Sync" parameter

    The "remote browse sync" parameter of smb.conf is used to announce to -another LMB that it must synchronise it's NetBIOS name list with our -Samba LMB. It works ONLY if the Samba server that has this option is -simultaneously the LMB on it's network segment.

    3.6.3. Supported LDAP Servers

    The syntax of the "remote browse sync" parameter is: -

    	remote browse sync = a.b.c.d
    - -where a.b.c.d is either the IP address of the remote LMB or else is the network broadcast address of the remote segment.

    The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP +2.0 server and client libraries. The same code should be able to work with +Netscape's Directory Server and client SDK. However, due to lack of testing +so far, there are bound to be compile errors and bugs. These should not be +hard to fix. If you are so inclined, please be sure to forward all patches to +samba-patches@samba.org and +jerry@samba.org.



    4.4. Use of WINS

    3.6.4. Schema and Relationship to the RFC 2307 posixAccount

    Use of WINS (either Samba WINS _or_ MS Windows NT Server WINS) is highly -recommended. Every NetBIOS machine registers it's name together with a -name_type value for each of of several types of service it has available. -eg: It registers it's name directly as a unique (the type 0x03) name. -It also registers it's name if it is running the lanmanager compatible -server service (used to make shares and printers available to other users) -by registering the server (the type 0x20) name.

    Samba 3.0 includes the necessary schema file for OpenLDAP 2.0 in +examples/LDAP/samba.schema. The sambaAccount objectclass is given here:

    All NetBIOS names are up to 15 characters in length. The name_type variable -is added to the end of the name - thus creating a 16 character name. Any -name that is shorter than 15 characters is padded with spaces to the 15th -character. ie: All NetBIOS names are 16 characters long (including the -name_type information).

    objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL
    +     DESC 'Samba Account'
    +     MUST ( uid $ rid )
    +     MAY  ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $
    +            logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $
    +            displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $
    +            description $ userWorkstations $ primaryGroupID $ domain ))

    WINS can store these 16 character names as they get registered. A client -that wants to log onto the network can ask the WINS server for a list -of all names that have registered the NetLogon service name_type. This saves -broadcast traffic and greatly expedites logon processing. Since broadcast -name resolution can not be used across network segments this type of -information can only be provided via WINS _or_ via statically configured -"lmhosts" files that must reside on all clients in the absence of WINS.

    WINS also serves the purpose of forcing browse list synchronisation by all -LMB's. LMB's must synchronise their browse list with the DMB (domain master -browser) and WINS helps the LMB to identify it's DMB. By definition this -will work only within a single workgroup. Note that the domain master browser -has NOTHING to do with what is referred to as an MS Windows NT Domain. The -later is a reference to a security environment while the DMB refers to the -master controller for browse list information only.

    Use of WINS will work correctly only if EVERY client TCP/IP protocol stack -has been configured to use the WINS server/s. Any client that has not been -configured to use the WINS server will continue to use only broadcast based -name registration so that WINS may NEVER get to know about it. In any case, -machines that have not registered with a WINS server will fail name to address -lookup attempts by other clients and will therefore cause workstation access -errors.

    To configure Samba as a WINS server just add "wins support = yes" to the -smb.conf file [globals] section.

    The samba.schema file has been formatted for OpenLDAP 2.0. The OID's are +owned by the Samba Team and as such is legal to be openly published. +If you translate the schema to be used with Netscape DS, please +submit the modified schema file as a patch to jerry@samba.org

    To configure Samba to register with a WINS server just add -"wins server = a.b.c.d" to your smb.conf file [globals] section.

    Just as the smbpasswd file is mean to store information which supplements a +user's /etc/passwd entry, so is the sambaAccount object +meant to supplement the UNIX user account information. A sambaAccount is a +STRUCTURAL objectclass so it can be stored individually +in the directory. However, there are several fields (e.g. uid) which overlap +with the posixAccount objectclass outlined in RFC2307. This is by design.

    DO NOT EVER use both "wins support = yes" together with "wins server = a.b.c.d" -particularly not using it's own IP address.

    In order to store all user account information (UNIX and Samba) in the directory, +it is necessary to use the sambaAccount and posixAccount objectclasses in +combination. However, smbd will still obtain the user's UNIX account +information via the standard C library calls (e.g. getpwnam(), et. al.). +This means that the Samba server must also have the LDAP NSS library installed +and functioning correctly. This division of information makes it possible to +store all Samba account information in LDAP, but still maintain UNIX account +information in NIS while the network is transitioning to a full LDAP infrastructure.



    3.6.5. Configuring Samba with LDAP

    4.5. Do NOT use more than one (1) protocol on MS Windows machines

    3.6.5.1. OpenLDAP configuration

    A very common cause of browsing problems results from installing more than -one protocol on an MS Windows machine.

    To include support for the sambaAccount object in an OpenLDAP directory +server, first copy the samba.schema file to slapd's configuration directory.

    Every NetBIOS machine take part in a process of electing the LMB (and DMB) -every 15 minutes. A set of election criteria is used to determine the order -of precidence for winning this election process. A machine running Samba or -Windows NT will be biased so that the most suitable machine will predictably -win and thus retain it's role.

    root# cp samba.schema /etc/openldap/schema/

    The election process is "fought out" so to speak over every NetBIOS network -interface. In the case of a Windows 9x machine that has both TCP/IP and IPX -installed and has NetBIOS enabled over both protocols the election will be -decided over both protocols. As often happens, if the Windows 9x machine is -the only one with both protocols then the LMB may be won on the NetBIOS -interface over the IPX protocol. Samba will then lose the LMB role as Windows -9x will insist it knows who the LMB is. Samba will then cease to function -as an LMB and thus browse list operation on all TCP/IP only machines will -fail.

    Next, include the samba.schema file in slapd.conf. +The sambaAccount object contains two attributes which depend upon other schema +files. The 'uid' attribute is defined in cosine.schema and +the 'displayName' attribute is defined in the inetorgperson.schema +file. Both of these must be included before the samba.schema file.

    The safest rule of all to follow it this - USE ONLY ONE PROTOCOL!

    ## /etc/openldap/slapd.conf
    +
    +## schema files (core.schema is required by default)
    +include	           /etc/openldap/schema/core.schema
    +
    +## needed for sambaAccount
    +include            /etc/openldap/schema/cosine.schema
    +include            /etc/openldap/schema/inetorgperson.schema
    +include            /etc/openldap/schema/samba.schema
    +
    +## uncomment this line if you want to support the RFC2307 (NIS) schema
    +## include         /etc/openldap/schema/nis.schema
    +
    +....

    It is recommended that you maintain some indices on some of the most usefull attributes, +like in the following example, to speed up searches made on sambaAccount objectclasses +(and possibly posixAccount and posixGroup as well).

    # Indices to maintain
    +## required by OpenLDAP 2.0
    +index objectclass   eq
    +
    +## support pb_getsampwnam()
    +index uid           pres,eq
    +## support pdb_getsambapwrid()
    +index rid           eq
    +
    +## uncomment these if you are storing posixAccount and
    +## posixGroup entries in the directory as well
    +##index uidNumber     eq
    +##index gidNumber     eq
    +##index cn            eq
    +##index memberUid     eq



    4.6. Name Resolution Order

    3.6.5.2. Configuring Samba

    The following parameters are available in smb.conf only with --with-ldapsam +was included with compiling Samba.

    Resolution of NetBIOS names to IP addresses can take place using a number -of methods. The only ones that can provide NetBIOS name_type information -are: -

    WINS: the best tool!
    LMHOSTS: is static and hard to maintain.
    Broadcast: uses UDP and can not resolve names across remote segments.

    These are described in the smb.conf(5) man +page and so will not be repeated here. However, a sample smb.conf file for +use with an LDAP directory could appear as

    ## /usr/local/samba/lib/smb.conf
    +[global]
    +     security = user
    +     encrypt passwords = yes
    +
    +     netbios name = TASHTEGO
    +     workgroup = NARNIA
    +
    +     # ldap related parameters
    +
    +     # define the DN to use when binding to the directory servers
    +     # The password for this DN is not stored in smb.conf.  Rather it
    +     # must be set by using 'smbpasswd -w secretpw' to store the
    +     # passphrase in the secrets.tdb file.  If the "ldap admin dn" values
    +     # changes, this password will need to be reset.
    +     ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org"
    +
    +     #  specify the LDAP server's hostname (defaults to locahost)
    +     ldap server = ahab.samba.org
    +
    +     # Define the SSL option when connecting to the directory
    +     # ('off', 'start tls', or 'on' (default))
    +     ldap ssl = start tls
    +
    +     # define the port to use in the LDAP session (defaults to 636 when
    +     # "ldap ssl = on")
    +     ldap port = 389
    +
    +     # specify the base DN to use when searching the directory
    +     ldap suffix = "ou=people,dc=samba,dc=org"
    +
    +     # generally the default ldap search filter is ok
    +     # ldap filter = "(&(uid=%u)(objectclass=sambaAccount))"


    3.6.6. Accounts and Groups management

    As users accounts are managed thru the sambaAccount objectclass, you should +modify you existing administration tools to deal with sambaAccount attributes.

    Machines accounts are managed with the sambaAccount objectclass, just +like users accounts. However, it's up to you to stored thoses accounts +in a different tree of you LDAP namespace: you should use +"ou=Groups,dc=plainjoe,dc=org" to store groups and +"ou=People,dc=plainjoe,dc=org" to store users. Just configure your +NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration +file).

    In Samba release 3.0, the group management system is based on posix +groups. This means that Samba make usage of the posixGroup objectclass. +For now, there is no NT-like group system management (global and local +groups).


    3.6.7. Security and sambaAccount

    There are two important points to remember when discussing the security +of sambaAccount entries in the directory.

    • Never retrieve the lmPassword or + ntPassword attribute values over an unencrypted LDAP session.

    • Never allow non-admin users to + view the lmPassword or ntPassword attribute values.

    These password hashes are clear text equivalents and can be used to impersonate +the user without deriving the original clear text strings. For more information +on the details of LM/NT password hashes, refer to the ENCRYPTION chapter of the Samba-HOWTO-Collection.

    To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults +to require an encrypted session (ldap ssl = on) using +the default port of 636 +when contacting the directory server. When using an OpenLDAP 2.0 server, it +is possible to use the use the StartTLS LDAP extended operation in the place of +LDAPS. In either case, you are strongly discouraged to disable this security +(ldap ssl = off).

    Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS +extended operation. However, the OpenLDAP library still provides support for +the older method of securing communication between clients and servers.

    The second security precaution is to prevent non-administrative users from +harvesting password hashes from the directory. This can be done using the +following ACL in slapd.conf:

    ## allow the "ldap admin dn" access, but deny everyone else
    +access to attrs=lmPassword,ntPassword
    +     by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write
    +     by * none


    3.6.8. LDAP specials attributes for sambaAccounts

    The sambaAccount objectclass is composed of the following attributes:

    • lmPassword: the LANMAN password 16-byte hash stored as a character + representation of a hexidecimal string.

    • ntPassword: the NT password hash 16-byte stored as a character + representation of a hexidecimal string.

    • pwdLastSet: The integer time in seconds since 1970 when the + lmPassword and ntPassword attributes were last set. +

    • acctFlags: string of 11 characters surrounded by square brackets [] + representing account flags such as U (user), W(workstation), X(no password expiration), and + D(disabled).

    • logonTime: Integer value currently unused

    • logoffTime: Integer value currently unused

    • kickoffTime: Integer value currently unused

    • pwdCanChange: Integer value currently unused

    • pwdMustChange: Integer value currently unused

    • homeDrive: specifies the drive letter to which to map the + UNC path specified by homeDirectory. The drive letter must be specified in the form "X:" + where X is the letter of the drive to map. Refer to the "logon drive" parameter in the + smb.conf(5) man page for more information.

    • scriptPath: The scriptPath property specifies the path of + the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path + is relative to the netlogon share. Refer to the "logon script" parameter in the + smb.conf(5) man page for more information.

    • profilePath: specifies a path to the user's profile. + This value can be a null string, a local absolute path, or a UNC path. Refer to the + "logon path" parameter in the smb.conf(5) man page for more information.

    • smbHome: The homeDirectory property specifies the path of + the home directory for the user. The string can be null. If homeDrive is set and specifies + a drive letter, homeDirectory should be a UNC path. The path must be a network + UNC path of the form \\server\share\directory. This value can be a null string. + Refer to the "logon home" parameter in the smb.conf(5) man page for more information. +

    • userWorkstation: character string value currently unused. +

    • rid: the integer representation of the user's relative identifier + (RID).

    • primaryGroupID: the relative identifier (RID) of the primary group + of the user.

    The majority of these parameters are only used when Samba is acting as a PDC of +a domain (refer to the Samba-PDC-HOWTO for details on +how to configure Samba as a Primary Domain Controller). The following four attributes +are only stored with the sambaAccount entry if the values are non-default values:

    • smbHome

    • scriptPath

    • logonPath

    • homeDrive

    These attributes are only stored with the sambaAccount entry if +the values are non-default values. For example, assume TASHTEGO has now been +configured as a PDC and that logon home = \\%L\%u was defined in +its smb.conf file. When a user named "becky" logons to the domain, +the logon home string is expanded to \\TASHTEGO\becky. +If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org", +this value is used. However, if this attribute does not exist, then the value +of the logon home parameter is used in its place. Samba +will only write the attribute value to the directory entry is the value is +something other than the default (e.g. \\MOBY\becky).


    3.6.9. Example LDIF Entries for a sambaAccount

    The following is a working LDIF with the inclusion of the posixAccount objectclass:

    Alternative means of name resolution includes: -

    dn: uid=guest2, ou=people,dc=plainjoe,dc=org
    +ntPassword: 878D8014606CDA29677A44EFA1353FC7
    +pwdMustChange: 2147483647
    +primaryGroupID: 1201
    +lmPassword: 552902031BEDE9EFAAD3B435B51404EE
    +pwdLastSet: 1010179124
    +logonTime: 0
    +objectClass: sambaAccount
    +uid: guest2
    +kickoffTime: 2147483647
    +acctFlags: [UX         ]
    +logoffTime: 2147483647
    +rid: 19006
    +pwdCanChange: 0

    /etc/hosts: is static, hard to maintain, and lacks name_type info
    DNS: is a good choice but lacks essential name_type info.

    The following is an LDIF entry for using both the sambaAccount and +posixAccount objectclasses:

    Many sites want to restrict DNS lookups and want to avoid broadcast name -resolution traffic. The "name resolve order" parameter is of great help here. -The syntax of the "name resolve order" parameter is: -

    	name resolve order = wins lmhosts bcast host
    -_or_ -
    	name resolve order = wins lmhosts  	(eliminates bcast and host)
    -The default is: -
    	name  resolve order = host lmhost wins bcast
    . -where "host" refers the the native methods used by the Unix system -to implement the gethostbyname() function call. This is normally -controlled by /etc/host.conf, /etc/nsswitch.conf and /etc/resolv.conf.

    dn: uid=gcarter, ou=people,dc=plainjoe,dc=org +logonTime: 0 +displayName: Gerald Carter +lmPassword: 552902031BEDE9EFAAD3B435B51404EE +primaryGroupID: 1201 +objectClass: posixAccount +objectClass: sambaAccount +acctFlags: [UX ] +userPassword: {crypt}BpM2ej8Rkzogo +uid: gcarter +uidNumber: 9000 +cn: Gerald Carter +loginShell: /bin/bash +logoffTime: 2147483647 +gidNumber: 100 +kickoffTime: 2147483647 +pwdLastSet: 1010179230 +rid: 19000 +homeDirectory: /home/tashtego/gcarter +pwdCanChange: 0 +pwdMustChange: 2147483647 +ntPassword: 878D8014606CDA29677A44EFA1353FC7



    Chapter 5. LanMan and NT Password Encryption in Samba

    3.7. MySQL

    5.1. Introduction

    3.7.1. Building

    Newer windows clients send encrypted passwords over - the wire, instead of plain text passwords. The newest clients - will only send encrypted passwords and refuse to send plain text - passwords, unless their registry is tweaked.

    To build the plugin, run make bin/pdb_mysql.so +in the source/ directory of samba distribution.

    These passwords can't be converted to unix style encrypted - passwords. Because of that you can't use the standard unix - user database, and you have to store the Lanman and NT hashes - somewhere else. For more information, see the documentation - about the Next, copy pdb_mysql.so to any location you want. I +strongly recommend installing it in $PREFIX/lib or /usr/lib/samba/


    3.7.2. Creating the database

    You either can set up your own table and specify the field names to pdb_mysql (see below +for the column names) or use the default table. The file examples/pdb/mysql/mysql.dump +contains the correct queries to create the required tables. Use the command : + +passdb backend = parameter. -

    mysql -uusername -hhostname -ppassword databasename < /path/to/samba/examples/pdb/mysql/mysql.dump



    5.2. Important Notes About Security

    3.7.3. Configuring

    The unix and SMB password encryption techniques seem similar - on the surface. This similarity is, however, only skin deep. The unix - scheme typically sends clear text passwords over the network when - logging in. This is bad. The SMB encryption scheme never sends the - cleartext password over the network but it does store the 16 byte - hashed values on disk. This is also bad. Why? Because the 16 byte hashed - values are a "password equivalent". You cannot derive the user's - password from them, but they could potentially be used in a modified - client to gain access to a server. This would require considerable - technical knowledge on behalf of the attacker but is perfectly possible. - You should thus treat the smbpasswd file as though it contained the - cleartext passwords of all your users. Its contents must be kept - secret, and the file should be protected accordingly.

    This plugin lacks some good documentation, but here is some short info:

    Ideally we would like a password scheme which neither requires - plain text passwords on the net or on disk. Unfortunately this - is not available as Samba is stuck with being compatible with - other SMB systems (WinNT, WfWg, Win95 etc).

    Add a the following to the passdb backend variable in your smb.conf: +
    passdb backend = [other-plugins] plugin:/location/to/pdb_mysql.so:identifier [other-plugins]

    The identifier can be any string you like, as long as it doesn't collide with +the identifiers of other plugins or other instances of pdb_mysql. If you +specify multiple pdb_mysql.so entries in 'passdb backend', you also need to +use different identifiers!

    Additional options can be given thru the smb.conf file in the [global] section.

    identifier:mysql host                     - host name, defaults to 'localhost'
    +identifier:mysql password
    +identifier:mysql user                     - defaults to 'samba'
    +identifier:mysql database                 - defaults to 'samba'
    +identifier:mysql port                     - defaults to 3306
    +identifier:table                          - Name of the table containing users

    Warning

    Note that Windows NT 4.0 Service pack 3 changed the - default for permissible authentication so that plaintext - passwords are never sent over the wire. - The solution to this is either to switch to encrypted passwords - with Samba or edit the Windows NT registry to re-enable plaintext - passwords. See the document WinNT.txt for details on how to do - this.

    Other Microsoft operating systems which also exhibit - this behavior includes

    • MS DOS Network client 3.0 with - the basic network redirector installed

    • Windows 95 with the network redirector - update installed

    • Since the password for the mysql user is stored in the +smb.conf file, you should make the the smb.conf file +readable only to the user that runs samba. This is considered a security +bug and will be fixed soon.

    Windows 98 [se]

  • Names of the columns in this table(I've added column types those columns should have first):

    Windows 2000

  • identifier:logon time column             - int(9)
    +identifier:logoff time column            - int(9)
    +identifier:kickoff time column           - int(9)
    +identifier:pass last set time column     - int(9)
    +identifier:pass can change time column   - int(9)
    +identifier:pass must change time column  - int(9)
    +identifier:username column               - varchar(255) - unix username
    +identifier:domain column                 - varchar(255) - NT domain user is part of
    +identifier:nt username column            - varchar(255) - NT username
    +identifier:fullname column            - varchar(255) - Full name of user
    +identifier:home dir column               - varchar(255) - Unix homedir path
    +identifier:dir drive column              - varchar(2) - Directory drive path (eg: 'H:')
    +identifier:logon script column           - varchar(255) - Batch file to run on client side when logging on
    +identifier:profile path column           - varchar(255) - Path of profile
    +identifier:acct desc column              - varchar(255) - Some ASCII NT user data
    +identifier:workstations column           - varchar(255) - Workstations user can logon to (or NULL for all)
    +identifier:unknown string column         - varchar(255) - unknown string
    +identifier:munged dial column            - varchar(255) - ?
    +identifier:uid column                    - int(9) - Unix user ID (uid)
    +identifier:gid column                    - int(9) - Unix user group (gid)
    +identifier:user sid column               - varchar(255) - NT user SID
    +identifier:group sid column              - varchar(255) - NT group ID
    +identifier:lanman pass column            - varchar(255) - encrypted lanman password
    +identifier:nt pass column                - varchar(255) - encrypted nt passwd
    +identifier:plain pass column             - varchar(255) - plaintext password
    +identifier:acct control column           - int(9) - nt user data
    +identifier:unknown 3 column              - int(9) - unknown
    +identifier:logon divs column             - int(9) - ?
    +identifier:hours len column              - int(9) - ?
    +identifier:unknown 5 column              - int(9) - unknown
    +identifier:unknown 6 column              - int(9) - unknown

    Note :All current release of - Microsoft SMB/CIFS clients support authentication via the - SMB Challenge/Response mechanism described here. Enabling - clear text authentication does not disable the ability - of the client to participate in encrypted authentication.

    Eventually, you can put a colon (:) after the name of each column, which +should specify the column to update when updating the table. You can also +specify nothing behind the colon - then the data from the field will not be +updated.


    5.2.1. Advantages of SMB Encryption

    3.7.4. Using plaintext passwords or encrypted password

    • I strongly discourage the use of plaintext passwords, however, you can use them:

      plain text passwords are not passed across - the network. Someone using a network sniffer cannot just - record passwords going to the SMB server.

    • If you would like to use plaintext passwords, set 'identifier:lanman pass column' and 'identifier:nt pass column' to 'NULL' (without the quotes) and 'identifier:plain pass column' to the name of the column containing the plaintext passwords.

      WinNT doesn't like talking to a server - that isn't using SMB encrypted passwords. It will refuse - to browse the server if the server is also in user level - security mode. It will insist on prompting the user for the - password on each connection, which is very annoying. The - only things you can do to stop this is to use SMB encryption. -

    If you use encrypted passwords, set the 'identifier:plain pass column' to 'NULL' (without the quotes). This is the default.


    5.2.2. Advantages of non-encrypted passwords

    3.7.5. Getting non-column data from the table

    • It is possible to have not all data in the database and making some 'constant'.

      plain text passwords are not kept - on disk.

    • For example, you can set 'identifier:fullname column' to : +CONCAT(First_name,' ',Sur_name)

      uses same password file as other unix - services such as login and ftp

    • Or, set 'identifier:workstations column' to : +NULL

      you are probably already using other - services (such as telnet and ftp) which send plain text - passwords over the net, so sending them for SMB isn't - such a big deal.

    See the MySQL documentation for more language constructs.


    5.3. The smbpasswd Command

    The smbpasswd command maintains the two 32 byte password fields - in the smbpasswd file. If you wish to make it similar to the unix - passwd or yppasswd programs, - install it in /usr/local/samba/bin/ (or your - main Samba binary directory).

    3.8. Passdb XML plugin

    3.8.1. Building

    smbpasswd now works in a client-server mode - where it contacts the local smbd to change the user's password on its - behalf. This has enormous benefits - as follows.

    This module requires libxml2 to be installed.

    To build pdb_xml, run: smbpasswd now has the capability - to change passwords on Windows NT servers (this only works when - the request is sent to the NT Primary Domain Controller if you - are changing an NT Domain user's password).

    To run smbpasswd as a normal user just type :

    $ smbpasswd

    Old SMB password: <type old value here - - or hit return if there was no old password>

    New SMB Password: <type new value> -

    Repeat New SMB Password: <re-type new value -

    If the old value does not match the current value stored for - that user, or the two new values do not match each other, then the - password will not be changed.

    If invoked by an ordinary user it will only allow the user - to change his or her own Samba password.

    If run by the root user smbpasswd may take an optional - argument, specifying the user name whose SMB password you wish to - change. Note that when run as root smbpasswd does not prompt for - or check the old password value, thus allowing root to set passwords - for users who have forgotten their passwords.

    make bin/pdb_xml.so in +the directory source/.


    3.8.2. Usage

    smbpasswd is designed to work in the same way - and be familiar to UNIX users who use the passwd or - The usage of pdb_xml is pretty straightforward. To export data, use: + +yppasswd commands.

    pdbedit -e plugin:/usr/lib/samba/pdb_xml.so:filename + +(where filename is the name of the file to put the data in)

    For more details on using To import data, use: +smbpasswd refer - to the man page which will always be the definitive reference.

    pdbedit -i plugin:/usr/lib/samba/pdb_xml.so:filename -e current-pdb + +Where filename is the name to read the data from and current-pdb to put it in.

    Introduction

    This part contains information on using samba in a (NT 4 or ADS) domain. -If you wish to run samba as a domain member or DC, read the appropriate chapter in -this part.

    Samba can operate in various SMB networks. This part contains information on configuring samba +for various environments.

    Table of Contents
    6. 4. User and Share security level (for servers not in a domain)
    5. How to Configure Samba as a NT4 Primary Domain ControllerSamba as a NT4 or Win2k Primary Domain Controller
    6.1. 5.1. Prerequisite Reading
    6.2. 5.2. Background
    6.3. 5.3. Configuring the Samba Domain Controller
    6.4. 5.4. Creating Machine Trust Accounts and Joining Clients to the Domain
    6.4.1. 5.4.1. Manual Creation of Machine Trust Accounts
    6.4.2. 5.4.2. "On-the-Fly" Creation of Machine Trust Accounts
    6.4.3. 5.4.3. Joining the Client to the Domain
    6.5. 5.5. Common Problems and Errors
    6.6. 5.6. System Policies and Profiles
    6.7. 5.7. What other help can I get?
    6.8. 5.8. Domain Control for Windows 9x/ME
    6.8.1. 5.8.1. Configuration Instructions: Network Logons
    6.8.2. 5.8.2. Configuration Instructions: Setting up Roaming User Profiles
    6.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba5.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba
    7. 6. How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain
    7.1. 6.1. Prerequisite Reading
    7.2. 6.2. Background
    7.3. 6.3. What qualifies a Domain Controller on the network?
    7.3.1. 6.3.1. How does a Workstation find its domain controller?
    7.3.2. 6.3.2. When is the PDC needed?
    7.4. Can Samba be a Backup Domain Controller?6.4. Can Samba be a Backup Domain Controller to an NT PDC?
    7.5. 6.5. How do I set up a Samba BDC?
    7.5.1. 6.5.1. How do I replicate the smbpasswd file?
    6.5.2. Can I do this all with LDAP?
    8. 7. Samba as a ADS domain member
    8.1. 7.1. Installing the required packages for Debian
    8.2. 7.2. Installing the required packages for RedHat
    8.3. 7.3. Compile Samba
    8.4. 7.4. Setup your /etc/krb5.conf
    8.5. 7.5. Create the computer account
    8.5.1. 7.5.1. Possible errors
    8.6. 7.6. Test your server setup
    8.7. 7.7. Testing with smbclient
    8.8. 7.8. Notes
    9. 8. Samba as a NT4 domain memberSamba as a NT4 or Win2k domain member
    9.1. Joining an NT Domain with Samba 2.28.1. Joining an NT Domain with Samba 3.0
    9.2. 8.2. Samba and Windows 2000 Domains
    9.3. 8.3. Why is this better than security = server?

    Chapter 4. User and Share security level (for servers not in a domain)

    A SMB server tells the client at startup what "security level" it is +running. There are two options "share level" and "user level". Which +of these two the client receives affects the way the client then tries +to authenticate itself. It does not directly affect (to any great +extent) the way the Samba server does security. I know this is +strange, but it fits in with the client/server approach of SMB. In SMB +everything is initiated and controlled by the client, and the server +can only tell the client what is available and whether an action is +allowed.

    I'll describe user level security first, as its simpler. In user level +security the client will send a "session setup" command directly after +the protocol negotiation. This contains a username and password. The +server can either accept or reject that username/password +combination. Note that at this stage the server has no idea what +share the client will eventually try to connect to, so it can't base +the "accept/reject" on anything other than:

    1. the username/password

    2. the machine that the client is coming from

    If the server accepts the username/password then the client expects to +be able to mount any share (using a "tree connection") without +specifying a password. It expects that all access rights will be as +the username/password specified in the "session setup".

    It is also possible for a client to send multiple "session setup" +requests. When the server responds it gives the client a "uid" to use +as an authentication tag for that username/password. The client can +maintain multiple authentication contexts in this way (WinDD is an +example of an application that does this)

    Ok, now for share level security. In share level security the client +authenticates itself separately for each share. It will send a +password along with each "tree connection" (share mount). It does not +explicitly send a username with this operation. The client is +expecting a password to be associated with each share, independent of +the user. This means that samba has to work out what username the +client probably wants to use. It is never explicitly sent the +username. Some commercial SMB servers such as NT actually associate +passwords directly with shares in share level security, but samba +always uses the unix authentication scheme where it is a +username/password that is authenticated, not a "share/password".

    Many clients send a "session setup" even if the server is in share +level security. They normally send a valid username but no +password. Samba records this username in a list of "possible +usernames". When the client then does a "tree connection" it also adds +to this list the name of the share they try to connect to (useful for +home directories) and any users listed in the "user =" smb.conf +line. The password is then checked in turn against these "possible +usernames". If a match is found then the client is authenticated as +that user.

    Finally "server level" security. In server level security the samba +server reports to the client that it is in user level security. The +client then does a "session setup" as described earlier. The samba +server takes the username/password that the client sends and attempts +to login to the "password server" by sending exactly the same +username/password that it got from the client. If that server is in +user level security and accepts the password then samba accepts the +clients connection. This allows the samba server to use another SMB +server as the "password server".

    You should also note that at the very start of all this, where the +server tells the client what security level it is in, it also tells +the client if it supports encryption. If it does then it supplies the +client with a random "cryptkey". The client will then send all +passwords in encrypted form. You have to compile samba with encryption +enabled to support this feature, and you have to maintain a separate +smbpasswd file with SMB style encrypted passwords. It is +cryptographically impossible to translate from unix style encryption +to SMB style encryption, although there are some fairly simple management +schemes by which the two could be kept in sync.

    "security = server" means that Samba reports to clients that +it is running in "user mode" but actually passes off all authentication +requests to another "user mode" server. This requires an additional +parameter "password server =" that points to the real authentication server. +That real authentication server can be another Samba server or can be a +Windows NT server, the later natively capable of encrypted password support.


    Chapter 6. How to Configure Samba as a NT4 Primary Domain Controller

    Chapter 5. Samba as a NT4 or Win2k Primary Domain Controller

    6.1. Prerequisite Reading

    5.1. Prerequisite Reading

    Before you continue reading in this chapter, please make sure that you are comfortable with configuring basic files services @@ -3885,9 +4339,9 @@ CLASS="SECT1" >


    6.2. Background

    5.2. Background

    Note


    6.3. Configuring the Samba Domain Controller

    5.3. Configuring the Samba Domain Controller

    The first step in creating a working Samba PDC is to understand the parameters necessary in smb.conf. I will not @@ -4249,9 +4703,9 @@ CLASS="SECT1" >


    6.4. Creating Machine Trust Accounts and Joining Clients to the +>5.4. Creating Machine Trust Accounts and Joining Clients to the Domain

    A machine trust account is a Samba account that is used to @@ -4323,9 +4777,9 @@ CLASS="SECT2" >


    6.4.1. Manual Creation of Machine Trust Accounts

    5.4.1. Manual Creation of Machine Trust Accounts

    The first step in manually creating a machine trust account is to manually create the corresponding Unix account in @@ -4477,7 +4931,7 @@ WIDTH="25" ALIGN="CENTER" VALIGN="TOP" >Warning


    6.4.2. "On-the-Fly" Creation of Machine Trust Accounts

    5.4.2. "On-the-Fly" Creation of Machine Trust Accounts

    The second (and recommended) way of creating machine trust accounts is simply to allow the Samba server to create them as needed when the client @@ -4541,7 +4995,7 @@ be created manually.

    [global]
    -   # <...remainder of parameters...>
    +   # <...remainder of parameters...>
        add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u 


    6.4.3. Joining the Client to the Domain

    5.4.3. Joining the Client to the Domain

    The procedure for joining a client to the domain varies with the version of Windows.


    6.5. Common Problems and Errors

    5.5. Common Problems and Errors


    6.6. System Policies and Profiles

    5.6. System Policies and Profiles

    Much of the information necessary to implement System Policies and Roving User Profiles in a Samba domain is the same as that for @@ -5005,9 +5459,9 @@ CLASS="SECT1" >


    6.7. What other help can I get?

    5.7. What other help can I get?

    There are many sources of information available in the form of mailing lists, RFC's and documentation. The docs that come @@ -5425,9 +5879,9 @@ CLASS="SECT1" >


    6.8. Domain Control for Windows 9x/ME

    5.8. Domain Control for Windows 9x/ME

    Note

  • The client broadcasts (to the IP broadcast address of the subnet it is in) - a NetLogon request. This is sent to the NetBIOS name DOMAIN<1c> at the + a NetLogon request. This is sent to the NetBIOS name DOMAIN<1c> at the NetBIOS layer. The client chooses the first response it receives, which contains the NetBIOS name of the logon server to use in the format of \\SERVER. @@ -5559,9 +6013,9 @@ CLASS="SECT2" >


    6.8.1. Configuration Instructions: Network Logons

    5.8.1. Configuration Instructions: Network Logons

    The main difference between a PDC and a Windows 9x logon server configuration is that

    Warning

    6.8.2. Configuration Instructions: Setting up Roaming User Profiles

    5.8.2. Configuration Instructions: Setting up Roaming User Profiles

    Warning


    6.8.2.1. Windows NT Configuration

    5.8.2.1. Windows NT Configuration

    To support WinNT clients, in the [global] section of smb.conf set the following (for example):

    Note

    6.8.2.2. Windows 9X Configuration

    5.8.2.2. Windows 9X Configuration

    To support Win9X clients, you must use the "logon home" parameter. Samba has now been fixed so that "net use/home" now works as well, and it, too, relies @@ -5800,9 +6254,9 @@ CLASS="SECT3" >


    6.8.2.3. Win9X and WinNT Configuration

    5.8.2.3. Win9X and WinNT Configuration

    You can support profiles for both Win9X and WinNT clients by setting both the "logon home" and "logon path" parameters. For example:

    Note

    6.8.2.4. Windows 9X Profile Setup

    5.8.2.4. Windows 9X Profile Setup

    When a user first logs in on Windows 9X, the file user.DAT is created, as are folders "Start Menu", "Desktop", "Programs" and "Nethood". @@ -6005,9 +6459,9 @@ CLASS="SECT3" >


    6.8.2.5. Windows NT Workstation 4.0

    5.8.2.5. Windows NT Workstation 4.0

    When a user first logs in to a Windows NT Workstation, the profile NTuser.DAT is created. The profile location can be now specified @@ -6026,7 +6480,7 @@ WIDTH="25" ALIGN="CENTER" VALIGN="TOP" >NoteNote


    6.8.2.6. Windows NT Server

    5.8.2.6. Windows NT Server

    There is nothing to stop you specifying any path that you like for the location of users' profiles. Therefore, you could specify that the @@ -6133,9 +6587,9 @@ CLASS="SECT3" >


    6.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0

    5.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0

    WarningNote


    6.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba

    5.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba

    WarningChapter 7. How to Act as a Backup Domain Controller in a Purely Samba Controlled DomainChapter 6. How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain

    7.1. Prerequisite Reading

    6.1. Prerequisite Reading

    Before you continue reading in this chapter, please make sure that you are comfortable with configuring a Samba PDC @@ -6388,9 +6842,9 @@ CLASS="SECT1" >


    7.2. Background

    6.2. Background

    What is a Domain Controller? It is a machine that is able to answer logon requests from workstations in a Windows NT Domain. Whenever a @@ -6433,9 +6887,9 @@ CLASS="SECT1" >


    7.3. What qualifies a Domain Controller on the network?

    6.3. What qualifies a Domain Controller on the network?

    Every machine that is a Domain Controller for the domain SAMBA has to register the NetBIOS group name SAMBA#1c with the WINS server and/or @@ -6450,9 +6904,9 @@ CLASS="SECT2" >


    7.3.1. How does a Workstation find its domain controller?

    6.3.1. How does a Workstation find its domain controller?

    A NT workstation in the domain SAMBA that wants a local user to be authenticated has to find the domain controller for SAMBA. It does @@ -6469,9 +6923,9 @@ CLASS="SECT2" >


    7.3.2. When is the PDC needed?

    6.3.2. When is the PDC needed?

    Whenever a user wants to change his password, this has to be done on the PDC. To find the PDC, the workstation does a NetBIOS name query @@ -6485,15 +6939,19 @@ CLASS="SECT1" >


    7.4. Can Samba be a Backup Domain Controller?

    6.4. Can Samba be a Backup Domain Controller to an NT PDC?

    With version 2.2, no. The native NT SAM replication protocols have not yet been fully implemented. The Samba Team is working on understanding and implementing the protocols, but this work has not been finished for version 2.2.

    With version 3.0, the work on both the replication protocols and a +suitable storage mechanism has progressed, and some form of NT4 BDC +support is expected soon.

    Can I get the benefits of a BDC with Samba? Yes. The main reason for implementing a BDC is availability. If the PDC is a Samba machine, a second Samba machine can be set up to @@ -6504,9 +6962,9 @@ CLASS="SECT1" >


    7.5. How do I set up a Samba BDC?

    6.5. How do I set up a Samba BDC?

    Several things have to be done:


    7.5.1. How do I replicate the smbpasswd file?

    6.5.1. How do I replicate the smbpasswd file?

    Replication of the smbpasswd file is sensitive. It has to be done whenever changes to the SAM are made. Every user's password change is @@ -6587,6 +7045,21 @@ rsync. rsync can use ssh as a transport. ssh itself can be set up to accept *only* rsync transfer without requiring the user to type a password.


    6.5.2. Can I do this all with LDAP?

    The simple answer is YES. Samba's pdb_ldap code supports +binding to a replica LDAP server, and will also follow referrals and +rebind to the master if it ever needs to make a modification to the +database. (Normally BDCs are read only, so this will not occur +often).

    Chapter 8. Samba as a ADS domain memberChapter 7. Samba as a ADS domain member

    This is a rough guide to setting up Samba 3.0 with kerberos authentication against a +Windows2000 KDC.

    Pieces you need before you begin:

    This is a VERY ROUGH guide to setting up the current (November 2001) -pre-alpha version of Samba 3.0 with kerberos authentication against a -Windows2000 KDC. The procedures listed here are likely to change as -the code develops.

    Pieces you need before you begin: -


    8.1. Installing the required packages for Debian

    7.1. Installing the required packages for Debian

    On Debian you need to install the following packages:

    On Debian you need to install the following packages: -


    8.2. Installing the required packages for RedHat

    7.2. Installing the required packages for RedHat

    On RedHat this means you should have at least:

    On RedHat this means you should have at least: -


    8.3. Compile Samba

    7.3. Compile Samba

    If your kerberos libraries are in a non-standard location then remember to add the configure option --with-krb5=DIR.

    After you run configure make sure that include/config.h contains +>After you run configure make sure that include/config.h it + generates contains lines like this:

      realm = YOUR.KERBEROS.REALM
    -  ads server = your.kerberos.server
       security = ADS
       encrypt passwords = yes

    Strictly speaking, you can omit the realm name and you can use an IP - address for the ads server. In that case Samba will auto-detect these.

    In case samba can't figure out your ads server using your realm name, use the +ads server option in smb.conf: +
      ads server = your.kerberos.server

    You do *not* need a smbpasswd file, although it won't do any harm - and if you have one then Samba will be able to fall back to normal - password security for older clients. I expect that the above +>You do *not* need a smbpasswd file, and older clients will + be authenticated as if "security = domain", although it won't do any harm + and allows you to have local users not in the domain. + I expect that the above required options will change soon when we get better active directory integration.


    8.4. Setup your /etc/krb5.conf

    7.4. Setup your /etc/krb5.conf

    The minimal configuration for krb5.conf is:

    	[realms]
    +>[realms]
         YOUR.KERBEROS.REALM = {
     	kdc = your.kerberos.server
         }

    If all you want is kerberos support in smbclient then you can skip straight to step 5 now. Step 3 is only needed if you want kerberos -support in smbd.


    8.5. Create the computer account

    7.5. Create the computer account

    Do a "kinit" as a user that has authority to change arbitrary -passwords on the KDC ("Administrator" is a good choice). Then as a -user that has write permission on the Samba private directory +>As a user that has write permission on the Samba private directory (usually root) run:


    8.5.1. Possible errors

    7.5.1. Possible errors

    "bash: kinit: command not found"

    kinit is in the krb5-workstation RPM on RedHat systems, and is in /usr/kerberos/bin, so it won't be in the path until you log in again (or open a new terminal)

    "ADS support not compiled in"


    8.6. Test your server setup

    7.6. Test your server setup

    On a Windows 2000 client try


    8.7. Testing with smbclient

    7.7. Testing with smbclient

    On your Samba server try to login to a Win2000 server or your Samba server using smbclient and kerberos. Use smbclient as usual, but @@ -6866,9 +7343,9 @@ CLASS="SECT1" >


    8.8. Notes

    7.8. Notes

    You must change administrator password at least once after DC install, to create the right encoding types

    Chapter 9. Samba as a NT4 domain memberChapter 8. Samba as a NT4 or Win2k domain member

    9.1. Joining an NT Domain with Samba 2.2

    8.1. Joining an NT Domain with Samba 3.0

    Assume you have a Samba 2.x server with a NetBIOS name of +>Assume you have a Samba 3.0 server with a NetBIOS name of SERV1 and are joining an NT domain called +> and are joining an or Win2k NT domain called DOM.

    In order to join the domain, first stop all Samba daemons - and run the command:

    root# smbpasswd -j DOM -r DOMPDC - -UAdministrator%password

    as we are joining the domain DOM and the PDC for that domain - (the only machine that has write access to the domain SAM database) - is DOMPDC. The Administrator%password is - the login name and password for an account which has the necessary - privilege to add machines to the domain. If this is successful - you will see the message:

    smbpasswd: Joined domain DOM. -

    in your terminal window. See the smbpasswd(8) man page for more details.

    There is existing development code to join a domain - without having to create the machine trust account on the PDC - beforehand. This code will hopefully be available soon - in release branches as well.

    This command goes through the machine account password - change protocol, then writes the new (random) machine account - password for this Samba server into a file in the same directory - in which an smbpasswd file would be stored - normally :

    /usr/local/samba/private

    In Samba 2.0.x, the filename looks like this:

    <NT DOMAIN NAME>.<Samba - Server Name>.mac

    The .mac suffix stands for machine account - password file. So in our example above, the file would be called:

    DOM.SERV1.mac

    In Samba 2.2, this file has been replaced with a TDB - (Trivial Database) file named secrets.tdb. -

    This file is created and owned by root and is not - readable by any other user. It is the key to the domain-level - security for your system, and should be treated as carefully - as a shadow password file.

    Now, before restarting the Samba daemons you must - edit your Firstly, you must edit your security = domain

    or + security = ads depending on if the PDC is + NT4 or running Active Directory respectivly.

    Next change the line in the [global] section to read:

    password server = DOMPDC DOMBDC1 DOMBDC2

    password server = DOMPDC DOMBDC1 DOMBDC2

    These are the primary and backup domain controllers Samba + will attempt to contact in order to authenticate users. Samba will + try to contact each of these servers in order, so you may want to + rearrange this list in order to spread out the authentication load + among domain controllers.

    Alternatively, if you want smbd to automatically determine + the list of Domain controllers to use for authentication, you may + set this line to be :

    password server = *

    This method, allows Samba to use exactly the same + mechanism that NT does. This + method either broadcasts or uses a WINS database in order to + find domain controllers to authenticate against.

    In order to actually join the domain, you must run this + command:

    root# net join -S DOMPDC + -UAdministrator%password

    as we are joining the domain DOM and the PDC for that domain + (the only machine that has write access to the domain SAM database) + is DOMPDC. The Administrator%password is + the login name and password for an account which has the necessary + privilege to add machines to the domain. If this is successful + you will see the message:

    Joined domain DOM. + or Joined 'SERV1' to realm 'MYREALM' +

    in your terminal window. See the net(8) man page for more details.

    These are the primary and backup domain controllers Samba - will attempt to contact in order to authenticate users. Samba will - try to contact each of these servers in order, so you may want to - rearrange this list in order to spread out the authentication load - among domain controllers.

    This process joins the server to thedomain + without having to create the machine trust account on the PDC + beforehand.

    Alternatively, if you want smbd to automatically determine - the list of Domain controllers to use for authentication, you may - set this line to be :

    This command goes through the machine account password + change protocol, then writes the new (random) machine account + password for this Samba server into a file in the same directory + in which an smbpasswd file would be stored - normally :

    password server = */usr/local/samba/private/secrets.tdb

    This method, which was introduced in Samba 2.0.6, - allows Samba to use exactly the same mechanism that NT does. This - method either broadcasts or uses a WINS database in order to - find domain controllers to authenticate against.

    This file is created and owned by root and is not + readable by any other user. It is the key to the domain-level + security for your system, and should be treated as carefully + as a shadow password file.

    Finally, restart your Samba daemons and get ready for clients to begin using domain security!


    9.2. Samba and Windows 2000 Domains

    8.2. Samba and Windows 2000 Domains

    Many people have asked regarding the state of Samba's ability to participate in a Windows 2000 Domain. Samba 3.0 is able to act as a member server of a Windows -2000 domain operating in mixed or native mode.

    There is much confusion between the circumstances that require a "mixed" mode -Win2k DC and a when this host can be switched to "native" mode. A "mixed" mode -Win2k domain controller is only needed if Windows NT BDCs must exist in the same -domain. By default, a Win2k DC in "native" mode will still support -NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and -NT 4.0. Samba has the same requirements as a Windows NT 4.0 member server.

    The steps for adding a Samba 2.2 host to a Win2k domain are the same as those -for adding a Samba server to a Windows NT 4.0 domain. The only exception is that -the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and -Computers" MMC (Microsoft Management Console) plugin.


    9.3. Why is this better than security = server?

    8.3. Why is this better than security = server?

    Currently, domain security in Samba doesn't free you from having to create local Unix users to represent the users attaching @@ -7203,13 +7640,7 @@ CLASS="COMMAND" >And finally, acting in the same manner as an NT server authenticating to a PDC means that as part of the authentication reply, the Samba server gets the user identification information such - as the user SID, the list of NT groups the user belongs to, etc. All - this information will allow Samba to be extended in the future into - a mode the developers currently call appliance mode. In this mode, - no local Unix users will be necessary, and Samba will generate Unix - uids and gids from the information passed back from the PDC when a - user is authenticated, making a Samba server truly plug and play - in an NT domain environment. Watch for this code soon.

    Introduction

    Table of Contents
    10. 9. Integrating MS Windows networks with Samba
    10.1. 9.1. Agenda
    10.2. 9.2. Name Resolution in a pure Unix/Linux world
    10.2.1. 9.2.1. /etc/hosts
    10.2.2. 9.2.2. /etc/resolv.conf
    10.2.3. 9.2.3. /etc/host.conf
    10.2.4. 9.2.4. /etc/nsswitch.conf
    10.3. 9.3. Name resolution as used within MS Windows networking
    10.3.1. 9.3.1. The NetBIOS Name Cache
    10.3.2. 9.3.2. The LMHOSTS file
    10.3.3. 9.3.3. HOSTS file
    10.3.4. 9.3.4. DNS Lookup
    10.3.5. 9.3.5. WINS Lookup
    10.4. 9.4. How browsing functions and how to deploy stable and dependable browsing using Samba
    10.5. 9.5. MS Windows security options and how to configure Samba for seemless integration
    10.5.1. 9.5.1. Use MS Windows NT as an authentication server
    10.5.2. 9.5.2. Make Samba a member of an MS Windows NT security domain
    10.5.3. 9.5.3. Configure Samba as an authentication server
    10.6. 9.6. Conclusions
    11. 10. UNIX Permission Bits and Windows NT Access Control Lists
    11.1. 10.1. Viewing and changing UNIX permissions using the NT security dialogs
    11.2. 10.2. How to view file security on a Samba share
    11.3. 10.3. Viewing file ownership
    11.4. 10.4. Viewing file or directory permissions
    11.4.1. 10.4.1. File Permissions
    11.4.2. 10.4.2. Directory Permissions
    11.5. 10.5. Modifying file or directory permissions
    11.6. 10.6. Interaction with the standard Samba create mask parameters
    11.7. 10.7. Interaction with the standard Samba file attribute mapping
    12. 11. Configuring PAM for distributed but centrally managed authentication
    12.1. 11.1. Samba and PAM
    12.2. 11.2. Distributed Authentication
    12.3. 11.3. PAM Configuration in smb.conf
    13. 12. Hosting a Microsoft Distributed File System tree on Samba
    13.1. 12.1. Instructions
    13.1.1. 12.1.1. Notes
    14. 13. Printing Support
    14.1. 13.1. Introduction
    14.2. 13.2. Configuration
    14.2.1. 13.2.1. Creating [print$]
    14.2.2. 13.2.2. Setting Drivers for Existing Printers
    14.2.3. 13.2.3. Support a large number of printers
    14.2.4. 13.2.4. Adding New Printers via the Windows NT APW
    14.2.5. 13.2.5. Samba and Printer Ports
    14.3. 13.3. The Imprints Toolset
    14.3.1. 13.3.1. What is Imprints?
    14.3.2. 13.3.2. Creating Printer Driver Packages
    14.3.3. 13.3.3. The Imprints server
    14.3.4. 13.3.4. The Installation Client
    14.4. 13.4. Diagnosis
    14.4.1. 13.4.1. Introduction
    14.4.2. 13.4.2. Debugging printer problems
    14.4.3. 13.4.3. What printers do I have?
    14.4.4. 13.4.4. Setting up printcap and print servers
    14.4.5. 13.4.5. Job sent, no output
    14.4.6. 13.4.6. Job sent, strange output
    14.4.7. 13.4.7. Raw PostScript printed
    14.4.8. 13.4.8. Advanced Printing
    14.4.9. 13.4.9. Real debugging
    15. Security levels
    15.1. Introduction
    15.2. More complete description of security levels
    16. 14. Unified Logons between Windows NT and UNIX using Winbind
    16.1. 14.1. Abstract
    16.2. 14.2. Introduction
    16.3. 14.3. What Winbind Provides
    16.3.1. 14.3.1. Target Uses
    16.4. 14.4. How Winbind Works
    16.4.1. 14.4.1. Microsoft Remote Procedure Calls
    16.4.2. 14.4.2. Microsoft Active Directory Services
    14.4.3. Name Service Switch
    16.4.3. 14.4.4. Pluggable Authentication Modules
    16.4.4. 14.4.5. User and Group ID Allocation
    16.4.5. 14.4.6. Result Caching
    16.5. 14.5. Installation and Configuration
    16.5.1. 14.5.1. Introduction
    16.5.2. 14.5.2. Requirements
    16.5.3. 14.5.3. Testing Things Out
    16.6. 14.6. Limitations
    16.7. 14.7. Conclusion
    17. Passdb MySQL plugin15. Improved browsing in samba
    17.1. Building
    17.2. Configuring15.1. Overview of browsing
    17.3. Using plaintext passwords or encrypted password15.2. Browsing support in samba
    17.4. Getting non-column data from the table15.3. Problem resolution
    18. Passdb XML plugin15.4. Browsing across subnets
    18.1. Building
    18.2. Usage15.4.1. How does cross subnet browsing work ?
    19. Storing Samba's User/Machine Account information in an LDAP Directory15.5. Setting up a WINS server
    19.1. Purpose15.6. Setting up Browsing in a WORKGROUP
    19.2. Introduction15.7. Setting up Browsing in a DOMAIN
    19.3. Supported LDAP Servers15.8. Forcing samba to be the master
    19.4. Schema and Relationship to the RFC 2307 posixAccount15.9. Making samba the domain master
    19.5. Configuring Samba with LDAP15.10. Note about broadcast addresses
    15.11. Multiple interfaces
    16. Stackable VFS modules
    19.5.1. OpenLDAP configuration16.1. Introduction and configuration
    19.5.2. Configuring Samba16.2. Included modules
    19.6. Accounts and Groups management16.2.1. audit
    19.7. Security and sambaAccount16.2.2. recycle
    19.8. LDAP specials attributes for sambaAccounts16.2.3. netatalk
    19.9. Example LDIF Entries for a sambaAccount16.3. VFS modules available elsewhere
    19.10. Comments16.3.1. DatabaseFS
    16.3.2. vscan
    20. 17. HOWTO Access Samba source code via CVSAccess Samba source code via CVS
    20.1. 17.1. Introduction
    20.2. 17.2. CVS Access to samba.org
    20.2.1. 17.2.1. Access via CVSweb
    20.2.2. 17.2.2. Access via cvs
    21. 18. Group mapping HOWTO
    22. 19. Samba performance issues
    22.1. 19.1. Comparisons
    22.2. Oplocks
    22.2.1. Overview
    22.2.2. Level2 Oplocks19.2. Socket options
    22.2.3. Old 'fake oplocks' option - deprecated19.3. Read size
    22.3. Socket options19.4. Max xmit
    22.4. Read size19.5. Log level
    22.5. Max xmit19.6. Read raw
    22.6. Locking19.7. Write raw
    22.7. Share modes19.8. Slow Clients
    22.8. Log level19.9. Slow Logins
    22.9. Wide lines19.10. Client tuning
    22.10. Read raw20. Creating Group Profiles
    22.11. Write raw20.1. Windows '9x
    22.12. Read prediction20.2. Windows NT 4
    22.13. Memory mapping20.2.1. Side bar Notes
    22.14. Slow Clients20.2.2. Mandatory profiles
    22.15. Slow Logins20.2.3. moveuser.exe
    22.16. Client tuning20.2.4. Get SID
    22.17. My Results20.3. Windows 2000/XP
    Chapter 10. Integrating MS Windows networks with SambaChapter 9. Integrating MS Windows networks with Samba

    10.1. Agenda

    9.1. Agenda

    To identify the key functional mechanisms of MS Windows networking to enable the deployment of Samba as a means of extending and/or @@ -8099,9 +8519,9 @@ CLASS="SECT1" >


    10.2. Name Resolution in a pure Unix/Linux world

    9.2. Name Resolution in a pure Unix/Linux world

    The key configuration files covered in this section are:


    10.2.1. 9.2.1. /etc/hosts


    10.2.2. 9.2.2. /etc/resolv.conf


    10.2.3. 9.2.3. /etc/host.conf


    10.2.4. 9.2.4. /etc/nsswitch.conf


    10.3. Name resolution as used within MS Windows networking

    9.3. Name resolution as used within MS Windows networking

    MS Windows networking is predicated about the name each machine is given. This name is known variously (and inconsistently) as @@ -8380,16 +8800,16 @@ the client/server.

    	Unique NetBIOS Names:
    -		MACHINENAME<00>	= Server Service is running on MACHINENAME
    -		MACHINENAME<03> = Generic Machine Name (NetBIOS name)
    -		MACHINENAME<20> = LanMan Server service is running on MACHINENAME
    -		WORKGROUP<1b> = Domain Master Browser
    +		MACHINENAME<00>	= Server Service is running on MACHINENAME
    +		MACHINENAME<03> = Generic Machine Name (NetBIOS name)
    +		MACHINENAME<20> = LanMan Server service is running on MACHINENAME
    +		WORKGROUP<1b> = Domain Master Browser
     
     	Group Names:
    -		WORKGROUP<03> = Generic Name registered by all members of WORKGROUP
    -		WORKGROUP<1c> = Domain Controllers / Netlogon Servers
    -		WORKGROUP<1d> = Local Master Browsers
    -		WORKGROUP<1e> = Internet Name Resolvers

    It should be noted that all NetBIOS machines register their own @@ -8408,7 +8828,7 @@ be needed. An example of this is what happens when an MS Windows client wants to locate a domain logon server. It find this service and the IP address of a server that provides it by performing a lookup (via a NetBIOS broadcast) for enumeration of all machines that have -registered the name type *<1c>. A logon request is then sent to each +registered the name type *<1c>. A logon request is then sent to each IP address that is returned in the enumerated list of IP addresses. Which ever machine first replies then ends up providing the logon services.


    10.3.1. The NetBIOS Name Cache

    9.3.1. The NetBIOS Name Cache

    All MS Windows machines employ an in memory buffer in which is stored the NetBIOS names and IP addresses for all external @@ -8470,9 +8890,9 @@ CLASS="SECT2" >


    10.3.2. The LMHOSTS file

    9.3.2. The LMHOSTS file

    This file is usually located in MS Windows NT 4.0 or 2000 in


    10.3.3. HOSTS file

    9.3.3. HOSTS file

    This file is usually located in MS Windows NT 4.0 or 2000 in


    10.3.4. DNS Lookup

    9.3.4. DNS Lookup

    This capability is configured in the TCP/IP setup area in the network configuration facility. If enabled an elaborate name resolution sequence @@ -8615,9 +9035,9 @@ CLASS="SECT2" >


    10.3.5. WINS Lookup

    9.3.5. WINS Lookup

    A WINS (Windows Internet Name Server) service is the equivaent of the rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores @@ -8658,9 +9078,9 @@ CLASS="SECT1" >


    10.4. How browsing functions and how to deploy stable and +>9.4. How browsing functions and how to deploy stable and dependable browsing using Samba

    As stated above, MS Windows machines register their NetBIOS names @@ -8725,9 +9145,9 @@ CLASS="SECT1" >


    10.5. MS Windows security options and how to configure +>9.5. MS Windows security options and how to configure Samba for seemless integration

    MS Windows clients may use encrypted passwords as part of a @@ -8862,9 +9282,9 @@ CLASS="SECT2" >


    10.5.1. Use MS Windows NT as an authentication server

    9.5.1. Use MS Windows NT as an authentication server

    This method involves the additions of the following parameters in the smb.conf file:


    10.5.2. Make Samba a member of an MS Windows NT security domain

    9.5.2. Make Samba a member of an MS Windows NT security domain

    This method involves additon of the following paramters in the smb.conf file:


    10.5.3. Configure Samba as an authentication server

    9.5.3. Configure Samba as an authentication server

    This mode of authentication demands that there be on the Unix/Linux system both a Unix style account as well as an @@ -8998,9 +9418,9 @@ CLASS="SECT3" >


    10.5.3.1. Users

    9.5.3.1. Users

    A user account that may provide a home directory should be created. The following Linux system commands are typical of @@ -9021,9 +9441,9 @@ CLASS="SECT3" >


    10.5.3.2. MS Windows NT Machine Accounts

    9.5.3.2. MS Windows NT Machine Accounts

    These are required only when Samba is used as a domain controller. Refer to the Samba-PDC-HOWTO for more details.


    10.6. Conclusions

    9.6. Conclusions

    Samba provides a flexible means to operate as...

    Chapter 11. UNIX Permission Bits and Windows NT Access Control ListsChapter 10. UNIX Permission Bits and Windows NT Access Control Lists

    11.1. Viewing and changing UNIX permissions using the NT +>10.1. Viewing and changing UNIX permissions using the NT security dialogs

    New in the Samba 2.0.4 release is the ability for Windows @@ -9099,35 +9519,15 @@ NAME="AEN1593" the security of the UNIX host Samba is running on, and still obeys all the file permission rules that a Samba administrator can set.

    In Samba 2.0.4 and above the default value of the - parameter nt acl support has been changed from - false to true, so - manipulation of permissions is turned on by default.


    11.2. How to view file security on a Samba share

    10.2. How to view file security on a Samba share

    From an NT 4.0 client, single-click with the right mouse button on any file or directory in a Samba mounted @@ -9195,9 +9595,9 @@ CLASS="SECT1" >


    11.3. Viewing file ownership

    10.3. Viewing file ownership

    Clicking on the


    11.4. Viewing file or directory permissions

    10.4. Viewing file or directory permissions

    The third button is the


    11.4.1. File Permissions

    10.4.1. File Permissions

    The standard UNIX user/group/world triple and the corresponding "read", "write", "execute" permissions @@ -9413,9 +9813,9 @@ CLASS="SECT2" >


    11.4.2. Directory Permissions

    10.4.2. Directory Permissions

    Directories on an NT NTFS file system have two different sets of permissions. The first set of permissions @@ -9445,9 +9845,9 @@ CLASS="SECT1" >


    11.5. Modifying file or directory permissions

    10.5. Modifying file or directory permissions

    Modifying file and directory permissions is as simple as changing the displayed permissions in the dialog box, and @@ -9543,9 +9943,9 @@ CLASS="SECT1" >


    11.6. Interaction with the standard Samba create mask +>10.6. Interaction with the standard Samba create mask parameters

    Note that with Samba 2.0.5 there are four new parameters @@ -9820,9 +10220,9 @@ CLASS="SECT1" >


    11.7. Interaction with the standard Samba file attribute +>10.7. Interaction with the standard Samba file attribute mapping

    Samba maps some of the DOS attribute bits (such as "read @@ -9869,16 +10269,16 @@ CLASS="CHAPTER" >Chapter 12. Configuring PAM for distributed but centrally +>Chapter 11. Configuring PAM for distributed but centrally managed authentication

    12.1. Samba and PAM

    11.1. Samba and PAM

    A number of Unix systems (eg: Sun Solaris), as well as the xxxxBSD family and Linux, now utilize the Pluggable Authentication @@ -10090,9 +10490,9 @@ CLASS="SECT1" >


    12.2. Distributed Authentication

    11.2. Distributed Authentication

    The astute administrator will realize from this that the combination of


    12.3. PAM Configuration in smb.conf

    11.3. PAM Configuration in smb.conf

    There is an option in smb.conf called Chapter 13. Hosting a Microsoft Distributed File System tree on SambaChapter 12. Hosting a Microsoft Distributed File System tree on Samba

    13.1. Instructions

    12.1. Instructions

    The Distributed File System (or Dfs) provides a means of separating the logical view of files and directories that users @@ -10319,9 +10719,9 @@ CLASS="SECT2" >


    13.1.1. Notes

    12.1.1. Notes

      Chapter 14. Printing SupportChapter 13. Printing Support

      14.1. Introduction

      13.1. Introduction

      Beginning with the 2.2.0 release, Samba supports the native Windows NT printing mechanisms implemented via @@ -10443,9 +10843,9 @@ CLASS="SECT1" >


      14.2. Configuration

      13.2. Configuration

      Warning


    14.2.1. Creating [print$]

    13.2.1. Creating [print$]

    In order to support the uploading of printer driver files, you must first configure a file share named [print$]. @@ -10590,7 +10990,7 @@ WIDTH="25" ALIGN="CENTER" VALIGN="TOP" >Note

    Warning

    14.2.2. Setting Drivers for Existing Printers

    13.2.2. Setting Drivers for Existing Printers

    The initial listing of printers in the Samba host's Printers folder will have no real printer driver assigned @@ -10804,9 +11204,9 @@ CLASS="SECT2" >


    14.2.3. Support a large number of printers

    13.2.3. Support a large number of printers

    One issue that has arisen during the development phase of Samba 2.2 is the need to support driver downloads for @@ -10870,9 +11270,9 @@ CLASS="SECT2" >


    14.2.4. Adding New Printers via the Windows NT APW

    13.2.4. Adding New Printers via the Windows NT APW

    By default, Samba offers all printer shares defined in


    14.2.5. Samba and Printer Ports

    13.2.5. Samba and Printer Ports

    Windows NT/2000 print servers associate a port with each printer. These normally take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the @@ -11076,9 +11476,9 @@ CLASS="SECT1" >


    14.3. The Imprints Toolset

    13.3. The Imprints Toolset

    The Imprints tool set provides a UNIX equivalent of the Windows NT Add Printer Wizard. For complete information, please @@ -11094,9 +11494,9 @@ CLASS="SECT2" >


    14.3.1. What is Imprints?

    13.3.1. What is Imprints?

    Imprints is a collection of tools for supporting the goals of


    14.3.2. Creating Printer Driver Packages

    13.3.2. Creating Printer Driver Packages

    The process of creating printer driver packages is beyond the scope of this document (refer to Imprints.txt also included @@ -11142,9 +11542,9 @@ CLASS="SECT2" >


    14.3.3. The Imprints server

    13.3.3. The Imprints server

    The Imprints server is really a database server that may be queried via standard HTTP mechanisms. Each printer @@ -11166,9 +11566,9 @@ CLASS="SECT2" >


    14.3.4. The Installation Client

    13.3.4. The Installation Client

    More information regarding the Imprints installation client is available in the


    14.4. Diagnosis

    13.4. Diagnosis

    14.4.1. Introduction

    13.4.1. Introduction

    This is a short description of how to debug printing problems with Samba. This describes how to debug problems with printing from a SMB @@ -11343,9 +11743,9 @@ CLASS="SECT2" >


    14.4.2. Debugging printer problems

    13.4.2. Debugging printer problems

    One way to debug printing problems is to start by replacing these command with shell scripts that record the arguments and the contents @@ -11361,7 +11761,7 @@ CLASS="PROGRAMLISTING" /usr/bin/id -p >/tmp/tmp.print # we run the command and save the error messages # replace the command with the one appropriate for your system - /usr/bin/lpr -r -P$1 $2 2>>&/tmp/tmp.print

    Then you print a file and try removing it. You may find that the @@ -11400,9 +11800,9 @@ CLASS="SECT2" >


    14.4.3. What printers do I have?

    13.4.3. What printers do I have?

    You can use the 'testprns' program to check to see if the printer name you are using is recognized by Samba. For example, you can @@ -11429,9 +11829,9 @@ CLASS="SECT2" >


    14.4.4. Setting up printcap and print servers

    13.4.4. Setting up printcap and print servers

    You may need to set up some printcaps for your Samba system to use. It is strongly recommended that you use the facilities provided by @@ -11513,9 +11913,9 @@ CLASS="SECT2" >


    14.4.5. Job sent, no output

    13.4.5. Job sent, no output

    This is the most frustrating part of printing. You may have sent the job, verified that the job was forwarded, set up a wrapper around @@ -11558,9 +11958,9 @@ CLASS="SECT2" >


    14.4.6. Job sent, strange output

    13.4.6. Job sent, strange output

    Once you have the job printing, you can then start worrying about making it print nicely.


    14.4.7. Raw PostScript printed

    13.4.7. Raw PostScript printed

    This is a problem that is usually caused by either the print spooling system putting information at the start of the print job that makes @@ -11619,9 +12019,9 @@ CLASS="SECT2" >


    14.4.8. Advanced Printing

    13.4.8. Advanced Printing

    Note that you can do some pretty magic things by using your imagination with the "print command" option and some shell scripts. @@ -11635,9 +12035,9 @@ CLASS="SECT2" >


    14.4.9. Real debugging

    13.4.9. Real debugging

    If the above debug tips don't help, then maybe you need to bring in the bug guns, system tracing. See Tracing.txt in this directory.


    Chapter 15. Security levels

    15.1. Introduction

    Samba supports the following options to the global smb.conf parameter

    [global]
    -security = [share|user(default)|server|domain|ads]

    Please refer to the smb.conf man page for usage information and to the document -DOMAIN_MEMBER.html for further background details -on domain mode security. The Windows 2000 Kerberos domain security model -(security = ads) is described in the ADS-HOWTO.html.

    Of the above, "security = server" means that Samba reports to clients that -it is running in "user mode" but actually passes off all authentication -requests to another "user mode" server. This requires an additional -parameter "password server =" that points to the real authentication server. -That real authentication server can be another Samba server or can be a -Windows NT server, the later natively capable of encrypted password support.


    15.2. More complete description of security levels

    A SMB server tells the client at startup what "security level" it is -running. There are two options "share level" and "user level". Which -of these two the client receives affects the way the client then tries -to authenticate itself. It does not directly affect (to any great -extent) the way the Samba server does security. I know this is -strange, but it fits in with the client/server approach of SMB. In SMB -everything is initiated and controlled by the client, and the server -can only tell the client what is available and whether an action is -allowed.

    I'll describe user level security first, as its simpler. In user level -security the client will send a "session setup" command directly after -the protocol negotiation. This contains a username and password. The -server can either accept or reject that username/password -combination. Note that at this stage the server has no idea what -share the client will eventually try to connect to, so it can't base -the "accept/reject" on anything other than:

    1. the username/password

    2. the machine that the client is coming from

    If the server accepts the username/password then the client expects to -be able to mount any share (using a "tree connection") without -specifying a password. It expects that all access rights will be as -the username/password specified in the "session setup".

    It is also possible for a client to send multiple "session setup" -requests. When the server responds it gives the client a "uid" to use -as an authentication tag for that username/password. The client can -maintain multiple authentication contexts in this way (WinDD is an -example of an application that does this)

    Ok, now for share level security. In share level security the client -authenticates itself separately for each share. It will send a -password along with each "tree connection" (share mount). It does not -explicitly send a username with this operation. The client is -expecting a password to be associated with each share, independent of -the user. This means that samba has to work out what username the -client probably wants to use. It is never explicitly sent the -username. Some commercial SMB servers such as NT actually associate -passwords directly with shares in share level security, but samba -always uses the unix authentication scheme where it is a -username/password that is authenticated, not a "share/password".

    Many clients send a "session setup" even if the server is in share -level security. They normally send a valid username but no -password. Samba records this username in a list of "possible -usernames". When the client then does a "tree connection" it also adds -to this list the name of the share they try to connect to (useful for -home directories) and any users listed in the "user =" smb.conf -line. The password is then checked in turn against these "possible -usernames". If a match is found then the client is authenticated as -that user.

    Finally "server level" security. In server level security the samba -server reports to the client that it is in user level security. The -client then does a "session setup" as described earlier. The samba -server takes the username/password that the client sends and attempts -to login to the "password server" by sending exactly the same -username/password that it got from the client. If that server is in -user level security and accepts the password then samba accepts the -clients connection. This allows the samba server to use another SMB -server as the "password server".

    You should also note that at the very start of all this, where the -server tells the client what security level it is in, it also tells -the client if it supports encryption. If it does then it supplies the -client with a random "cryptkey". The client will then send all -passwords in encrypted form. You have to compile samba with encryption -enabled to support this feature, and you have to maintain a separate -smbpasswd file with SMB style encrypted passwords. It is -cryptographically impossible to translate from unix style encryption -to SMB style encryption, although there are some fairly simple management -schemes by which the two could be kept in sync.


    Chapter 16. Unified Logons between Windows NT and UNIX using Winbind

    Chapter 14. Unified Logons between Windows NT and UNIX using Winbind

    16.1. Abstract

    14.1. Abstract

    Integration of UNIX and Microsoft Windows NT through a unified logon has been considered a "holy grail" in heterogeneous @@ -11831,9 +12083,9 @@ CLASS="SECT1" >


    16.2. Introduction

    14.2. Introduction

    It is well known that UNIX and Microsoft Windows NT have different models for representing user and group information and @@ -11885,9 +12137,9 @@ CLASS="SECT1" >


    16.3. What Winbind Provides

    14.3. What Winbind Provides

    Winbind unifies UNIX and Windows NT account management by allowing a UNIX box to become a full member of a NT domain. Once @@ -11927,9 +12179,9 @@ CLASS="SECT2" >


    16.3.1. Target Uses

    14.3.1. Target Uses

    Winbind is targeted at organizations that have an existing NT based domain infrastructure into which they wish @@ -11951,9 +12203,9 @@ CLASS="SECT1" >


    16.4. How Winbind Works

    14.4. How Winbind Works

    The winbind system is designed around a client/server architecture. A long running


    16.4.1. Microsoft Remote Procedure Calls

    14.4.1. Microsoft Remote Procedure Calls

    Over the last two years, efforts have been underway +>Over the last few years, efforts have been underway by various Samba Team members to decode various aspects of the Microsoft Remote Procedure Call (MSRPC) system. This system is used for most network related operations between @@ -11997,9 +12249,28 @@ CLASS="SECT2" >


    14.4.2. Microsoft Active Directory Services

    Since late 2001, Samba has gained the ability to + interact with Microsoft Windows 2000 using its 'Native + Mode' protocols, rather than the NT4 RPC services. + Using LDAP and Kerberos, a domain member running + winbind can enumerate users and groups in exactly the + same way as a Win2k client would, and in so doing + provide a much more efficient and + effective winbind implementation. +


    16.4.2. Name Service Switch

    14.4.3. Name Service Switch

    The Name Service Switch, or NSS, is a feature that is present in many UNIX operating systems. It allows system @@ -12077,9 +12348,9 @@ CLASS="SECT2" >


    16.4.3. Pluggable Authentication Modules

    14.4.4. Pluggable Authentication Modules

    Pluggable Authentication Modules, also known as PAM, is a system for abstracting authentication and authorization @@ -12126,9 +12397,9 @@ CLASS="SECT2" >


    16.4.4. User and Group ID Allocation

    14.4.5. User and Group ID Allocation

    When a user or group is created under Windows NT is it allocated a numerical relative identifier (RID). This is @@ -12152,9 +12423,9 @@ CLASS="SECT2" >


    16.4.5. Result Caching

    14.4.6. Result Caching

    An active system can generate a lot of user and group name lookups. To reduce the network cost of these lookups winbind @@ -12175,9 +12446,9 @@ CLASS="SECT1" >


    16.5. Installation and Configuration

    14.5. Installation and Configuration

    Many thanks to John Trostel


    16.5.1. Introduction

    14.5.1. Introduction

    This HOWTO describes the procedures used to get winbind up and running on my RedHat 7.1 system. Winbind is capable of providing access @@ -12261,9 +12532,9 @@ CLASS="SECT2" >


    16.5.2. Requirements

    14.5.2. Requirements

    If you have a samba configuration file that you are currently using...


    16.5.3. Testing Things Out

    14.5.3. Testing Things Out

    Before starting, it is probably best to kill off all the SAMBA related daemons running on your server. Kill off all


    16.5.3.1. Configure and compile SAMBA

    14.5.3.1. Configure and compile SAMBA

    The configuration and compilation of SAMBA is pretty straightforward. The first three steps may not be necessary depending upon @@ -12412,7 +12683,7 @@ CLASS="PROMPT" >root# ./configure --with-winbind./configure


    16.5.3.2. Configure 14.5.3.2. Configure nsswitch.conf and the @@ -12547,9 +12818,9 @@ CLASS="SECT3" >

    16.5.3.3. Configure smb.conf

    14.5.3.3. Configure smb.conf

    Several parameters are needed in the smb.conf file to control the behavior of

    [global]
    -     <...>
    +     <...>
          # separate domain and username with '+', like DOMAIN+username
          

    16.5.3.4. Join the SAMBA server to the PDC domain

    14.5.3.4. Join the SAMBA server to the PDC domain

    Enter the following command to make the SAMBA server join the PDC domain, where root# /usr/local/samba/bin/net rpc join -S PDC -U Administrator/usr/local/samba/bin/net join -S PDC -U Administrator

    The proper response to the command should be: "Joined the domain @@ -12668,9 +12939,9 @@ CLASS="SECT3" >


    16.5.3.5. Start up the winbindd daemon and test it!

    14.5.3.5. Start up the winbindd daemon and test it!

    Eventually, you will want to modify your smb startup script to automatically invoke the winbindd daemon when the other parts of @@ -12791,17 +13062,17 @@ CLASS="SECT3" >


    16.5.3.6. Fix the init.d startup scripts

    14.5.3.6. Fix the init.d startup scripts
    16.5.3.6.1. Linux
    14.5.3.6.1. Linux

    The


    16.5.3.6.2. Solaris
    14.5.3.6.2. Solaris

    On solaris, you need to modify the


    16.5.3.6.3. Restarting
    14.5.3.6.3. Restarting

    If you restart the


    16.5.3.7. Configure Winbind and PAM

    14.5.3.7. Configure Winbind and PAM

    If you have made it this far, you know that winbindd and samba are working together. If you want to use winbind to provide authentication for other @@ -13048,9 +13319,9 @@ CLASS="SECT4" >


    16.5.3.7.1. Linux/FreeBSD-specific PAM configuration
    14.5.3.7.1. Linux/FreeBSD-specific PAM configuration

    The


    16.5.3.7.2. Solaris-specific configuration
    14.5.3.7.2. Solaris-specific configuration

    The /etc/pam.conf needs to be changed. I changed this file so that my Domain users can logon both locally as well as telnet.The following are the changes @@ -13253,7 +13524,7 @@ dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1 >I also added a try_first_pass line after the winbind.so line to get rid of annoying double prompts for passwords.

    Now restart your Samba & try connecting through your application that you +>Now restart your Samba and try connecting through your application that you configured in the pam.conf.


    16.6. Limitations

    14.6. Limitations

    Winbind has a number of limitations in its current released version that we hope to overcome in future @@ -13277,7 +13548,7 @@ NAME="AEN2566" >

  • Winbind is currently only available for - the Linux operating system, although ports to other operating + the Linux, Solaris and IRIX operating systems, although ports to other operating systems are certainly possible. For such ports to be feasible, we require the C library of the target operating system to support the Name Service Switch and Pluggable Authentication @@ -13286,1116 +13557,1027 @@ NAME="AEN2566" >

  • The mappings of Windows NT RIDs to UNIX ids - is not made algorithmically and depends on the order in which - unmapped users or groups are seen by winbind. It may be difficult - to recover the mappings of rid to UNIX id mapping if the file - containing this information is corrupted or destroyed.

  • The mappings of Windows NT RIDs to UNIX ids + is not made algorithmically and depends on the order in which + unmapped users or groups are seen by winbind. It may be difficult + to recover the mappings of rid to UNIX id mapping if the file + containing this information is corrupted or destroyed.

  • Currently the winbind PAM module does not take + into account possible workstation and logon time restrictions + that may be been set for Windows NT users, this is + instead up to the PDC to enforce.


  • 14.7. Conclusion

    The winbind system, through the use of the Name Service + Switch, Pluggable Authentication Modules, and appropriate + Microsoft RPC calls have allowed us to provide seamless + integration of Microsoft Windows NT domain users on a + UNIX system. The result is a great reduction in the administrative + cost of running a mixed UNIX and NT network.


    Chapter 15. Improved browsing in samba

    15.1. Overview of browsing

    SMB networking provides a mechanism by which clients can access a list +of machines in a network, a so-called "browse list". This list +contains machines that are ready to offer file and/or print services +to other machines within the network. Thus it does not include +machines which aren't currently able to do server tasks. The browse +list is heavily used by all SMB clients. Configuration of SMB +browsing has been problematic for some Samba users, hence this +document.

    Browsing will NOT work if name resolution from NetBIOS names to IP +addresses does not function correctly. Use of a WINS server is highly +recommended to aid the resolution of NetBIOS (SMB) names to IP addresses. +WINS allows remote segment clients to obtain NetBIOS name_type information +that can NOT be provided by any other means of name resolution.


    15.2. Browsing support in samba

    Samba now fully supports browsing. The browsing is supported by nmbd +and is also controlled by options in the smb.conf file (see smb.conf(5)).

    Samba can act as a local browse master for a workgroup and the ability +for samba to support domain logons and scripts is now available. See +DOMAIN.txt for more information on domain logons.

    Samba can also act as a domain master browser for a workgroup. This +means that it will collate lists from local browse masters into a +wide area network server list. In order for browse clients to +resolve the names they may find in this list, it is recommended that +both samba and your clients use a WINS server.

    Note that you should NOT set Samba to be the domain master for a +workgroup that has the same name as an NT Domain: on each wide area +network, you must only ever have one domain master browser per workgroup, +regardless of whether it is NT, Samba or any other type of domain master +that is providing this service.

    [Note that nmbd can be configured as a WINS server, but it is not +necessary to specifically use samba as your WINS server. NTAS can +be configured as your WINS server. In a mixed NT server and +samba environment on a Wide Area Network, it is recommended that +you use the NT server's WINS server capabilities. In a samba-only +environment, it is recommended that you use one and only one nmbd +as your WINS server].

    To get browsing to work you need to run nmbd as usual, but will need +to use the "workgroup" option in smb.conf to control what workgroup +Samba becomes a part of.

    Currently the winbind PAM module does not take - into account possible workstation and logon time restrictions - that may be been set for Windows NT users.

    Samba also has a useful option for a Samba server to offer itself for +browsing on another subnet. It is recommended that this option is only +used for 'unusual' purposes: announcements over the internet, for +example. See "remote announce" in the smb.conf man page.


    16.7. Conclusion

    15.3. Problem resolution

    The winbind system, through the use of the Name Service - Switch, Pluggable Authentication Modules, and appropriate - Microsoft RPC calls have allowed us to provide seamless - integration of Microsoft Windows NT domain users on a - UNIX system. The result is a great reduction in the administrative - cost of running a mixed UNIX and NT network.

    If something doesn't work then hopefully the log.nmb file will help +you track down the problem. Try a debug level of 2 or 3 for finding +problems. Also note that the current browse list usually gets stored +in text form in a file called browse.dat.

    Note that if it doesn't work for you, then you should still be able to +type the server name as \\SERVER in filemanager then hit enter and +filemanager should display the list of available shares.

    Some people find browsing fails because they don't have the global +"guest account" set to a valid account. Remember that the IPC$ +connection that lists the shares is done as guest, and thus you must +have a valid guest account.

    Also, a lot of people are getting bitten by the problem of too many +parameters on the command line of nmbd in inetd.conf. This trick is to +not use spaces between the option and the parameter (eg: -d2 instead +of -d 2), and to not use the -B and -N options. New versions of nmbd +are now far more likely to correctly find your broadcast and network +address, so in most cases these aren't needed.

    The other big problem people have is that their broadcast address, +netmask or IP address is wrong (specified with the "interfaces" option +in smb.conf)


    Chapter 17. Passdb MySQL plugin


    17.1. Building

    15.4. Browsing across subnets

    To build the plugin, run make bin/pdb_mysql.so -in the source/ directory of samba distribution.

    With the release of Samba 1.9.17(alpha1 and above) Samba has been +updated to enable it to support the replication of browse lists +across subnet boundaries. New code and options have been added to +achieve this. This section describes how to set this feature up +in different settings.

    Next, copy pdb_mysql.so to any location you want. I -strongly recommend installing it in $PREFIX/lib or /usr/lib/samba/

    To see browse lists that span TCP/IP subnets (ie. networks separated +by routers that don't pass broadcast traffic) you must set up at least +one WINS server. The WINS server acts as a DNS for NetBIOS names, allowing +NetBIOS name to IP address translation to be done by doing a direct +query of the WINS server. This is done via a directed UDP packet on +port 137 to the WINS server machine. The reason for a WINS server is +that by default, all NetBIOS name to IP address translation is done +by broadcasts from the querying machine. This means that machines +on one subnet will not be able to resolve the names of machines on +another subnet without using a WINS server.

    Remember, for browsing across subnets to work correctly, all machines, +be they Windows 95, Windows NT, or Samba servers must have the IP address +of a WINS server given to them by a DHCP server, or by manual configuration +(for Win95 and WinNT, this is in the TCP/IP Properties, under Network +settings) for Samba this is in the smb.conf file.



    17.2. Configuring

    15.4.1. How does cross subnet browsing work ?

    This plugin lacks some good documentation, but here is some short info:

    Cross subnet browsing is a complicated dance, containing multiple +moving parts. It has taken Microsoft several years to get the code +that achieves this correct, and Samba lags behind in some areas. +However, with the 1.9.17 release, Samba is capable of cross subnet +browsing when configured correctly.

    Add a the following to the passdb backend variable in your smb.conf: -

    Consider a network set up as follows :

    passdb backend = [other-plugins] plugin:/location/to/pdb_mysql.so:identifier [other-plugins]
    (DMB) + N1_A N1_B N1_C N1_D N1_E + | | | | | + ------------------------------------------------------- + | subnet 1 | + +---+ +---+ + |R1 | Router 1 Router 2 |R2 | + +---+ +---+ + | | + | subnet 2 subnet 3 | + -------------------------- ------------------------------------ + | | | | | | | | + N2_A N2_B N2_C N2_D N3_A N3_B N3_C N3_D + (WINS)

    The identifier can be any string you like, as long as it doesn't collide with -the identifiers of other plugins or other instances of pdb_mysql. If you -specify multiple pdb_mysql.so entries in 'passdb backend', you also need to -use different identifiers!

    Consisting of 3 subnets (1, 2, 3) connected by two routers +(R1, R2) - these do not pass broadcasts. Subnet 1 has 5 machines +on it, subnet 2 has 4 machines, subnet 3 has 4 machines. Assume +for the moment that all these machines are configured to be in the +same workgroup (for simplicities sake). Machine N1_C on subnet 1 +is configured as Domain Master Browser (ie. it will collate the +browse lists for the workgroup). Machine N2_D is configured as +WINS server and all the other machines are configured to register +their NetBIOS names with it.

    As all these machines are booted up, elections for master browsers +will take place on each of the three subnets. Assume that machine +N1_C wins on subnet 1, N2_B wins on subnet 2, and N3_D wins on +subnet 3 - these machines are known as local master browsers for +their particular subnet. N1_C has an advantage in winning as the +local master browser on subnet 1 as it is set up as Domain Master +Browser.

    On each of the three networks, machines that are configured to +offer sharing services will broadcast that they are offering +these services. The local master browser on each subnet will +receive these broadcasts and keep a record of the fact that +the machine is offering a service. This list of records is +the basis of the browse list. For this case, assume that +all the machines are configured to offer services so all machines +will be on the browse list.

    For each network, the local master browser on that network is +considered 'authoritative' for all the names it receives via +local broadcast. This is because a machine seen by the local +master browser via a local broadcast must be on the same +network as the local master browser and thus is a 'trusted' +and 'verifiable' resource. Machines on other networks that +the local master browsers learn about when collating their +browse lists have not been directly seen - these records are +called 'non-authoritative'.

    At this point the browse lists look as follows (these are +the machines you would see in your network neighborhood if +you looked in it on a particular network right now).

    Subnet           Browse Master   List
    +------           -------------   ----
    +Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E
    +
    +Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
    +
    +Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D

    Note that at this point all the subnets are separate, no +machine is seen across any of the subnets.

    Now examine subnet 2. As soon as N2_B has become the local +master browser it looks for a Domain master browser to synchronize +its browse list with. It does this by querying the WINS server +(N2_D) for the IP address associated with the NetBIOS name +WORKGROUP>1B<. This name was registerd by the Domain master +browser (N1_C) with the WINS server as soon as it was booted.

    Once N2_B knows the address of the Domain master browser it +tells it that is the local master browser for subnet 2 by +sending a MasterAnnouncement packet as a UDP port 138 packet. +It then synchronizes with it by doing a NetServerEnum2 call. This +tells the Domain Master Browser to send it all the server +names it knows about. Once the domain master browser receives +the MasterAnnouncement packet it schedules a synchronization +request to the sender of that packet. After both synchronizations +are done the browse lists look like :

    Subnet           Browse Master   List
    +------           -------------   ----
    +Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
    +                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*)
    +
    +Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
    +                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
    +
    +Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
    +
    +Servers with a (*) after them are non-authoritative names.

    At this point users looking in their network neighborhood on +subnets 1 or 2 will see all the servers on both, users on +subnet 3 will still only see the servers on their own subnet.

    The same sequence of events that occured for N2_B now occurs +for the local master browser on subnet 3 (N3_D). When it +synchronizes browse lists with the domain master browser (N1_A) +it gets both the server entries on subnet 1, and those on +subnet 2. After N3_D has synchronized with N1_C and vica-versa +the browse lists look like.

    Subnet           Browse Master   List
    +------           -------------   ----
    +Subnet1          N1_C            N1_A, N1_B, N1_C, N1_D, N1_E, 
    +                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*),
    +                                 N3_A(*), N3_B(*), N3_C(*), N3_D(*)
    +
    +Subnet2          N2_B            N2_A, N2_B, N2_C, N2_D
    +                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*)
    +
    +Subnet3          N3_D            N3_A, N3_B, N3_C, N3_D
    +                                 N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*),
    +                                 N2_A(*), N2_B(*), N2_C(*), N2_D(*)
    +
    +Servers with a (*) after them are non-authoritative names.

    At this point users looking in their network neighborhood on +subnets 1 or 3 will see all the servers on all sunbets, users on +subnet 2 will still only see the servers on subnets 1 and 2, but not 3.

    Additional options can be given thru the smb.conf file in the [global] section.

    Finally, the local master browser for subnet 2 (N2_B) will sync again +with the domain master browser (N1_C) and will recieve the missing +server entries. Finally - and as a steady state (if no machines +are removed or shut off) the browse lists will look like :

    identifier:mysql host                     - host name, defaults to 'localhost'
    -identifier:mysql password
    -identifier:mysql user                     - defaults to 'samba'
    -identifier:mysql database                 - defaults to 'samba'
    -identifier:mysql port                     - defaults to 3306
    -identifier:table                          - Name of the table containing users
    Subnet Browse Master List +------ ------------- ---- +Subnet1 N1_C N1_A, N1_B, N1_C, N1_D, N1_E, + N2_A(*), N2_B(*), N2_C(*), N2_D(*), + N3_A(*), N3_B(*), N3_C(*), N3_D(*) + +Subnet2 N2_B N2_A, N2_B, N2_C, N2_D + N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*) + N3_A(*), N3_B(*), N3_C(*), N3_D(*) + +Subnet3 N3_D N3_A, N3_B, N3_C, N3_D + N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*), + N2_A(*), N2_B(*), N2_C(*), N2_D(*) + +Servers with a (*) after them are non-authoritative names.

    Names of the columns in this table(I've added column types those columns should have first):

    Synchronizations between the domain master browser and local +master browsers will continue to occur, but this should be a +steady state situation.

    identifier:logon time column             - int(9)
    -identifier:logoff time column            - int(9)
    -identifier:kickoff time column           - int(9)
    -identifier:pass last set time column     - int(9)
    -identifier:pass can change time column   - int(9)
    -identifier:pass must change time column  - int(9)
    -identifier:username column               - varchar(255) - unix username
    -identifier:domain column                 - varchar(255) - NT domain user is part of
    -identifier:nt username column            - varchar(255) - NT username
    -identifier:fullname column            - varchar(255) - Full name of user
    -identifier:home dir column               - varchar(255) - Unix homedir path
    -identifier:dir drive column              - varchar(2) - Directory drive path (eg: 'H:')
    -identifier:logon script column           - varchar(255) - Batch file to run on client side when logging on
    -identifier:profile path column           - varchar(255) - Path of profile
    -identifier:acct desc column              - varchar(255) - Some ASCII NT user data
    -identifier:workstations column           - varchar(255) - Workstations user can logon to (or NULL for all)
    -identifier:unknown string column         - varchar(255) - unknown string
    -identifier:munged dial column            - varchar(255) - ?
    -identifier:uid column                    - int(9) - Unix user ID (uid)
    -identifier:gid column                    - int(9) - Unix user group (gid)
    -identifier:user sid column               - varchar(255) - NT user SID
    -identifier:group sid column              - varchar(255) - NT group ID
    -identifier:lanman pass column            - varchar(255) - encrypted lanman password
    -identifier:nt pass column                - varchar(255) - encrypted nt passwd
    -identifier:plaintext pass column         - varchar(255) - plaintext password
    -identifier:acct control column           - int(9) - nt user data
    -identifier:unknown 3 column              - int(9) - unknown
    -identifier:logon divs column             - int(9) - ?
    -identifier:hours len column              - int(9) - ?
    -identifier:unknown 5 column              - int(9) - unknown
    -identifier:unknown 6 column              - int(9) - unknown

    If either router R1 or R2 fails the following will occur:

    Eventually, you can put a colon (:) after the name of each column, which -should specify the column to update when updating the table. You can also -specify nothing behind the colon - then the data from the field will not be -updated.


    17.3. Using plaintext passwords or encrypted password

    1. I strongly discourage the use of plaintext passwords, however, you can use them:

      Names of computers on each side of the inaccessible network fragments + will be maintained for as long as 36 minutes, in the network neighbourhood + lists. +

    2. If you would like to use plaintext passwords, set 'identifier:lanman pass column' and 'identifier:nt pass column' to 'NULL' (without the quotes) and 'identifier:plaintext pass column' to the name of the column containing the plaintext passwords.

      Attempts to connect to these inaccessible computers will fail, but the + names will not be removed from the network neighbourhood lists. +

    3. If you use encrypted passwords, set the 'identifier:plaintext pass column' to 'NULL' (without the quotes). This is the default.

      If one of the fragments is cut off from the WINS server, it will only + be able to access servers on its local subnet, by using subnet-isolated + broadcast NetBIOS name resolution. The effects are similar to that of + losing access to a DNS server. +


    17.4. Getting non-column data from the table

    It is possible to have not all data in the database and making some 'constant'.

    15.5. Setting up a WINS server

    For example, you can set 'identifier:fullname column' to : -CONCAT(First_name,' ',Sur_name)

    Either a Samba machine or a Windows NT Server machine may be set up +as a WINS server. To set a Samba machine to be a WINS server you must +add the following option to the smb.conf file on the selected machine : +in the [globals] section add the line

    Or, set 'identifier:workstations column' to : -NULL wins support = yes

    See the MySQL documentation for more language constructs.


    Chapter 18. Passdb XML plugin

    18.1. Building

    This module requires libxml2 to be installed.

    To build pdb_xml, run: make bin/pdb_xml.so in -the directory source/.


    18.2. Usage

    Versions of Samba previous to 1.9.17 had this parameter default to +yes. If you have any older versions of Samba on your network it is +strongly suggested you upgrade to 1.9.17 or above, or at the very +least set the parameter to 'no' on all these machines.

    The usage of pdb_xml is pretty straightforward. To export data, use: - -Machines with "pdbedit -e plugin:/usr/lib/samba/pdb_xml.so:filename - -(where filename is the name of the file to put the data in)

    wins support = yes" will keep a list of +all NetBIOS names registered with them, acting as a DNS for NetBIOS names.

    To import data, use: -You should set up only ONE wins server. Do NOT set the +"pdbedit -i plugin:/usr/lib/samba/pdb_xml.so:filename -e current-pdb - -Where filename is the name to read the data from and current-pdb to put it in.


    Chapter 19. Storing Samba's User/Machine Account information in an LDAP Directory

    19.1. Purpose

    This document describes how to use an LDAP directory for storing Samba user -account information traditionally stored in the smbpasswd(5) file. It is -assumed that the reader already has a basic understanding of LDAP concepts -and has a working directory server already installed. For more information -on LDAP architectures and Directories, please refer to the following sites.

    wins support = yes" option on more than one Samba +server.

    • To set up a Windows NT Server as a WINS server you need to set up +the WINS service - see your NT documentation for details. Note that +Windows NT WINS Servers can replicate to each other, allowing more +than one to be set up in a complex subnet environment. As Microsoft +refuse to document these replication protocols Samba cannot currently +participate in these replications. It is possible in the future that +a Samba->Samba WINS replication protocol may be defined, in which +case more than one Samba machine could be set up as a WINS server +but currently only one Samba server should have the "wins support = yes" +parameter set.

      OpenLDAP - http://www.openldap.org/

    • After the WINS server has been configured you must ensure that all +machines participating on the network are configured with the address +of this WINS server. If your WINS server is a Samba machine, fill in +the Samba machine IP address in the "Primary WINS Server" field of +the "Control Panel->Network->Protocols->TCP->WINS Server" dialogs +in Windows 95 or Windows NT. To tell a Samba server the IP address +of the WINS server add the following line to the [global] section of +all smb.conf files :

      iPlanet Directory Server - http://iplanet.netscape.com/directorywins server = >name or IP address<

    Note that O'Reilly Publishing is working on -a guide to LDAP for System Administrators which has a planned release date of -early summer, 2002.

    Two additional Samba resources which may prove to be helpful are

    • where >name or IP address< is either the DNS name of the WINS server +machine or its IP address.

      The Samba-PDC-LDAP-HOWTO - maintained by Ignacio Coupeau.

    • Note that this line MUST NOT BE SET in the smb.conf file of the Samba +server acting as the WINS server itself. If you set both the +"wins support = yes" option and the +"wins server = >name<" option then +nmbd will fail to start.

      The NT migration scripts from IDEALX that are - geared to manage users and group in such a Samba-LDAP Domain Controller configuration. -

    There are two possible scenarios for setting up cross subnet browsing. +The first details setting up cross subnet browsing on a network containing +Windows 95, Samba and Windows NT machines that are not configured as +part of a Windows NT Domain. The second details setting up cross subnet +browsing on networks that contain NT Domains.


    19.2. Introduction

    Traditionally, when configuring "encrypt -passwords = yes" in Samba's smb.conf file, user account -information such as username, LM/NT password hashes, password change times, and account -flags have been stored in the smbpasswd(5) file. There are several -disadvantages to this approach for sites with very large numbers of users (counted -in the thousands).

    15.6. Setting up Browsing in a WORKGROUP

    • To set up cross subnet browsing on a network containing machines +in up to be in a WORKGROUP, not an NT Domain you need to set up one +Samba server to be the Domain Master Browser (note that this is *NOT* +the same as a Primary Domain Controller, although in an NT Domain the +same machine plays both roles). The role of a Domain master browser is +to collate the browse lists from local master browsers on all the +subnets that have a machine participating in the workgroup. Without +one machine configured as a domain master browser each subnet would +be an isolated workgroup, unable to see any machines on any other +subnet. It is the presense of a domain master browser that makes +cross subnet browsing possible for a workgroup.

      The first is that all lookups must be performed sequentially. Given that -there are approximately two lookups per domain logon (one for a normal -session connection such as when mapping a network drive or printer), this -is a performance bottleneck for lareg sites. What is needed is an indexed approach -such as is used in databases.

    • In an WORKGROUP environment the domain master browser must be a +Samba server, and there must only be one domain master browser per +workgroup name. To set up a Samba server as a domain master browser, +set the following option in the [global] section of the smb.conf file :

      The second problem is that administrators who desired to replicate a -smbpasswd file to more than one Samba server were left to use external -tools such as rsync(1) and ssh(1) -and wrote custom, in-house scripts.

    • domain master = yes

      And finally, the amount of information which is stored in an -smbpasswd entry leaves no room for additional attributes such as -a home directory, password expiration time, or even a Relative -Identified (RID).

    The domain master browser should also preferrably be the local master +browser for its own subnet. In order to achieve this set the following +options in the [global] section of the smb.conf file :

    As a result of these defeciencies, a more robust means of storing user attributes -used by smbd was developed. The API which defines access to user accounts -is commonly referred to as the samdb interface (previously this was called the passdb -API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support -for a samdb backend (e.g. --with-ldapsam or ---with-tdbsam) requires compile time support.

            domain master = yes
    +        local master = yes
    +        preferred master = yes
    +        os level = 65

    When compiling Samba to include the --with-ldapsam autoconf -option, smbd (and associated tools) will store and lookup user accounts in -an LDAP directory. In reality, this is very easy to understand. If you are -comfortable with using an smbpasswd file, simply replace "smbpasswd" with -"LDAP directory" in all the documentation.

    The domain master browser may be the same machine as the WINS +server, if you require.

    There are a few points to stress about what the --with-ldapsam -does not provide. The LDAP support referred to in the this documentation does not -include:

    Next, you should ensure that each of the subnets contains a +machine that can act as a local master browser for the +workgroup. Any NT machine should be able to do this, as will +Windows 95 machines (although these tend to get rebooted more +often, so it's not such a good idea to use these). To make a +Samba server a local master browser set the following +options in the [global] section of the smb.conf file :

            domain master = no
    +        local master = yes
    +        preferred master = yes
    +        os level = 65

    • A means of retrieving user account information from - an Windows 2000 Active Directory server.

    • Do not do this for more than one Samba server on each subnet, +or they will war with each other over which is to be the local +master browser.

      A means of replacing /etc/passwd.

    The "local master" parameter allows Samba to act as a local master +browser. The "preferred master" causes nmbd to force a browser +election on startup and the "os level" parameter sets Samba high +enough so that it should win any browser elections.

    The second item can be accomplished by using LDAP NSS and PAM modules. LGPL -versions of these libraries can be obtained from PADL Software -(http://www.padl.com/). However, -the details of configuring these packages are beyond the scope of this document.


    19.3. Supported LDAP Servers

    If you have an NT machine on the subnet that you wish to +be the local master browser then you can disable Samba from +becoming a local master browser by setting the following +options in the [global] section of the smb.conf file :

    The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP -2.0 server and client libraries. The same code should be able to work with -Netscape's Directory Server and client SDK. However, due to lack of testing -so far, there are bound to be compile errors and bugs. These should not be -hard to fix. If you are so inclined, please be sure to forward all patches to -samba-patches@samba.org and -jerry@samba.org.

            domain master = no
    +        local master = no
    +        preferred master = no
    +        os level = 0


    19.4. Schema and Relationship to the RFC 2307 posixAccount

    15.7. Setting up Browsing in a DOMAIN

    Samba 2.2.3 includes the necessary schema file for OpenLDAP 2.0 in -examples/LDAP/samba.schema. (Note that this schema -file has been modified since the experimental support initially included -in 2.2.2). The sambaAccount objectclass is given here:

    If you are adding Samba servers to a Windows NT Domain then +you must not set up a Samba server as a domain master browser. +By default, a Windows NT Primary Domain Controller for a Domain +name is also the Domain master browser for that name, and many +things will break if a Samba server registers the Domain master +browser NetBIOS name (DOMAIN>1B<) with WINS instead of the PDC.

    For subnets other than the one containing the Windows NT PDC +you may set up Samba servers as local master browsers as +described. To make a Samba server a local master browser set +the following options in the [global] section of the smb.conf +file :

    objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL
    -     DESC 'Samba Account'
    -     MUST ( uid $ rid )
    -     MAY  ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $
    -            logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $
    -            displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $
    -            description $ userWorkstations $ primaryGroupID $ domain ))
    domain master = no + local master = yes + preferred master = yes + os level = 65

    The samba.schema file has been formatted for OpenLDAP 2.0. The OID's are -owned by the Samba Team and as such is legal to be openly published. -If you translate the schema to be used with Netscape DS, please -submit the modified schema file as a patch to jerry@samba.org

    If you wish to have a Samba server fight the election with machines +on the same subnet you may set the "os level" parameter to lower +levels. By doing this you can tune the order of machines that +will become local master browsers if they are running. For +more details on this see the section "FORCING SAMBA TO BE THE MASTER" +below.

    Just as the smbpasswd file is mean to store information which supplements a -user's /etc/passwd entry, so is the sambaAccount object -meant to supplement the UNIX user account information. A sambaAccount is a -STRUCTURAL objectclass so it can be stored individually -in the directory. However, there are several fields (e.g. uid) which overlap -with the posixAccount objectclass outlined in RFC2307. This is by design.

    If you have Windows NT machines that are members of the domain +on all subnets, and you are sure they will always be running then +you can disable Samba from taking part in browser elections and +ever becoming a local master browser by setting following options +in the [global] section of the smb.conf file :

    In order to store all user account information (UNIX and Samba) in the directory, -it is necessary to use the sambaAccount and posixAccount objectclasses in -combination. However, smbd will still obtain the user's UNIX account -information via the standard C library calls (e.g. getpwnam(), et. al.). -This means that the Samba server must also have the LDAP NSS library installed -and functioning correctly. This division of information makes it possible to -store all Samba account information in LDAP, but still maintain UNIX account -information in NIS while the network is transitioning to a full LDAP infrastructure.

    domain master = no + local master = no + preferred master = no + os level = 0


    19.5. Configuring Samba with LDAP

    19.5.1. OpenLDAP configuration

    15.8. Forcing samba to be the master

    To include support for the sambaAccount object in an OpenLDAP directory -server, first copy the samba.schema file to slapd's configuration directory.

    Who becomes the "master browser" is determined by an election process +using broadcasts. Each election packet contains a number of parameters +which determine what precedence (bias) a host should have in the +election. By default Samba uses a very low precedence and thus loses +elections to just about anyone else.

    root# cp samba.schema /etc/openldap/schema/

    If you want Samba to win elections then just set the "os level" global +option in smb.conf to a higher number. It defaults to 0. Using 34 +would make it win all elections over every other system (except other +samba systems!)

    Next, include the samba.schema file in slapd.conf. -The sambaAccount object contains two attributes which depend upon other schema -files. The 'uid' attribute is defined in cosine.schema and -the 'displayName' attribute is defined in the inetorgperson.schema -file. Both of these must be included before the samba.schema file.

    A "os level" of 2 would make it beat WfWg and Win95, but not NTAS. A +NTAS domain controller uses level 32.

    ## /etc/openldap/slapd.conf
    -
    -## schema files (core.schema is required by default)
    -include	           /etc/openldap/schema/core.schema
    -
    -## needed for sambaAccount
    -include            /etc/openldap/schema/cosine.schema
    -include            /etc/openldap/schema/inetorgperson.schema
    -include            /etc/openldap/schema/samba.schema
    -
    -## uncomment this line if you want to support the RFC2307 (NIS) schema
    -## include         /etc/openldap/schema/nis.schema
    -
    -....

    The maximum os level is 255

    It is recommended that you maintain some indices on some of the most usefull attributes, -like in the following example, to speed up searches made on sambaAccount objectclasses -(and possibly posixAccount and posixGroup as well).

    If you want samba to force an election on startup, then set the +"preferred master" global option in smb.conf to "yes". Samba will +then have a slight advantage over other potential master browsers +that are not preferred master browsers. Use this parameter with +care, as if you have two hosts (whether they are windows 95 or NT or +samba) on the same local subnet both set with "preferred master" to +"yes", then periodically and continually they will force an election +in order to become the local master browser.

    # Indices to maintain
    -## required by OpenLDAP 2.0
    -index objectclass   eq
    -
    -## support pb_getsampwnam()
    -index uid           pres,eq
    -## support pdb_getsambapwrid()
    -index rid           eq
    -
    -## uncomment these if you are storing posixAccount and
    -## posixGroup entries in the directory as well
    -##index uidNumber     eq
    -##index gidNumber     eq
    -##index cn            eq
    -##index memberUid     eq

    If you want samba to be a "domain master browser", then it is +recommended that you also set "preferred master" to "yes", because +samba will not become a domain master browser for the whole of your +LAN or WAN if it is not also a local master browser on its own +broadcast isolated subnet.

    It is possible to configure two samba servers to attempt to become +the domain master browser for a domain. The first server that comes +up will be the domain master browser. All other samba servers will +attempt to become the domain master browser every 5 minutes. They +will find that another samba server is already the domain master +browser and will fail. This provides automatic redundancy, should +the current domain master browser fail.



    19.5.2. Configuring Samba

    15.9. Making samba the domain master

    The following parameters are available in smb.conf only with --with-ldapsam -was included with compiling Samba.

    The domain master is responsible for collating the browse lists of +multiple subnets so that browsing can occur between subnets. You can +make samba act as the domain master by setting "domain master = yes" +in smb.conf. By default it will not be a domain master.

    • Note that you should NOT set Samba to be the domain master for a +workgroup that has the same name as an NT Domain.

      ldap ssl

    • When samba is the domain master and the master browser it will listen +for master announcements (made roughly every twelve minutes) from local +master browsers on other subnets and then contact them to synchronise +browse lists.

      ldap server

    • If you want samba to be the domain master then I suggest you also set +the "os level" high enough to make sure it wins elections, and set +"preferred master" to "yes", to get samba to force an election on +startup.

      ldap admin dn

    • Note that all your servers (including samba) and clients should be +using a WINS server to resolve NetBIOS names. If your clients are only +using broadcasting to resolve NetBIOS names, then two things will occur:

      ldap suffix

      1. ldap filter

        your local master browsers will be unable to find a domain master + browser, as it will only be looking on the local subnet. +

      2. ldap port

        if a client happens to get hold of a domain-wide browse list, and + a user attempts to access a host in that list, it will be unable to + resolve the NetBIOS name of that host. +

    These are described in the smb.conf(5) man -page and so will not be repeated here. However, a sample smb.conf file for -use with an LDAP directory could appear as

    If, however, both samba and your clients are using a WINS server, then:

    ## /usr/local/samba/lib/smb.conf
    -[global]
    -     security = user
    -     encrypt passwords = yes
    -
    -     netbios name = TASHTEGO
    -     workgroup = NARNIA
    -
    -     # ldap related parameters
    -
    -     # define the DN to use when binding to the directory servers
    -     # The password for this DN is not stored in smb.conf.  Rather it
    -     # must be set by using 'smbpasswd -w secretpw' to store the
    -     # passphrase in the secrets.tdb file.  If the "ldap admin dn" values
    -     # changes, this password will need to be reset.
    -     ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org"
    -
    -     #  specify the LDAP server's hostname (defaults to locahost)
    -     ldap server = ahab.samba.org
    -
    -     # Define the SSL option when connecting to the directory
    -     # ('off', 'start tls', or 'on' (default))
    -     ldap ssl = start tls
    -
    -     # define the port to use in the LDAP session (defaults to 636 when
    -     # "ldap ssl = on")
    -     ldap port = 389
    -
    -     # specify the base DN to use when searching the directory
    -     ldap suffix = "ou=people,dc=samba,dc=org"
    -
    -     # generally the default ldap search filter is ok
    -     # ldap filter = "(&(uid=%u)(objectclass=sambaAccount))"

    1. your local master browsers will contact the WINS server and, as long as + samba has registered that it is a domain master browser with the WINS + server, your local master browser will receive samba's ip address + as its domain master browser. +

    2. when a client receives a domain-wide browse list, and a user attempts + to access a host in that list, it will contact the WINS server to + resolve the NetBIOS name of that host. as long as that host has + registered its NetBIOS name with the same WINS server, the user will + be able to see that host. +


    19.6. Accounts and Groups management

    As users accounts are managed thru the sambaAccount objectclass, you should -modify you existing administration tools to deal with sambaAccount attributes.

    Machines accounts are managed with the sambaAccount objectclass, just -like users accounts. However, it's up to you to stored thoses accounts -in a different tree of you LDAP namespace: you should use -"ou=Groups,dc=plainjoe,dc=org" to store groups and -"ou=People,dc=plainjoe,dc=org" to store users. Just configure your -NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration -file).

    15.10. Note about broadcast addresses

    In Samba release 2.2.3, the group management system is based on posix -groups. This meand that Samba make usage of the posixGroup objectclass. -For now, there is no NT-like group system management (global and local -groups).

    If your network uses a "0" based broadcast address (for example if it +ends in a 0) then you will strike problems. Windows for Workgroups +does not seem to support a 0's broadcast and you will probably find +that browsing and name lookups won't work.


    19.7. Security and sambaAccount

    There are two important points to remember when discussing the security -of sambaAccount entries in the directory.

    • 15.11. Multiple interfaces

      Never retrieve the lmPassword or - ntPassword attribute values over an unencrypted LDAP session.

    • Samba now supports machines with multiple network interfaces. If you +have multiple interfaces then you will need to use the "interfaces" +option in smb.conf to configure them. See smb.conf(5) for details.


    Chapter 16. Stackable VFS modules

    16.1. Introduction and configuration

    Never allow non-admin users to - view the lmPassword or ntPassword attribute values.

    Since samba 3.0, samba supports stackable VFS(Virtual File System) modules. +Samba passes each request to access the unix file system thru the loaded VFS modules. +This chapter covers all the modules that come with the samba source and references to +some external modules.

    These password hashes are clear text equivalents and can be used to impersonate -the user without deriving the original clear text strings. For more information -on the details of LM/NT password hashes, refer to the ENCRYPTION chapter of the Samba-HOWTO-Collection.

    You may have problems to compile these modules, as shared libraries are +compiled and linked in different ways on different systems. +They currently have been tested against GNU/linux and IRIX.

    To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults -to require an encrypted session (ldap ssl = on) using -the default port of 636 -when contacting the directory server. When using an OpenLDAP 2.0 server, it -is possible to use the use the StartTLS LDAP extended operation in the place of -LDAPS. In either case, you are strongly discouraged to disable this security -(To use the VFS modules, create a share similar to the one below. The +important parameter is the ldap ssl = off).

    Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS -extended operation. However, the OpenLDAP library still provides support for -the older method of securing communication between clients and servers.

    The second security precaution is to prevent non-administrative users from -harvesting password hashes from the directory. This can be done using the -following ACL in slapd.conf:

    vfs object parameter which must point to
    +the exact pathname of the shared library objects. For example, to log all access 
    +to files and use a recycle bin:
    +
    +
    ## allow the "ldap admin dn" access, but deny everyone else
    -access to attrs=lmPassword,ntPassword
    -     by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write
    -     by * none
    [audit] + comment = Audited /data directory + path = /data + vfs object = /path/to/audit.so /path/to/recycle.so + writeable = yes + browseable = yes

    The modules are used in the order they are specified.

    Further documentation on writing VFS modules for Samba can be found in +the Samba Developers Guide.


    19.8. LDAP specials attributes for sambaAccounts

    The sambaAccount objectclass is composed of the following attributes:

    16.2. Included modules

    16.2.1. audit

    A simple module to audit file access to the syslog +facility. The following operations are logged: +

    • lmPassword: the LANMAN password 16-byte hash stored as a character - representation of a hexidecimal string.

    • ntPassword: the NT password hash 16-byte stored as a character - representation of a hexidecimal string.

    • pwdLastSet: The integer time in seconds since 1970 when the - lmPassword and ntPassword attributes were last set. -

    • acctFlags: string of 11 characters surrounded by square brackets [] - representing account flags such as U (user), W(workstation), X(no password expiration), and - D(disabled).

    • logonTime: Integer value currently unused

    • logoffTime: Integer value currently unused

    • kickoffTime: Integer value currently unused

    • pwdCanChange: Integer value currently unused

    • pwdMustChange: Integer value currently unused

    • share
      connect/disconnect
      directory opens/create/remove
      file open/close/rename/unlink/chmod

      homeDrive: specifies the drive letter to which to map the - UNC path specified by homeDirectory. The drive letter must be specified in the form "X:" - where X is the letter of the drive to map. Refer to the "logon drive" parameter in the - smb.conf(5) man page for more information.


    16.2.2. recycle

    scriptPath: The scriptPath property specifies the path of - the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path - is relative to the netlogon share. Refer to the "logon script" parameter in the - smb.conf(5) man page for more information.

  • A recycle-bin like modules. When used any unlink call +will be intercepted and files moved to the recycle +directory instead of beeing deleted.

    profilePath: specifies a path to the user's profile. - This value can be a null string, a local absolute path, or a UNC path. Refer to the - "logon path" parameter in the smb.conf(5) man page for more information.

  • Supported options: +

    vfs_recycle_bin:repository

    smbHome: The homeDirectory property specifies the path of - the home directory for the user. The string can be null. If homeDrive is set and specifies - a drive letter, homeDirectory should be a UNC path. The path must be a network - UNC path of the form \\server\share\directory. This value can be a null string. - Refer to the "logon home" parameter in the smb.conf(5) man page for more information. -

  • FIXME

    vfs_recycle_bin:keeptree

    userWorkstation: character string value currently unused. -

  • FIXME

    vfs_recycle_bin:versions

    rid: the integer representation of the user's relative identifier - (RID).

  • FIXME

    vfs_recycle_bin:touch

    primaryGroupID: the relative identifier (RID) of the primary group - of the user.

  • FIXME

    vfs_recycle_bin:maxsize

    The majority of these parameters are only used when Samba is acting as a PDC of -a domain (refer to the Samba-PDC-HOWTO for details on -how to configure Samba as a Primary Domain Controller). The following four attributes -are only stored with the sambaAccount entry if the values are non-default values:

    FIXME

    vfs_recycle_bin:exclude

    • FIXME

    vfs_recycle_bin:exclude_dir

    smbHome

  • FIXME

  • vfs_recycle_bin:noversions

    scriptPath

  • FIXME


  • 16.2.3. netatalk

    logonPath

  • A netatalk module, that will ease co-existence of samba and +netatalk file sharing services.

    homeDrive

  • Advantages compared to the old netatalk module: +

    it doesn't care about creating of .AppleDouble forks, just keeps ones in sync
    if share in smb.conf doesn't contain .AppleDouble item in hide or veto list, it will be added automatically

    These attributes are only stored with the sambaAccount entry if -the values are non-default values. For example, assume TASHTEGO has now been -configured as a PDC and that logon home = \\%L\%u was defined in -its smb.conf file. When a user named "becky" logons to the domain, -the logon home string is expanded to \\TASHTEGO\becky. -If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org", -this value is used. However, if this attribute does not exist, then the value -of the logon home parameter is used in its place. Samba -will only write the attribute value to the directory entry is the value is -something other than the default (e.g. \\MOBY\becky).


    19.9. Example LDIF Entries for a sambaAccount

    16.3. VFS modules available elsewhere

    The following is a working LDIF with the inclusion of the posixAccount objectclass:

    This section contains a listing of various other VFS modules that +have been posted but don't currently reside in the Samba CVS +tree for one reason ot another (e.g. it is easy for the maintainer +to have his or her own CVS tree).

    dn: uid=guest2, ou=people,dc=plainjoe,dc=org
    -ntPassword: 878D8014606CDA29677A44EFA1353FC7
    -pwdMustChange: 2147483647
    -primaryGroupID: 1201
    -lmPassword: 552902031BEDE9EFAAD3B435B51404EE
    -pwdLastSet: 1010179124
    -logonTime: 0
    -objectClass: sambaAccount
    -uid: guest2
    -kickoffTime: 2147483647
    -acctFlags: [UX         ]
    -logoffTime: 2147483647
    -rid: 19006
    -pwdCanChange: 0
    No statemets about the stability or functionality any module +should be implied due to its presence here.


    16.3.1. DatabaseFS

    URL: http://www.css.tayloru.edu/~elorimer/databasefs/index.php

    The following is an LDIF entry for using both the sambaAccount and -posixAccount objectclasses:

    By Eric Lorimer.

    dn: uid=gcarter, ou=people,dc=plainjoe,dc=org
    -logonTime: 0
    -displayName: Gerald Carter
    -lmPassword: 552902031BEDE9EFAAD3B435B51404EE
    -primaryGroupID: 1201
    -objectClass: posixAccount
    -objectClass: sambaAccount
    -acctFlags: [UX         ]
    -userPassword: {crypt}BpM2ej8Rkzogo
    -uid: gcarter
    -uidNumber: 9000
    -cn: Gerald Carter
    -loginShell: /bin/bash
    -logoffTime: 2147483647
    -gidNumber: 100
    -kickoffTime: 2147483647
    -pwdLastSet: 1010179230
    -rid: 19000
    -homeDirectory: /home/tashtego/gcarter
    -pwdCanChange: 0
    -pwdMustChange: 2147483647
    -ntPassword: 878D8014606CDA29677A44EFA1353FC7

    I have created a VFS module which implements a fairly complete read-only +filesystem. It presents information from a database as a filesystem in +a modular and generic way to allow different databases to be used +(originally designed for organizing MP3s under directories such as +"Artists," "Song Keywords," etc... I have since applied it to a student +roster database very easily). The directory structure is stored in the +database itself and the module makes no assumptions about the database +structure beyond the table it requires to run.

    Any feedback would be appreciated: comments, suggestions, patches, +etc... If nothing else, hopefully it might prove useful for someone +else who wishes to create a virtual filesystem.



    19.10. Comments

    16.3.2. vscan

    Please mail all comments regarding this HOWTO to URL: jerry@samba.org. This documents was -last updated to reflect the Samba 2.2.3 release.

    http://www.openantivirus.org/

    samba-vscan is a proof-of-concept module for Samba, which +uses the VFS (virtual file system) features of Samba 2.2.x/3.0 +alphaX. Of couse, Samba has to be compiled with VFS support. +samba-vscan supports various virus scanners and is maintained +by Rainer Link.

    Chapter 20. HOWTO Access Samba source code via CVSChapter 17. Access Samba source code via CVS

    20.1. Introduction

    17.1. Introduction

    Samba is developed in an open environment. Developers use CVS (Concurrent Versioning System) to "checkin" (also known as @@ -14432,9 +14614,9 @@ CLASS="SECT1" >


    20.2. CVS Access to samba.org

    17.2. CVS Access to samba.org

    The machine samba.org runs a publicly accessible CVS repository for access to the source code of several packages, @@ -14445,9 +14627,9 @@ CLASS="SECT2" >


    20.2.1. Access via CVSweb

    17.2.1. Access via CVSweb

    You can access the source code via your favourite WWW browser. This allows you to access the contents of @@ -14466,9 +14648,9 @@ CLASS="SECT2" >


    20.2.2. Access via cvs

    17.2.2. Access via cvs

    You can also access the source code via a normal cvs client. This gives you much more control over you can @@ -14576,7 +14758,7 @@ CLASS="CHAPTER" >Chapter 21. Group mapping HOWTOChapter 18. Group mapping HOWTO

    Starting with Samba 3.0 alpha 2, a new group mapping function is available. The @@ -14677,135 +14859,46 @@ CLASS="CHAPTER" >Chapter 22. Samba performance issuesChapter 19. Samba performance issues

    22.1. Comparisons

    19.1. Comparisons

    The Samba server uses TCP to talk to the client. Thus if you are trying to see if it performs well you should really compare it to programs that use the same protocol. The most readily available programs for file transfer that use TCP are ftp or another TCP based -SMB server.

    If you want to test against something like a NT or WfWg server then -you will have to disable all but TCP on either the client or -server. Otherwise you may well be using a totally different protocol -(such as Netbeui) and comparisons may not be valid.

    Generally you should find that Samba performs similarly to ftp at raw -transfer speed. It should perform quite a bit faster than NFS, -although this very much depends on your system.

    Several people have done comparisons between Samba and Novell, NFS or -WinNT. In some cases Samba performed the best, in others the worst. I -suspect the biggest factor is not Samba vs some other system but the -hardware and drivers used on the various systems. Given similar -hardware Samba should certainly be competitive in speed with other -systems.


    22.2. Oplocks

    22.2.1. Overview

    Oplocks are the way that SMB clients get permission from a server to -locally cache file operations. If a server grants an oplock -(opportunistic lock) then the client is free to assume that it is the -only one accessing the file and it will agressively cache file -data. With some oplock types the client may even cache file open/close -operations. This can give enormous performance benefits.

    With the release of Samba 1.9.18 we now correctly support opportunistic -locks. This is turned on by default, and can be turned off on a share- -by-share basis by setting the parameter :

    oplocks = False

    We recommend that you leave oplocks on however, as current benchmark -tests with NetBench seem to give approximately a 30% improvement in -speed with them on. This is on average however, and the actual -improvement seen can be orders of magnitude greater, depending on -what the client redirector is doing.

    Previous to Samba 1.9.18 there was a 'fake oplocks' option. This -option has been left in the code for backwards compatibility reasons -but it's use is now deprecated. A short summary of what the old -code did follows.


    22.2.2. Level2 Oplocks

    With Samba 2.0.5 a new capability - level2 (read only) oplocks is -supported (although the option is off by default - see the smb.conf -man page for details). Turning on level2 oplocks (on a share-by-share basis) -by setting the parameter :

    level2 oplocks = true

    should speed concurrent access to files that are not commonly written -to, such as application serving shares (ie. shares that contain common -.EXE files - such as a Microsoft Office share) as it allows clients to -read-ahread cache copies of these files.


    22.2.3. Old 'fake oplocks' option - deprecated

    Samba can also fake oplocks, by granting a oplock whenever a client -asks for one. This is controlled using the smb.conf option "fake -oplocks". If you set "fake oplocks = yes" then you are telling the -client that it may agressively cache the file data for all opens.

    If you want to test against something like a NT or WfWg server then +you will have to disable all but TCP on either the client or +server. Otherwise you may well be using a totally different protocol +(such as Netbeui) and comparisons may not be valid.

    Enabling 'fake oplocks' on all read-only shares or shares that you know -will only be accessed from one client at a time you will see a big -performance improvement on many operations. If you enable this option -on shares where multiple clients may be accessing the files read-write -at the same time you can get data corruption.

    Generally you should find that Samba performs similarly to ftp at raw +transfer speed. It should perform quite a bit faster than NFS, +although this very much depends on your system.

    Several people have done comparisons between Samba and Novell, NFS or +WinNT. In some cases Samba performed the best, in others the worst. I +suspect the biggest factor is not Samba vs some other system but the +hardware and drivers used on the various systems. Given similar +hardware Samba should certainly be competitive in speed with other +systems.


    22.3. Socket options

    19.2. Socket options

    There are a number of socket options that can greatly affect the performance of a TCP based server like Samba.


    22.4. Read size

    19.3. Read size

    The option "read size" affects the overlap of disk reads/writes with network reads/writes. If the amount of data being transferred in @@ -14857,9 +14950,9 @@ CLASS="SECT1" >


    22.5. Max xmit

    19.4. Max xmit

    At startup the client and server negotiate a "maximum transmit" size, which limits the size of nearly all SMB commands. You can set the @@ -14880,331 +14973,626 @@ CLASS="SECT1" >


    22.6. Locking

    By default Samba does not implement strict locking on each read/write -call (although it did in previous versions). If you enable strict -locking (using "strict locking = yes") then you may find that you -suffer a severe performance hit on some systems.

    19.5. Log level

    The performance hit will probably be greater on NFS mounted -filesystems, but could be quite high even on local disks.

    If you set the log level (also known as "debug level") higher than 2 +then you may suffer a large drop in performance. This is because the +server flushes the log file after each operation, which can be very +expensive.


    22.7. Share modes

    19.6. Read raw

    Some people find that opening files is very slow. This is often -because of the "share modes" code needed to fully implement the dos -share modes stuff. You can disable this code using "share modes = -no". This will gain you a lot in opening and closing files but will -mean that (in some cases) the system won't force a second user of a -file to open the file read-only if the first has it open -read-write. For many applications that do their own locking this -doesn't matter, but for some it may. Most Windows applications -depend heavily on "share modes" working correctly and it is -recommended that the Samba share mode support be left at the -default of "on".

    The "read raw" operation is designed to be an optimised, low-latency +file read operation. A server may choose to not support it, +however. and Samba makes support for "read raw" optional, with it +being enabled by default.

    The share mode code in Samba has been re-written in the 1.9.17 -release following tests with the Ziff-Davis NetBench PC Benchmarking -tool. It is now believed that Samba 1.9.17 implements share modes -similarly to Windows NT.

    In some cases clients don't handle "read raw" very well and actually +get lower performance using it than they get using the conventional +read operations.

    NOTE: In the most recent versions of Samba there is an option to use -shared memory via mmap() to implement the share modes. This makes -things much faster. See the Makefile for how to enable this.

    So you might like to try "read raw = no" and see what happens on your +network. It might lower, raise or not affect your performance. Only +testing can really tell.


    22.8. Log level

    19.7. Write raw

    If you set the log level (also known as "debug level") higher than 2 -then you may suffer a large drop in performance. This is because the -server flushes the log file after each operation, which can be very -expensive.

    The "write raw" operation is designed to be an optimised, low-latency +file write operation. A server may choose to not support it, +however. and Samba makes support for "write raw" optional, with it +being enabled by default.

    Some machines may find "write raw" slower than normal write, in which +case you may wish to change this option.


    22.9. Wide lines

    19.8. Slow Clients

    The "wide links" option is now enabled by default, but if you disable -it (for better security) then you may suffer a performance hit in -resolving filenames. The performance loss is lessened if you have -"getwd cache = yes", which is now the default.

    One person has reported that setting the protocol to COREPLUS rather +than LANMAN2 gave a dramatic speed improvement (from 10k/s to 150k/s).

    I suspect that his PC's (386sx16 based) were asking for more data than +they could chew. I suspect a similar speed could be had by setting +"read raw = no" and "max xmit = 2048", instead of changing the +protocol. Lowering the "read size" might also help.


    22.10. Read raw

    The "read raw" operation is designed to be an optimised, low-latency -file read operation. A server may choose to not support it, -however. and Samba makes support for "read raw" optional, with it -being enabled by default.

    19.9. Slow Logins

    In some cases clients don't handle "read raw" very well and actually -get lower performance using it than they get using the conventional -read operations.

    So you might like to try "read raw = no" and see what happens on your -network. It might lower, raise or not affect your performance. Only -testing can really tell.

    Slow logins are almost always due to the password checking time. Using +the lowest practical "password level" will improve things a lot. You +could also enable the "UFC crypt" option in the Makefile.


    22.11. Write raw

    19.10. Client tuning

    The "write raw" operation is designed to be an optimised, low-latency -file write operation. A server may choose to not support it, -however. and Samba makes support for "write raw" optional, with it -being enabled by default.

    Often a speed problem can be traced to the client. The client (for +example Windows for Workgroups) can often be tuned for better TCP +performance.

    Some machines may find "write raw" slower than normal write, in which -case you may wish to change this option.

    See your client docs for details. In particular, I have heard rumours +that the WfWg options TCPWINDOWSIZE and TCPSEGMENTSIZE can have a +large impact on performance.

    Also note that some people have found that setting DefaultRcvWindow in +the [MSTCP] section of the SYSTEM.INI file under WfWg to 3072 gives a +big improvement. I don't know why.

    My own experience wth DefaultRcvWindow is that I get much better +performance with a large value (16384 or larger). Other people have +reported that anything over 3072 slows things down enourmously. One +person even reported a speed drop of a factor of 30 when he went from +3072 to 8192. I don't know why.

    It probably depends a lot on your hardware, and the type of unix box +you have at the other end of the link.

    Paul Cochrane has done some testing on client side tuning and come +to the following conclusions:

    Install the W2setup.exe file from www.microsoft.com. This is an +update for the winsock stack and utilities which improve performance.

    Configure the win95 TCPIP registry settings to give better +perfomance. I use a program called MTUSPEED.exe which I got off the +net. There are various other utilities of this type freely available. +The setting which give the best performance for me are:

    1. MaxMTU Remove

    2. RWIN Remove

    3. MTUAutoDiscover Disable

    4. MTUBlackHoleDetect Disable

    5. Time To Live Enabled

    6. Time To Live - HOPS 32

    7. NDI Cache Size 0

    I tried virtually all of the items mentioned in the document and +the only one which made a difference to me was the socket options. It +turned out I was better off without any!!!!!

    In terms of overall speed of transfer, between various win95 clients +and a DX2-66 20MB server with a crappy NE2000 compatible and old IDE +drive (Kernel 2.0.30). The transfer rate was reasonable for 10 baseT.

    The figures are:          Put              Get 
    +P166 client 3Com card:    420-440kB/s      500-520kB/s
    +P100 client 3Com card:    390-410kB/s      490-510kB/s
    +DX4-75 client NE2000:     370-380kB/s      330-350kB/s

    I based these test on transfer two files a 4.5MB text file and a 15MB +textfile. The results arn't bad considering the hardware Samba is +running on. It's a crap machine!!!!

    The updates mentioned in 1 and 2 brought up the transfer rates from +just over 100kB/s in some clients.

    A new client is a P333 connected via a 100MB/s card and hub. The +transfer rates from this were good: 450-500kB/s on put and 600+kB/s +on get.

    Looking at standard FTP throughput, Samba is a bit slower (100kB/s +upwards). I suppose there is more going on in the samba protocol, but +if it could get up to the rate of FTP the perfomance would be quite +staggering.


    Chapter 20. Creating Group Profiles


    22.12. Read prediction

    Samba can do read prediction on some of the SMB commands. Read -prediction means that Samba reads some extra data on the last file it -read while waiting for the next SMB command to arrive. It can then -respond more quickly when the next read request arrives.

    20.1. Windows '9x

    This is disabled by default. You can enable it by using "read -prediction = yes".

    You need the Win98 Group Policy Editor to +set Group Profiles up under Windows '9x. It can be found on the Original +full product Win98 installation CD under +tools/reskit/netadmin/poledit. You install this +using the Add/Remove Programs facility and then click on the 'Have Disk' +tab.

    Note that read prediction is only used on files that were opened read -only.

    Use the Group Policy Editor to create a policy file that specifies the +location of user profiles and/or the My Documents etc. +stuff. You then save these settings in a file called +Config.POL that needs to be placed in +the root of the [NETLOGON] share. If your Win98 is configured to log onto +the Samba Domain, it will automatically read this file and update the +Win98 registry of the machine that is logging on.

    Read prediction should particularly help for those silly clients (such -as "Write" under NT) which do lots of very small reads on a file.

    All of this is covered in the Win98 Resource Kit documentation.

    Samba will not read ahead more data than the amount specified in the -"read size" option. It always reads ahead on 1k block boundaries.

    If you do not do it this way, then every so often Win98 will check the +integrity of the registry and will restore it's settings from the back-up +copy of the registry it stores on each Win98 machine. Hence, you will notice +things changing back to the original settings.


    20.2. Windows NT 4

    Unfortunately, the Resource Kit info is Win NT4/2K version specific.

    Here is a quick guide:

    • On your NT4 Domain Controller, right click on 'My Computer', then +select the tab labelled 'User Profiles'.

    • Select a user profile you want to migrate and click on it.

      I am using the term "migrate" lossely. You can copy a profile to +create a group profile. You can give the user 'Everyone' rights to the +profile you copy this to. That is what you need to do, since your samba +domain is not a member of a trust relationship with your NT4 PDC.

    • Click the 'Copy To' button.

    • In the box labelled 'Copy Profile to' add your new path, eg: +c:\temp\foobar

    • Click on the button labelled 'Change' in the "Permitted to use" box.

    • Click on the group 'Everyone' and then click OK. This closes the +'chose user' box.

    • Now click OK.

    Follow the above for every profile you need to migrate.


    20.2.1. Side bar Notes

    You should obtain the SID of your NT4 domain. You can use smbpasswd to do +this. Read the man page.

    With Samba-3.0.0 alpha code you can import all you NT4 domain accounts +using the net samsync method. This way you can retain your profile +settings as well as all your users.


    20.2.2. Mandatory profiles

    The above method can be used to create mandatory profiles also. To convert +a group profile into a mandatory profile simply locate the NTUser.DAT file +in the copied profile and rename it to NTUser.MAN.


    22.13. Memory mapping

    Samba supports reading files via memory mapping them. One some -machines this can give a large boost to performance, on others it -makes not difference at all, and on some it may reduce performance.

    20.2.3. moveuser.exe

    To enable you you have to recompile Samba with the -DUSE_MMAP option -on the FLAGS line of the Makefile.

    Note that memory mapping is only used on files opened read only, and -is not used by the "read raw" operation. Thus you may find memory -mapping is more effective if you disable "read raw" using "read raw = -no".

    The W2K professional resource kit has moveuser.exe. moveuser.exe changes +the security of a profile from one user to another. This allows the account +domain to change, and/or the user name to change.



    22.14. Slow Clients

    20.2.4. Get SID

    One person has reported that setting the protocol to COREPLUS rather -than LANMAN2 gave a dramatic speed improvement (from 10k/s to 150k/s).

    You can identify the SID by using GetSID.exe from the Windows NT Server 4.0 +Resource Kit.

    I suspect that his PC's (386sx16 based) were asking for more data than -they could chew. I suspect a similar speed could be had by setting -"read raw = no" and "max xmit = 2048", instead of changing the -protocol. Lowering the "read size" might also help.

    Windows NT 4.0 stores the local profile information in the registry under +the following key: +HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

    Under the ProfileList key, there will be subkeys named with the SIDs of the +users who have logged on to this computer. (To find the profile information +for the user whose locally cached profile you want to move, find the SID for +the user with the GetSID.exe utility.) Inside of the appropriate user's +subkey, you will see a string value named ProfileImagePath.


    22.15. Slow Logins

    20.3. Windows 2000/XP

    Slow logins are almost always due to the password checking time. Using -the lowest practical "password level" will improve things a lot. You -could also enable the "UFC crypt" option in the Makefile.

    You must first convert the profile from a local profile to a domain +profile on the MS Windows workstation as follows:

    • Log on as the LOCAL workstation administrator.

    • Right click on the 'My Computer' Icon, select 'Properties'

    • Click on the 'User Profiles' tab

    • Select the profile you wish to convert (click on it once)

    • Click on the button 'Copy To'

    • In the "Permitted to use" box, click on the 'Change' button.

    • Click on the 'Look in" area that lists the machine name, when you click +here it will open up a selection box. Click on the domain to which the +profile must be accessible.


      22.16. Client tuning

      Often a speed problem can be traced to the client. The client (for -example Windows for Workgroups) can often be tuned for better TCP -performance.

      See your client docs for details. In particular, I have heard rumours -that the WfWg options TCPWINDOWSIZE and TCPSEGMENTSIZE can have a -large impact on performance.

      You will need to log on if a logon box opens up. Eg: In the connect +as: MIDEARTH\root, password: mypassword.

    • Also note that some people have found that setting DefaultRcvWindow in -the [MSTCP] section of the SYSTEM.INI file under WfWg to 3072 gives a -big improvement. I don't know why.

      To make the profile capable of being used by anyone select 'Everyone'

    • My own experience wth DefaultRcvWindow is that I get much better -performance with a large value (16384 or larger). Other people have -reported that anything over 3072 slows things down enourmously. One -person even reported a speed drop of a factor of 30 when he went from -3072 to 8192. I don't know why.

      Click OK. The Selection box will close.

    • It probably depends a lot on your hardware, and the type of unix box -you have at the other end of the link.

      Now click on the 'Ok' button to create the profile in the path you +nominated.

    Paul Cochrane has done some testing on client side tuning and come -to the following conclusions:

    Done. You now have a profile that can be editted using the samba-3.0.0 +profiles tool.

    Install the W2setup.exe file from www.microsoft.com. This is an -update for the winsock stack and utilities which improve performance.

    Configure the win95 TCPIP registry settings to give better -perfomance. I use a program called MTUSPEED.exe which I got off the -net. There are various other utilities of this type freely available. -The setting which give the best performance for me are:

    Under NT/2K the use of mandotory profiles forces the use of MS Exchange +storage of mail data. That keeps desktop profiles usable.

      • MaxMTU Remove

        This is a security check new to Windows XP (or maybe only +Windows XP service pack 1). It can be disabled via a group policy in +Active Directory. The policy is:

        "Computer Configuration\Administrative Templates\System\User +Profiles\Do not check for user ownership of Roaming Profile Folders"

        ...and it should be set to "Enabled". +Does the new version of samba have an Active Directory analogue? If so, +then you may be able to set the policy through this.

        If you cannot set group policies in samba, then you may be able to set +the policy locally on each machine. If you want to try this, then do +the following (N.B. I don't know for sure that this will work in the +same way as a domain group policy):

      • RWIN Remove

        On the XP workstation log in with an Administrator account.

      • MTUAutoDiscover Disable

        Click: "Start", "Run"

      • MTUBlackHoleDetect Disable

        Type: "mmc"

      • Time To Live Enabled

        Click: "OK"

      • Time To Live - HOPS 32

        A Microsoft Management Console should appear.

      • NDI Cache Size 0

        Click: File, "Add/Remove Snap-in...", "Add"

      • I tried virtually all of the items mentioned in the document and -the only one which made a difference to me was the socket options. It -turned out I was better off without any!!!!!

        Double-Click: "Group Policy"

      • In terms of overall speed of transfer, between various win95 clients -and a DX2-66 20MB server with a crappy NE2000 compatible and old IDE -drive (Kernel 2.0.30). The transfer rate was reasonable for 10 baseT.

        Click: "Finish", "Close"

      • FIXME -The figures are: Put Get -P166 client 3Com card: 420-440kB/s 500-520kB/s -P100 client 3Com card: 390-410kB/s 490-510kB/s -DX4-75 client NE2000: 370-380kB/s 330-350kB/s

        Click: "OK"

      • I based these test on transfer two files a 4.5MB text file and a 15MB -textfile. The results arn't bad considering the hardware Samba is -running on. It's a crap machine!!!!

        In the "Console Root" window:

      • The updates mentioned in 1 and 2 brought up the transfer rates from -just over 100kB/s in some clients.

        Expand: "Local Computer Policy", "Computer Configuration",

      • A new client is a P333 connected via a 100MB/s card and hub. The -transfer rates from this were good: 450-500kB/s on put and 600+kB/s -on get.

        "Administrative Templates", "System", "User Profiles"

      • Looking at standard FTP throughput, Samba is a bit slower (100kB/s -upwards). I suppose there is more going on in the samba protocol, but -if it could get up to the rate of FTP the perfomance would be quite -staggering.


        22.17. My Results

        Double-Click: "Do not check for user ownership of Roaming Profile

      • Folders"

      • Some people want to see real numbers in a document like this, so here -they are. I have a 486sx33 client running WfWg 3.11 with the 3.11b -tcp/ip stack. It has a slow IDE drive and 20Mb of ram. It has a SMC -Elite-16 ISA bus ethernet card. The only WfWg tuning I've done is to -set DefaultRcvWindow in the [MSTCP] section of system.ini to 16384. My -server is a 486dx3-66 running Linux. It also has 20Mb of ram and a SMC -Elite-16 card. You can see my server config in the examples/tridge/ -subdirectory of the distribution.

        Select: "Enabled"

      • I get 490k/s on reading a 8Mb file with copy. -I get 441k/s writing the same file to the samba server.

        Click: OK"

      • Of course, there's a lot more to benchmarks than 2 raw throughput -figures, but it gives you a ballpark figure.

        Close the whole console. You do not need to save the settings (this +refers to the console settings rather than the policies you have +changed).

      • I've also tested Win95 and WinNT, and found WinNT gave me the best -speed as a samba client. The fastest client of all (for me) is -smbclient running on another linux box. Maybe I'll add those results -here someday ...

        Reboot

    Table of Contents
    23. 21. Portability
    23.1. 21.1. HPUX
    23.2. 21.2. SCO Unix
    23.3. 21.3. DNIX
    23.4. 21.4. RedHat Linux Rembrandt-II
    24. 22. Samba and other CIFS clients
    24.1. 22.1. Macintosh clients?
    24.2. 22.2. OS2 Client
    24.2.1. 22.2.1. How can I configure OS/2 Warp Connect or OS/2 Warp 4 as a client for Samba?
    24.2.2. 22.2.2. How can I configure OS/2 Warp 3 (not Connect), OS/2 1.2, 1.3 or 2.x for Samba?
    24.2.3. 22.2.3. Are there any other issues when OS/2 (any version) is used as a client?
    24.2.4. 22.2.4. How do I get printer driver download working for OS/2 clients?
    24.3. 22.3. Windows for Workgroups
    24.3.1. 22.3.1. Use latest TCP/IP stack from Microsoft
    24.3.2. 22.3.2. Delete .pwl files after password change
    24.3.3. 22.3.3. Configure WfW password handling
    24.3.4. 22.3.4. Case handling of passwords
    24.4. 22.4. Windows '95/'98
    24.5. 22.5. Windows 2000 Service Pack 2
    25. 23. Reporting Bugs
    25.1. 23.1. Introduction
    25.2. 23.2. General info
    25.3. 23.3. Debug levels
    25.4. 23.4. Internal errors
    25.5. 23.5. Attaching to a running process
    25.6. 23.6. Patches
    26. 24. Diagnosing your samba server
    26.1. 24.1. Introduction
    26.2. 24.2. Assumptions
    26.3. 24.3. Tests
    26.3.1. 24.3.1. Test 1
    26.3.2. 24.3.2. Test 2
    26.3.3. 24.3.3. Test 3
    26.3.4. 24.3.4. Test 4
    26.3.5. 24.3.5. Test 5
    26.3.6. 24.3.6. Test 6
    26.3.7. 24.3.7. Test 7
    26.3.8. 24.3.8. Test 8
    26.3.9. 24.3.9. Test 9
    26.3.10. 24.3.10. Test 10
    26.3.11. 24.3.11. Test 11
    26.4. 24.4. Still having troubles?
    Chapter 23. PortabilityChapter 21. Portability

    Samba works on a wide range of platforms but the interface all the platforms provide is not always compatible. This chapter contains @@ -15479,9 +15867,9 @@ CLASS="SECT1" >


    23.1. HPUX

    21.1. HPUX

    HP's implementation of supplementary groups is, er, non-standard (for hysterical reasons). There are two group files, /etc/group and @@ -15509,9 +15897,9 @@ CLASS="SECT1" >


    23.2. SCO Unix

    21.2. SCO Unix

    If you run an old version of SCO Unix then you may need to get important @@ -15526,9 +15914,9 @@ CLASS="SECT1" >


    23.3. DNIX

    21.3. DNIX

    DNIX has a problem with seteuid() and setegid(). These routines are needed for Samba to work correctly, but they were left out of the DNIX @@ -15633,9 +16021,9 @@ CLASS="SECT1" >


    23.4. RedHat Linux Rembrandt-II

    21.4. RedHat Linux Rembrandt-II

    By default RedHat Rembrandt-II during installation adds an entry to /etc/hosts as follows: @@ -15659,7 +16047,7 @@ CLASS="CHAPTER" >Chapter 24. Samba and other CIFS clientsChapter 22. Samba and other CIFS clients

    This chapter contains client-specific information.


    24.1. Macintosh clients?

    22.1. Macintosh clients?

    Yes.


    24.2. OS2 Client

    22.2. OS2 Client

    24.2.1. How can I configure OS/2 Warp Connect or +>22.2.1. How can I configure OS/2 Warp Connect or OS/2 Warp 4 as a client for Samba?

    A more complete answer to this question can be @@ -15780,9 +16168,9 @@ CLASS="SECT2" >


    24.2.2. How can I configure OS/2 Warp 3 (not Connect), +>22.2.2. How can I configure OS/2 Warp 3 (not Connect), OS/2 1.2, 1.3 or 2.x for Samba?

    You can use the free Microsoft LAN Manager 2.2c Client @@ -15824,9 +16212,9 @@ CLASS="SECT2" >


    24.2.3. Are there any other issues when OS/2 (any version) +>22.2.3. Are there any other issues when OS/2 (any version) is used as a client?

    When you do a NET VIEW or use the "File and Print @@ -15846,9 +16234,9 @@ CLASS="SECT2" >


    24.2.4. How do I get printer driver download working +>22.2.4. How do I get printer driver download working for OS/2 clients?

    First, create a share called [PRINTDRV] that is @@ -15897,17 +16285,17 @@ CLASS="SECT1" >


    24.3. Windows for Workgroups

    22.3. Windows for Workgroups

    24.3.1. Use latest TCP/IP stack from Microsoft

    22.3.1. Use latest TCP/IP stack from Microsoft

    Use the latest TCP/IP stack from microsoft if you use Windows for workgroups.


    24.3.2. Delete .pwl files after password change

    22.3.2. Delete .pwl files after password change

    WfWg does a lousy job with passwords. I find that if I change my password on either the unix box or the PC the safest thing to do is to @@ -15947,9 +16335,9 @@ CLASS="SECT2" >


    24.3.3. Configure WfW password handling

    22.3.3. Configure WfW password handling

    There is a program call admincfg.exe on the last disk (disk 8) of the WFW 3.11 disk set. To install it @@ -15966,9 +16354,9 @@ CLASS="SECT2" >


    24.3.4. Case handling of passwords

    22.3.4. Case handling of passwords

    Windows for Workgroups uppercases the password before sending it to the server. Unix passwords can be case-sensitive though. Check the


    24.4. Windows '95/'98

    22.4. Windows '95/'98

    When using Windows 95 OEM SR2 the following updates are recommended where Samba is being used. Please NOTE that the above change will affect you once these @@ -16033,9 +16421,9 @@ CLASS="SECT1" >


    24.5. Windows 2000 Service Pack 2

    22.5. Windows 2000 Service Pack 2

    There are several annoyances with Windows 2000 SP2. One of which @@ -16117,15 +16505,15 @@ CLASS="CHAPTER" >Chapter 25. Reporting BugsChapter 23. Reporting Bugs

    25.1. Introduction

    23.1. Introduction

    The email address for bug reports for stable releases is


    25.2. General info

    23.2. General info

    Before submitting a bug report check your config for silly errors. Look in your log files for obvious messages that tell you that @@ -16193,9 +16581,9 @@ CLASS="SECT1" >


    25.3. Debug levels

    23.3. Debug levels

    If the bug has anything to do with Samba behaving incorrectly as a server (like refusing to open a file) then the log files will probably @@ -16263,9 +16651,9 @@ CLASS="SECT1" >


    25.4. Internal errors

    23.4. Internal errors

    If you get a "INTERNAL ERROR" message in your log files it means that Samba got an unexpected signal while running. It is probably a @@ -16307,9 +16695,9 @@ CLASS="SECT1" >


    25.5. Attaching to a running process

    23.5. Attaching to a running process

    Unfortunately some unixes (in particular some recent linux kernels) refuse to dump a core file if the task has changed uid (which smbd @@ -16324,9 +16712,9 @@ CLASS="SECT1" >


    25.6. Patches

    23.6. Patches

    The best sort of bug report is one that includes a fix! If you send us patches please use Chapter 26. Diagnosing your samba serverChapter 24. Diagnosing your samba server

    26.1. Introduction

    24.1. Introduction

    This file contains a list of tests you can perform to validate your Samba server. It also tells you what the likely cause of the problem @@ -16375,9 +16763,9 @@ CLASS="SECT1" >


    26.2. Assumptions

    24.2. Assumptions

    In all of the tests it is assumed you have a Samba server called BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP.


    26.3. Tests

    24.3. Tests

    26.3.1. Test 1

    24.3.1. Test 1

    In the directory in which you store your smb.conf file, run the command "testparm smb.conf". If it reports any errors then your smb.conf @@ -16443,9 +16831,9 @@ CLASS="SECT2" >


    26.3.2. Test 2

    24.3.2. Test 2

    Run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from the unix box. If you don't get a valid response then your TCP/IP @@ -16469,9 +16857,9 @@ CLASS="SECT2" >


    26.3.3. Test 3

    24.3.3. Test 3

    Run the command "smbclient -L BIGSERVER" on the unix box. You should get a list of available shares back.


    26.3.4. Test 4

    24.3.4. Test 4

    Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the IP address of your Samba server back.


    26.3.5. Test 5

    24.3.5. Test 5

    run the command


    26.3.6. Test 6

    24.3.6. Test 6

    Run the command


    26.3.7. Test 7

    24.3.7. Test 7

    Run the command


    26.3.8. Test 8

    24.3.8. Test 8

    On the PC type the command


    26.3.9. Test 9

    24.3.9. Test 9

    Run the command


    26.3.10. Test 10

    24.3.10. Test 10

    Run the command


    26.3.11. Test 11

    24.3.11. Test 11

    From file manager try to browse the server. Your samba server should appear in the browse list of your local workgroup (or the one you @@ -16853,9 +17241,9 @@ CLASS="SECT1" >


    26.4. Still having troubles?

    24.4. Still having troubles?

    Try the mailing list or newsgroup, or use the ethereal utility to sniff the problem. The official samba mailing list can be reached at -- cgit