From d069dacb6e17866dd5d3862e1837a9cae008644f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 15 Aug 2003 18:26:34 +0000 Subject: Regenerate docs (This used to be commit dc33e94161e4fc1ca6bf66a321c708c89bb276e3) --- docs/htmldocs/Samba-Developers-Guide.html | 36 +- docs/htmldocs/SambaHA.html | 4 + docs/htmldocs/StandAloneServer.html | 112 ++ docs/htmldocs/VFS.html | 102 ++ docs/htmldocs/bugreport.html | 115 ++ docs/htmldocs/compiling.html | 200 +++ docs/htmldocs/diagnosis.html | 287 ++++ docs/htmldocs/domain-member.html | 534 +++++++ docs/htmldocs/groupmapping.html | 196 +++ docs/htmldocs/integrate-ms-networks.html | 415 ++++++ docs/htmldocs/ix01.html | 39 + docs/htmldocs/locking.html | 637 +++++++++ docs/htmldocs/migration.html | 1 + docs/htmldocs/msdfs.html | 51 + docs/htmldocs/net.8.html | 945 +------------ docs/htmldocs/nmbd.8.html | 373 ++--- docs/htmldocs/nmblookup.1.html | 317 +---- docs/htmldocs/ntlm_auth.1.html | 2 +- docs/htmldocs/optional.html | 35 + docs/htmldocs/pam.html | 565 ++++++++ docs/htmldocs/passdb.html | 785 +++++++++++ docs/htmldocs/pdbedit.8.html | 2 +- docs/htmldocs/printing.html | 2156 +++++++++++++++++++++++++++++ docs/htmldocs/problems.html | 138 ++ docs/htmldocs/rpcclient.1.html | 606 ++------ docs/htmldocs/samba-bdc.html | 260 ++++ docs/htmldocs/samba-pdc.html | 510 +++++++ docs/htmldocs/samba.7.html | 374 +---- docs/htmldocs/securing-samba.html | 192 +++ docs/htmldocs/smb.conf.5.html | 109 +- docs/htmldocs/smbcacls.1.html | 2 +- docs/htmldocs/smbclient.1.html | 11 +- docs/htmldocs/smbcontrol.1.html | 313 +---- docs/htmldocs/smbcquotas.1.html | 2 +- docs/htmldocs/smbd.8.html | 415 ++---- docs/htmldocs/smbmnt.8.html | 141 +- docs/htmldocs/smbmount.8.html | 326 +---- docs/htmldocs/smbpasswd.5.html | 182 +-- docs/htmldocs/smbpasswd.8.html | 2 +- docs/htmldocs/smbsh.1.html | 6 +- docs/htmldocs/smbstatus.1.html | 202 +-- docs/htmldocs/smbtar.1.html | 255 +--- docs/htmldocs/smbtree.1.html | 2 +- docs/htmldocs/smbumount.8.html | 81 +- docs/htmldocs/speed.html | 140 ++ docs/htmldocs/swat.8.html | 306 +--- docs/htmldocs/testparm.1.html | 214 +-- docs/htmldocs/troubleshooting.html | 1 + docs/htmldocs/type.html | 5 + docs/htmldocs/unicode.html | 67 + docs/htmldocs/upgrading-to-3.0.html | 176 +++ docs/htmldocs/vfstest.1.html | 2 +- docs/htmldocs/winbind.html | 721 ++++++++++ docs/htmldocs/winbindd.8.html | 20 +- 54 files changed, 9249 insertions(+), 4441 deletions(-) create mode 100644 docs/htmldocs/SambaHA.html create mode 100644 docs/htmldocs/StandAloneServer.html create mode 100644 docs/htmldocs/VFS.html create mode 100644 docs/htmldocs/bugreport.html create mode 100644 docs/htmldocs/compiling.html create mode 100644 docs/htmldocs/diagnosis.html create mode 100644 docs/htmldocs/domain-member.html create mode 100644 docs/htmldocs/groupmapping.html create mode 100644 docs/htmldocs/integrate-ms-networks.html create mode 100644 docs/htmldocs/ix01.html create mode 100644 docs/htmldocs/locking.html create mode 100644 docs/htmldocs/migration.html create mode 100644 docs/htmldocs/msdfs.html create mode 100644 docs/htmldocs/optional.html create mode 100644 docs/htmldocs/pam.html create mode 100644 docs/htmldocs/passdb.html create mode 100644 docs/htmldocs/printing.html create mode 100644 docs/htmldocs/problems.html create mode 100644 docs/htmldocs/samba-bdc.html create mode 100644 docs/htmldocs/samba-pdc.html create mode 100644 docs/htmldocs/securing-samba.html create mode 100644 docs/htmldocs/speed.html create mode 100644 docs/htmldocs/troubleshooting.html create mode 100644 docs/htmldocs/type.html create mode 100644 docs/htmldocs/unicode.html create mode 100644 docs/htmldocs/upgrading-to-3.0.html create mode 100644 docs/htmldocs/winbind.html (limited to 'docs') diff --git a/docs/htmldocs/Samba-Developers-Guide.html b/docs/htmldocs/Samba-Developers-Guide.html index 64c78025ed..c16b48441b 100644 --- a/docs/htmldocs/Samba-Developers-Guide.html +++ b/docs/htmldocs/Samba-Developers-Guide.html @@ -34,7 +34,7 @@ Print Queue TDB's ChangeID and Client Caching of Printer Information
Windows NT/2K Printer Change Notify -
12. Samba WINS Internals
WINS Failover
13. The Upcoming SAM System
Security in the 'new SAM'
Standalone from UNIX
Handles and Races in the new SAM
Layers
Application
SAM Interface
SAM Modules
SAM Modules
Special Module: sam_passdb
sam_ads
Memory Management
Testing
14. LanMan and NT Password Encryption
Introduction
How does it work?
The smbpasswd file
15. Modules
Advantages
Loading modules
Static modules
Shared modules
Writing modules
Static/Shared selection in configure.in
16. RPC Pluggable Modules
About
General Overview
17. VFS Modules
The Samba (Posix) VFS layer
The general interface
Possible VFS operation layers
The Interaction between the Samba VFS subsystem and the modules
Initialization and registration
How the Modules handle per connection data
Upgrading to the New VFS Interface
Upgrading from 2.2.* and 3.0aplha modules
Some Notes
Implement TRANSPARENT functions
Implement OPAQUE functions
18. Notes to packagers
Versioning
Modules
19. Contributing code

Attributions

Definition of NetBIOS Protocol and Name Resolution Modes

  • Luke Leighton

Samba Architecture

  • Dan Shearer

The samba DEBUG system

  • Chris Hertel

Coding Suggestions

  • Steve French

  • Simo Sorce

  • Andrew Bartlett

  • Tim Potter

  • Martin Pool

Samba Internals

The smb.conf file

  • Chris Hertel

NetBIOS in a Unix World

  • Andrew Tridgell

Tracing samba system calls

  • Andrew Tridgell

Finding useful information on windows

NT Domain RPC's

Samba Printing Internals

  • Gerald Carter

Samba WINS Internals

  • Gerald Carter

The Upcoming SAM System

  • Andrew Bartlett

LanMan and NT Password Encryption

Modules

RPC Pluggable Modules

VFS Modules

Notes to packagers

  • Jelmer Vernooij

Contributing code

Chapter 1. Definition of NetBIOS Protocol and Name Resolution Modes

Luke Leighton

12 June 1997

Attributions

Definition of NetBIOS Protocol and Name Resolution Modes

  • Luke Leighton

Samba Architecture

  • Dan Shearer

The samba DEBUG system

  • Chris Hertel

Coding Suggestions

  • Steve French

  • Simo Sorce

  • Andrew Bartlett

  • Tim Potter

  • Martin Pool

Samba Internals

The smb.conf file

  • Chris Hertel

NetBIOS in a Unix World

  • Andrew Tridgell

Tracing samba system calls

  • Andrew Tridgell

Finding useful information on windows

NT Domain RPC's

Samba Printing Internals

  • Gerald Carter

Samba WINS Internals

  • Gerald Carter

The Upcoming SAM System

  • Andrew Bartlett

LanMan and NT Password Encryption

Modules

RPC Pluggable Modules

VFS Modules

Notes to packagers

  • Jelmer Vernooij

Contributing code

Chapter 1. Definition of NetBIOS Protocol and Name Resolution Modes

Luke Leighton

12 June 1997

NETBIOS

NetBIOS runs over the following tranports: TCP/IP; NetBEUI and IPX/SPX. Samba only uses NetBIOS over TCP/IP. For details on the TCP/IP NetBIOS Session Service NetBIOS Datagram Service, and NetBIOS Names, see @@ -1998,22 +1998,24 @@ On the bottom of configure.in, SMB_MODULE() should be called for each module and SMB_SUBSYSTEM() for each subsystem.

Syntax:

 SMB_MODULE(subsystem_backend, object files, plugin name, subsystem name, static_action, shared_action)
-SMB_SUBSYSTEM(subsystem)
-

Also, make sure to add the correct directives to -Makefile.in. @SUBSYSTEM_STATIC@ -will be replaced with a list of objects files of the modules that need to -be linked in statically. @SUBSYSTEM_MODULES@ will +SMB_SUBSYSTEM(subsystem,depfile) +

The depfile for a certain subsystem is the file that calls the +initialisation functions for the statically built in modules.

+@SUBSYSTEM_MODULES@ in Makefile.in will be replaced with the names of the plugins to build.

You must make sure all .c files that contain defines that can be changed by ./configure are rebuilded in the 'modules_clean' make target. Practically, this means all c files that contain static_init_subsystem; calls need to be rebuilded. -

Chapter 16. RPC Pluggable Modules

Anthony Liguori

Jelmer Vernooij

Samba Team

January 2003

Table of Contents

About
General Overview

About

+

Note

+There currently also is a configure.in command called SMB_MODULE_PROVIVES(). +This is used for modules that register multiple things. It should not +be used as probing will most likely disappear in the future.

Chapter 16. RPC Pluggable Modules

Anthony Liguori

Jelmer Vernooij

Samba Team

January 2003

Table of Contents

About
General Overview

About

This document describes how to make use the new RPC Pluggable Modules features of Samba 3.0. This architecture was added to increase the maintainability of Samba allowing RPC Pipes to be worked on separately from the main CVS branch. The RPM architecture will also allow third-party vendors to add functionality to Samba through plug-ins. -

General Overview

+

General Overview

When an RPC call is sent to smbd, smbd tries to load a shared library by the name librpc_<pipename>.so to handle the call if it doesn't know how to handle the call internally. For instance, LSA calls @@ -2030,7 +2032,7 @@ NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *s argument.

clnt

the Client name of the named pipe

srv

the Server name of the named pipe

cmds

a list of api_structs that map RPC ordinal numbers to function calls

size

the number of api_structs contained in cmds

See rpc_server/srv_reg.c and rpc_server/srv_reg_nt.c for a small example of how to use this library. -

Chapter 17. VFS Modules

Alexander Bokovoy

Stefan Metzmacher

27 May 2003

The Samba (Posix) VFS layer

The general interface

+

Chapter 17. VFS Modules

Alexander Bokovoy

Stefan Metzmacher

27 May 2003

The Samba (Posix) VFS layer

The general interface

Each VFS operation has a vfs_op_type, a function pointer and a handle pointer in the struct vfs_ops and tree macros to make it easier to call the operations. (Take a look at include/vfs.h and include/vfs_macros.h.) @@ -2126,7 +2128,7 @@ DO NOT ACCESS conn->vfs.ops.* directly !!! (tofd), (fsp), (fromfd), (header), (offset), (count))) ... -

Possible VFS operation layers

+

Possible VFS operation layers

These values are used by the VFS subsystem when building the conn->vfs and conn->vfs_opaque structs for a connection with multiple VFS modules. Internally, Samba differentiates only opaque and transparent layers at this process. @@ -2155,7 +2157,7 @@ typedef enum _vfs_op_layer { SMB_VFS_LAYER_SCANNER /* - Checks data and possibly initiates additional */ /* file activity like logging to files _inside_ samba VFS */ } vfs_op_layer; -

The Interaction between the Samba VFS subsystem and the modules

Initialization and registration

+

The Interaction between the Samba VFS subsystem and the modules

Initialization and registration

As each Samba module a VFS module should have a

NTSTATUS vfs_example_init(void);

function if it's staticly linked to samba or

NTSTATUS init_module(void);

function if it's a shared module. @@ -2195,7 +2197,7 @@ NTSTATUS init_module(void) { return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "example", example_op_tuples); } -

How the Modules handle per connection data

Each VFS function has as first parameter a pointer to the modules vfs_handle_struct. +

How the Modules handle per connection data

Each VFS function has as first parameter a pointer to the modules vfs_handle_struct.

 typedef struct vfs_handle_struct {
 	struct vfs_handle_struct  *next, *prev;
@@ -2296,7 +2298,7 @@ you can set this function pointer to NULL.

Some useful MAC (handle)->vfs_next.handles.sendfile,\ (tofd), (fsp), (fromfd), (header), (offset), (count))) ... -

Upgrading to the New VFS Interface

Upgrading from 2.2.* and 3.0aplha modules

  1. +

Upgrading to the New VFS Interface

Upgrading from 2.2.* and 3.0aplha modules

  1. Add "vfs_handle_struct *handle, " as first parameter to all vfs operation functions. e.g. example_connect(connection_struct *conn, const char *service, const char *user); -> example_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char *user); @@ -2559,7 +2561,7 @@ for your module.

  2. Compiling & Testing...

    ./configure --enable-developer ...
    make
    Try to fix all compiler warnings
    make
    Testing, Testing, Testing ...

    -

Some Notes

Implement TRANSPARENT functions

+

Some Notes

Implement TRANSPARENT functions

Avoid writing functions like this:

@@ -2570,7 +2572,7 @@ static int example_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
 

Overload only the functions you really need to! -

Implement OPAQUE functions

+

Implement OPAQUE functions

If you want to just implement a better version of a default samba opaque function (e.g. like a disk_free() function for a special filesystem) @@ -2590,12 +2592,12 @@ static int example_rename(vfs_handle_struct *handle, connection_struct *conn, errno = ENOSYS; return -1; } -

Chapter 18. Notes to packagers

Jelmer Vernooij

Table of Contents

Versioning
Modules

Versioning

Please, please update the version number in +

Chapter 18. Notes to packagers

Jelmer Vernooij

Table of Contents

Versioning
Modules

Versioning

Please, please update the version number in source/include/version.h to include the versioning of your package. This makes it easier to distinguish standard samba builds from custom-build samba builds (distributions often patch packages). For example, a good version would be:

 Version 2.999+3.0.alpha21-5 for Debian
-

Modules

Samba now has support for building parts of samba as plugins. This +

Modules

Samba now has support for building parts of samba as plugins. This makes it possible to, for example, put ldap or mysql support in a seperate package, thus making it possible to have a normal samba package not depending on ldap or mysql. To build as much parts of samba diff --git a/docs/htmldocs/SambaHA.html b/docs/htmldocs/SambaHA.html new file mode 100644 index 0000000000..39ab6b91d8 --- /dev/null +++ b/docs/htmldocs/SambaHA.html @@ -0,0 +1,4 @@ +Chapter 29. High Availability Options

Chapter 29. High Availability Options

John H. Terpstra

Samba Team

Table of Contents

Note

Note

+This chapter did not make it into this release. +It is planned for the published release of this document. +

diff --git a/docs/htmldocs/StandAloneServer.html b/docs/htmldocs/StandAloneServer.html new file mode 100644 index 0000000000..f85fdfe3fc --- /dev/null +++ b/docs/htmldocs/StandAloneServer.html @@ -0,0 +1,112 @@ +Chapter 8. Stand-Alone Servers

Chapter 8. Stand-Alone Servers

John H. Terpstra

Samba Team

+Stand-Alone servers are independent of Domain Controllers on the network. +They are NOT domain members and function more like workgroup servers. In many +cases a stand-alone server is configured with a minimum of security control +with the intent that all data served will be readily accessible to all users. +

Features and Benefits

+Stand-Alone servers can be as secure or as insecure as needs dictate. They can +have simple or complex configurations. Above all, despite the hoopla about +Domain security they remain a very common installation. +

+If all that is needed is a server for read-only files, or for +printers alone, it may not make sense to affect a complex installation. +For example: A drafting office needs to store old drawings and reference +standards. No-one can write files to the server as it is legislatively +important that all documents remain unaltered. A share mode read-only stand-alone +server is an ideal solution. +

+Another situation that warrants simplicity is an office that has many printers +that are queued off a single central server. Everyone needs to be able to print +to the printers, there is no need to affect any access controls and no files will +be served from the print server. Again a share mode stand-alone server makes +a great solution. +

Background

+The term stand-alone server means that the server +will provide local authentication and access control for all resources +that are available from it. In general this means that there will be a +local user database. In more technical terms, it means that resources +on the machine will be made available in either SHARE mode or in +USER mode. +

+No special action is needed other than to create user accounts. Stand-alone +servers do NOT provide network logon services. This means that machines that +use this server do NOT perform a domain logon to it. Whatever logon facility +the workstations are subject to is independent of this machine. It is however +necessary to accommodate any network user so that the logon name they use will +be translated (mapped) locally on the stand-alone server to a locally known +user name. There are several ways this can be done. +

+Samba tends to blur the distinction a little in respect of what is +a stand-alone server. This is because the authentication database may be +local or on a remote server, even if from the Samba protocol perspective +the Samba server is NOT a member of a domain security context. +

+Through the use of PAM (Pluggable Authentication Modules) and nsswitch +(the name service switcher, which maintains the unix user database) the source of authentication may reside on +another server. We would be inclined to call this the authentication server. +This means that the Samba server may use the local UNIX/Linux system password database +(/etc/passwd or /etc/shadow), may use a +local smbpasswd file, or may use +an LDAP back end, or even via PAM and Winbind another CIFS/SMB server +for authentication. +

Example Configuration

+The following examples are designed to inspire simplicity. It is too easy to +attempt a high level of creativity and to introduce too much complexity in +server and network design. +

Reference Documentation Server

+Configuration of a read-only data server that EVERYONE can access is very simple. +Here is the smb.conf file that will do this. Assume that all the reference documents +are stored in the directory /export, that the documents are owned by a user other than +nobody. No home directories are shared, that are no users in the /etc/passwd +UNIX system database. This is a very simple system to administer. +

Example 8.1. smb.conf for Reference Documentation Server

# Global parameters
[global]
workgroup = MIDEARTH
netbios name = GANDALF
security = SHARE
passdb backend = guest
wins server = 192.168.1.1
[data]
comment = Data
path = /export
guest only = Yes

+In the above example the machine name is set to REFDOCS, the workgroup is set to the name +of the local workgroup so that the machine will appear in with systems users are familiar +with. The only password backend required is the "guest" backend so as to allow default +unprivileged account names to be used. Given that there is a WINS server on this network +we do use it. +

Central Print Serving

+Configuration of a simple print server is very simple if you have all the right tools +on your system. +

Assumptions:

  1. + The print server must require no administration +

  2. + The print spooling and processing system on our print server will be CUPS. + (Please refer to the chapter about CUPS for more information). +

  3. + All printers that the print server will service will be network + printers. They will be correctly configured, by the administrator, + in the CUPS environment. +

  4. + All workstations will be installed using postscript drivers. The printer + of choice is the Apple Color LaserWriter. +

+In this example our print server will spool all incoming print jobs to +/var/spool/samba until the job is ready to be submitted by +Samba to the CUPS print processor. Since all incoming connections will be as +the anonymous (guest) user, two things will be required: +

Enabling Anonymous Printing

  • + The UNIX/Linux system must have a guest account. + The default for this is usually the account nobody. + To find the correct name to use for your version of Samba do the + following: +

    +$ testparm -s -v | grep "guest account"
    +

    + Then make sure that this account exists in your system password + database (/etc/passwd). +

  • + The directory into which Samba will spool the file must have write + access for the guest account. The following commands will ensure that + this directory is available for use: +

    +root# mkdir /var/spool/samba
    +root# chown nobody.nobody /var/spool/samba
    +root# chmod a+rwt /var/spool/samba
    +

    +

+

Example 8.2. smb.conf for anonymous printing

# Global parameters
[global]
workgroup = MIDEARTH
netbios name = GANDALF
security = SHARE
passdb backend = guest
wins server = noldor
printing = cups
printcap name = cups
[printers]
comment = All Printers
path = /var/spool/samba
printer admin = root
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

+

Common Errors

+The greatest mistake so often made is to make a network configuration too complex. +It pays to use the simplest solution that will meet the needs of the moment. +

diff --git a/docs/htmldocs/VFS.html b/docs/htmldocs/VFS.html new file mode 100644 index 0000000000..ffa767e6c9 --- /dev/null +++ b/docs/htmldocs/VFS.html @@ -0,0 +1,102 @@ +Chapter 20. Stackable VFS modules

Chapter 20. Stackable VFS modules

Jelmer R. Vernooij

The Samba Team

John H. Terpstra

Samba Team

Tim Potter

Simo Sorce

original vfs_skel README

Alexander Bokovoy

original vfs_netatalk docs

Stefan Metzmacher

Update for multiple modules

Features and Benefits

+Since Samba-3, there is support for 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. +

Discussion

+If not supplied with your platform distribution binary Samba package 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 use the VFS modules, create a share similar to the one below. The +important parameter is the vfs objects parameter where +you can list one or more VFS modules by name. For example, to log all access +to files and put deleted files in a recycle bin: + +

Example 20.1. smb.conf with VFS modules

[audit]
comment = Audited /data directory
path = /data
vfs objects = audit recycle
writeable = yes
browseable = yes

+

+The modules are used in the order in which they are specified. +

+Samba will attempt to load modules from the lib +directory in the root directory of the samba installation (usually +/usr/lib/samba/vfs or /usr/local/samba/lib/vfs +). +

+Some modules can be used twice for the same share. +This can be done using a configuration similar to the one below. + +

Example 20.2. smb.conf with multiple VFS modules

[test]
comment = VFS TEST
path = /data
writeable = yes
browseable = yes
vfs objects = example:example1 example example:test
example1: parameter = 1
example: parameter = 5
test: parameter = 7

+

Included modules

audit

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

  • share

  • connect/disconnect

  • directory opens/create/remove

  • file open/close/rename/unlink/chmod

+

extd_audit

+ This module is identical with the audit module above except + that it sends audit logs to both syslog as well as the smbd log file/s. The + loglevel for this module is set in the smb.conf file. +

+ The logging information that will be written to the smbd log file is controlled by + the log level parameter in smb.conf. The + following information will be recorded: +

Table 20.1. Extended Auditing Log Information

Log LevelLog Details - File and Directory Operations
0Creation / Deletion
1Create / Delete / Rename / Permission Changes
2Create / Delete / Rename / Perm Change / Open / Close

fake_perms

+ This module was created to allow Roaming Profile files and directories to be set (on the Samba server + under Unix) as read only. This module will if installed on the Profiles share will report to the client + that the Profile files and directories are writable. This satisfies the client even though the files + will never be overwritten as the client logs out or shuts down. +

recycle

+ A recycle-bin like module. When used any unlink call + will be intercepted and files moved to the recycle + directory instead of being deleted. This gives the same + effect as the "Recycle Bin" on Windows computers. +

Supported options: +

recycle:repository

Relative path of the directory where deleted files should be moved to

recycle:keeptree

Specifies whether the directory structure should + be kept or if the files in the directory that is being + deleted should be kept seperately in the recycle bin. +

recycle:versions

If this option is set, two files + with the same name that are deleted will both + be kept in the recycle bin. Newer deleted versions + of a file will be called "Copy #x of filename".

recycle:touch

Specifies whether a file's access + date should be touched when the file is moved to + the recycle bin.

recycle:maxsize

Files that are larger than the number + of bytes specified by this parameter will + not be put into the recycle bin.

recycle:exclude

List of files that should not + be put into the recycle bin when deleted, but deleted + in the regular way.

recycle:exclude_dir

Contains a list of directories. When files from + these directories are deleted, they are not put into the + recycle bin, but deleted in the regular way. +

recycle:noversions

Opposite of recycle:versions. If both options are specified, this one takes precedence.

+

netatalk

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

Advantages compared to the old netatalk module: +

  • it doesn't care about creating of .AppleDouble forks, just keeps them in sync

  • if a share in smb.conf doesn't contain .AppleDouble item in hide or veto list, it will be added automatically

+

VFS modules available elsewhere

+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 or another (e.g. it is easy for the maintainer +to have his or her own CVS tree). +

+No statements about the stability or functionality of any module +should be implied due to its presence here. +

DatabaseFS

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

By Eric Lorimer.

+ 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. +

vscan

URL: 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 course, Samba has to be compiled with VFS support. + samba-vscan supports various virus scanners and is maintained + by Rainer Link. +

diff --git a/docs/htmldocs/bugreport.html b/docs/htmldocs/bugreport.html new file mode 100644 index 0000000000..49eb2117ca --- /dev/null +++ b/docs/htmldocs/bugreport.html @@ -0,0 +1,115 @@ +Chapter 35. Reporting Bugs

Chapter 35. Reporting Bugs

Jelmer R. Vernooij

The Samba Team

Andrew Tridgell

Samba Team

27 June 1997

Introduction

Please report bugs using + bugzilla.

+Please take the time to read this file before you submit a bug +report. Also, please see if it has changed between releases, as we +may be changing the bug reporting mechanism at some time. +

+Please also do as much as you can yourself to help track down the +bug. Samba is maintained by a dedicated group of people who volunteer +their time, skills and efforts. We receive far more mail about it than +we can possibly answer, so you have a much higher chance of an answer +and a fix if you send us a "developer friendly" bug report that lets +us fix it fast. +

+Do not assume that if you post the bug to the comp.protocols.smb +newsgroup or the mailing list that we will read it. If you suspect that your +problem is not a bug but a configuration problem then it is better to send +it to the Samba mailing list, as there are (at last count) 5000 other users on +that list that may be able to help you. +

+You may also like to look though the recent mailing list archives, +which are conveniently accessible on the Samba web pages +at http://samba.org/samba/. +

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 +you've misconfigured something and run testparm to test your config +file for correct syntax. +

+Have you run through the diagnosis? +This is very important. +

+If you include part of a log file with your bug report then be sure to +annotate it with exactly what you were doing on the client at the +time, and exactly what the results were. +

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 +be very useful. Depending on the problem a log level of between 3 and +10 showing the problem may be appropriate. A higher level gives more +detail, but may use too much disk space. +

+To set the debug level use the log level in your +smb.conf. You may also find it useful to set the log +level higher for just one machine and keep separate logs for each machine. +To do this add the following lines to your main smb.conf file: +

log level = 10
log file = /usr/local/samba/lib/log.%m
include = /usr/local/samba/lib/smb.conf.%m

+then create a file +/usr/local/samba/lib/smb.conf.machine where +machine is the name of the client you wish to debug. In that file +put any smb.conf commands you want, for example +log level may be useful. This also allows you to +experiment with different security systems, protocol levels etc on just +one machine. +

+The smb.conf entry log level +is synonymous with the parameter debuglevel that has +been used in older versions of Samba and is being retained for backwards +compatibility of smb.conf files. +

+As the log level value is increased you will record +a significantly increasing level of debugging information. For most +debugging operations you may not need a setting higher than +3. Nearly +all bugs can be tracked at a setting of 10, but be +prepared for a VERY large volume of log data. +

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 +segmentation fault and almost certainly means a bug in Samba (unless +you have faulty hardware or system software). +

+If the message came from smbd then it will probably be accompanied by +a message which details the last SMB message received by smbd. This +info is often very useful in tracking down the problem so please +include it in your bug report. +

+You should also detail how to reproduce the problem, if +possible. Please make this reasonably detailed. +

+You may also find that a core file appeared in a corefiles +subdirectory of the directory where you keep your samba log +files. This file is the most useful tool for tracking down the bug. To +use it you do this: +

+$ gdb smbd core
+

+adding appropriate paths to smbd and core so gdb can find them. If you +don't have gdb then try dbx. Then within the debugger +use the command where to give a stack trace of where the +problem occurred. Include this in your report. +

+If you know any assembly language then do a +disass of the routine +where the problem occurred (if its in a library routine then +disassemble the routine that called it) and try to work out exactly +where the problem is by looking at the surrounding code. Even if you +don't know assembly, including this info in the bug report can be +useful. +

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 +does often). To debug with this sort of system you could try to attach +to the running process using +gdb smbd PID where you get +PID from smbstatus. +Then use c to continue and try to cause the core dump +using the client. The debugger should catch the fault and tell you +where it occurred. +

Patches

+The best sort of bug report is one that includes a fix! If you send us +patches please use diff -u format if your version of +diff supports it, otherwise use diff -c4. Make sure +you do the diff against a clean version of the source and let me know +exactly what version you used. +

diff --git a/docs/htmldocs/compiling.html b/docs/htmldocs/compiling.html new file mode 100644 index 0000000000..95cdb0f581 --- /dev/null +++ b/docs/htmldocs/compiling.html @@ -0,0 +1,200 @@ +Chapter 36. How to compile Samba

Chapter 36. How to compile Samba

Jelmer R. Vernooij

The Samba Team

Andrew Tridgell

Samba Team

22 May 2001

18 March 2003

+You can obtain the samba source from the +samba website. To obtain a development version, +you can download samba from CVS or using rsync. +

Access Samba source code via CVS

Introduction

+Samba is developed in an open environment. Developers use CVS +(Concurrent Versioning System) to "checkin" (also known as +"commit") new source code. Samba's various CVS branches can +be accessed via anonymous CVS using the instructions +detailed in this chapter. +

+This chapter is a modified version of the instructions found at +http://samba.org/samba/cvs.html +

CVS Access to samba.org

+The machine samba.org runs a publicly accessible CVS +repository for access to the source code of several packages, +including samba, rsync, distcc, ccache and jitterbug. There are two main ways +of accessing the CVS server on this host. +

Access via CVSweb

+You can access the source code via your +favourite WWW browser. This allows you to access the contents of +individual files in the repository and also to look at the revision +history and commit logs of individual files. You can also ask for a diff +listing between any two versions on the repository. +

+Use the URL : http://samba.org/cgi-bin/cvsweb +

Access via cvs

+You can also access the source code via a +normal cvs client. This gives you much more control over what you can +do with the repository and allows you to checkout whole source trees +and keep them up to date via normal cvs commands. This is the +preferred method of access if you are a developer and not +just a casual browser. +

+To download the latest cvs source code, point your +browser at the URL : +http://www.cyclic.com/. +and click on the 'How to get cvs' link. CVS is free software under +the GNU GPL (as is Samba). Note that there are several graphical CVS clients +which provide a graphical interface to the sometimes mundane CVS commands. +Links to theses clients are also available from the Cyclic website. +

+To gain access via anonymous cvs use the following steps. +For this example it is assumed that you want a copy of the +samba source code. For the other source code repositories +on this system just substitute the correct package name +

Procedure 36.1. Retrieving samba using CVS

  1. + Install a recent copy of cvs. All you really need is a + copy of the cvs client binary. +

  2. + Run the command +

    + cvs -d :pserver:cvs@samba.org:/cvsroot login +

  3. + When it asks you for a password type cvs. +

  4. + Run the command +

    + cvs -d :pserver:cvs@samba.org:/cvsroot co samba +

    + This will create a directory called samba containing the + latest samba source code (i.e. the HEAD tagged cvs branch). This + currently corresponds to the 3.0 development tree. +

    + CVS branches other then HEAD can be obtained by using the + -r and defining a tag name. A list of branch tag names + can be found on the "Development" page of the samba web site. A common + request is to obtain the latest 3.0 release code. This could be done by + using the following command: +

    + cvs -d :pserver:cvs@samba.org:/cvsroot co -r SAMBA_3_0 samba +

  5. + Whenever you want to merge in the latest code changes use + the following command from within the samba directory: +

    + cvs update -d -P +

Accessing the samba sources via rsync and ftp

+ pserver.samba.org also exports unpacked copies of most parts of the CVS + tree at ftp://pserver.samba.org/pub/unpacked and also via anonymous rsync at + rsync://pserver.samba.org/ftp/unpacked/. I recommend using rsync rather than ftp. + See the rsync homepage for more info on rsync. +

+ The disadvantage of the unpacked trees is that they do not support automatic + merging of local changes like CVS does. rsync access is most convenient + for an initial install. +

Verifying Samba's PGP signature

+In these days of insecurity, it's strongly recommended that you verify the PGP +signature for any source file before installing it. Even if you're not +downloading from a mirror site, verifying PGP signatures should be a +standard reflex. +

+With that said, go ahead and download the following files: +

+$ wget http://us1.samba.org/samba/ftp/samba-2.2.8a.tar.asc
+$ wget http://us1.samba.org/samba/ftp/samba-pubkey.asc
+

+ +The first file is the PGP signature for the Samba source file; the other is the Samba public +PGP key itself. Import the public PGP key with: +

+$ gpg --import samba-pubkey.asc
+

+And verify the Samba source code integrity with: +

+$ gzip -d samba-2.2.8a.tar.gz
+$ gpg --verify samba-2.2.8a.tar.asc
+

+If you receive a message like, "Good signature from Samba Distribution +Verification Key..." +then all is well. The warnings about trust relationships can be ignored. An +example of what you would not want to see would be: +

+ + gpg: BAD signature from "Samba Distribution Verification Key" + +

Building the Binaries

+ To do this, first run the program ./configure + in the source directory. This should automatically + configure Samba for your operating system. If you have unusual + needs then you may wish to run

root# ./configure --help
+

first to see what special options you can enable. + Then executing

root# make

will create the binaries. Once it's successfully + compiled you can use

root# make install

to install the binaries and manual pages. You can + separately install the binaries and/or man pages using

root# make installbin
+

and

root# make installman
+	

Note that if you are upgrading for a previous version + of Samba you might like to know that the old versions of + the binaries will be renamed with a ".old" extension. You + can go back to the previous version with

root# make revert
+

if you find this version a disaster!

Compiling samba with Active Directory support

In order to compile samba with ADS support, you need to have installed + on your system:

  • the MIT kerberos development libraries + (either install from the sources or use a package). The + Heimdal libraries will not work.

  • the OpenLDAP development libraries.

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 it generates contains lines like + this:

+#define HAVE_KRB5 1
+#define HAVE_LDAP 1
+

If it doesn't then configure did not find your krb5 libraries or + your ldap libraries. Look in config.log to figure + out why and fix it.

Installing the required packages for Debian

On Debian you need to install the following packages:

+

  • libkrb5-dev

  • krb5-user

+

Installing the required packages for RedHat

On RedHat this means you should have at least:

+

  • krb5-workstation (for kinit)

  • krb5-libs (for linking with)

  • krb5-devel (because you are compiling from source)

+

in addition to the standard development environment.

Note that these are not standard on a RedHat install, and you may need + to get them off CD2.

Starting the smbd and nmbd

You must choose to start smbd and nmbd either + as daemons or from inetd. Don't try + to do both! Either you can put them in + inetd.conf and have them started on demand + by inetd or xinetd, + or you can start them as + daemons either from the command line or in + /etc/rc.local. See the man pages for details + on the command line options. Take particular care to read + the bit about what user you need to be in order to start + Samba. In many cases you must be root.

The main advantage of starting smbd + and nmbd using the recommended daemon method + is that they will respond slightly more quickly to an initial connection + request.

Starting from inetd.conf

Note

The following will be different if + you use NIS, NIS+ or LDAP to distribute services maps.

Look at your /etc/services. + What is defined at port 139/tcp. If nothing is defined + then add a line like this:

netbios-ssn     139/tcp

similarly for 137/udp you should have an entry like:

netbios-ns	137/udp

Next edit your /etc/inetd.conf + and add two lines something like this:

+		netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd 
+		netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd 
+		

The exact syntax of /etc/inetd.conf + varies between unixes. Look at the other entries in inetd.conf + for a guide.

Some distributions use xinetd instead of inetd. Consult the + xinetd manual for configuration information.

Note

Some unixes already have entries like netbios_ns + (note the underscore) in /etc/services. + You must either edit /etc/services or + /etc/inetd.conf to make them consistent. +

Note

On many systems you may need to use the + interfaces option in smb.conf to specify the IP + address and netmask of your interfaces. Run + ifconfig + as root if you don't know what the broadcast is for your + net. nmbd tries to determine it at run + time, but fails on some unixes. +

Warning

Many unixes only accept around 5 + parameters on the command line in inetd.conf. + This means you shouldn't use spaces between the options and + arguments, or you should use a script, and start the script + from inetd.

Restart inetd, perhaps just send + it a HUP.

+			root# killall -HUP inetd
+		

Alternative: starting it as a daemon

To start the server as a daemon you should create + a script something like this one, perhaps calling + it startsmb.

+		#!/bin/sh
+		/usr/local/samba/bin/smbd -D 
+		/usr/local/samba/bin/nmbd -D 
+		

then make it executable with chmod + +x startsmb

You can then run startsmb by + hand or execute it from /etc/rc.local +

To kill it send a kill signal to the processes + nmbd and smbd.

Note

If you use the SVR4 style init system then + you may like to look at the examples/svr4-startup + script to make Samba fit into that system.

diff --git a/docs/htmldocs/diagnosis.html b/docs/htmldocs/diagnosis.html new file mode 100644 index 0000000000..ea84661d30 --- /dev/null +++ b/docs/htmldocs/diagnosis.html @@ -0,0 +1,287 @@ +Chapter 33. The Samba checklist

Chapter 33. The Samba checklist

Andrew Tridgell

Samba Team

Jelmer R. Vernooij

The Samba Team

Wed Jan 15

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 +is if it fails any one of these steps. If it passes all these tests +then it is probably working fine. +

+You should do ALL the tests, in the order shown. We have tried to +carefully choose them so later tests only use capabilities verified in +the earlier tests. However, do not stop at the first error as there +have been some instances when continuing with the tests has helped +to solve a problem. +

+If you send one of the samba mailing lists an email saying "it doesn't work" +and you have not followed this test procedure then you should not be surprised +if your email is ignored. +

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. +

+The procedure is similar for other types of clients. +

+It is also assumed you know the name of an available share in your +smb.conf. I will assume this share is called tmp. +You can add a tmp share like this by adding the +following to smb.conf: +

Example 33.1. smb.conf with [tmp] share

[tmp]
comment = temporary files
path = /tmp
read only = yes

+

Note

+These tests assume version 3.0 or later of the samba suite. +Some commands shown did not exist in earlier versions. +

+Please pay attention to the error messages you receive. If any error message +reports that your server is being unfriendly you should first check that your +IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf +file points to name servers that really do exist. +

+Also, if you do not have DNS server access for name resolution please check +that the settings for your smb.conf file results in dns proxy = no. The +best way to check this is with testparm smb.conf. +

+It is helpful to monitor the log files during testing by using the +tail -F log_file_name in a separate +terminal console (use ctrl-alt-F1 through F6 or multiple terminals in X). +Relevant log files can be found (for default installations) in +/usr/local/samba/var. Also, connection logs from +machines can be found here or possibly in /var/log/samba +depending on how or if you specified logging in your smb.conf file. +

+If you make changes to your smb.conf file while going through these test, +don't forget to restart smbd and nmbd. +

The tests

Procedure 33.1. Diagnosing your samba server

  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 +configuration file is faulty. +

    Note

    +Your smb.conf file may be located in: /etc/samba +Or in: /usr/local/samba/lib +

  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 +software is not correctly installed. +

    +Note that you will need to start a "dos prompt" window on the PC to +run ping. +

    +If you get a message saying host not found or similar then your DNS +software or /etc/hosts file is not correctly setup. +It is possible to +run samba without DNS entries for the server and client, but I assume +you do have correct entries for the remainder of these tests. +

    +Another reason why ping might fail is if your host is running firewall +software. You will need to relax the rules to let in the workstation +in question, perhaps by allowing access from another subnet (on Linux +this is done via the ipfwadm program.) +

    Note

    +Modern Linux distributions install ipchains/iptables by default. +This is a common problem that is often overlooked. +

  3. +Run the command smbclient -L BIGSERVER on the unix box. You +should get a list of available shares back. +

    +If you get a error message containing the string "Bad password" then +you probably have either an incorrect hosts allow, +hosts deny or valid users line in your +smb.conf, or your guest account is not +valid. Check what your guest account is using testparm and +temporarily remove any hosts allow, hosts deny, valid users or invalid users lines. +

    +If you get a connection refused response then the smbd server may +not be running. If you installed it in inetd.conf then you probably edited +that file incorrectly. If you installed it as a daemon then check that +it is running, and check that the netbios-ssn port is in a LISTEN +state using netstat -a. +

    Note

    + + +Some Unix / Linux systems use xinetd in place of +inetd. Check your system documentation for the location +of the control file/s for your particular system implementation of +this network super daemon. +

    +If you get a session request failed then the server refused the +connection. If it says "Your server software is being unfriendly" then +its probably because you have invalid command line parameters to smbd, +or a similar fatal problem with the initial startup of smbd. Also +check your config file (smb.conf) for syntax errors with testparm +and that the various directories where samba keeps its log and lock +files exist. +

    +There are a number of reasons for which smbd may refuse or decline +a session request. The most common of these involve one or more of +the following smb.conf file entries: +

    hosts deny = ALL
    hosts allow = xxx.xxx.xxx.xxx/yy
    bind interfaces only = Yes

    +In the above, no allowance has been made for any session requests that +will automatically translate to the loopback adapter address 127.0.0.1. +To solve this problem change these lines to: +

    hosts deny = ALL
    hosts allow = xxx.xxx.xxx.xxx/yy 127.

    +Do not use the bind interfaces only parameter where you +may wish to +use the samba password change facility, or where smbclient may need to +access a local service for name resolution or for local resource +connections. (Note: the bind interfaces only parameter deficiency +where it will not allow connections to the loopback address will be +fixed soon). +

    + +Another common cause of these two errors is having something already running +on port 139, such as Samba +(ie: smbd is running from inetd already) or +something like Digital's Pathworks. Check your inetd.conf file before trying +to start smbd as a daemon, it can avoid a lot of frustration! +

    +And yet another possible cause for failure of this test is when the subnet mask +and / or broadcast address settings are incorrect. Please check that the +network interface IP Address / Broadcast Address / Subnet Mask settings are +correct and that Samba has correctly noted these in the log.nmbd file. +

  4. +Run the command nmblookup -B BIGSERVER __SAMBA__. You should get the +IP address of your Samba server back. +

    +If you don't then nmbd is incorrectly installed. Check your inetd.conf +if you run it from there, or that the daemon is running and listening +to udp port 137. +

    +One common problem is that many inetd implementations can't take many +parameters on the command line. If this is the case then create a +one-line script that contains the right parameters and run that from +inetd. +

  5. run the command nmblookup -B ACLIENT '*'

    +You should get the PCs IP address back. If you don't then the client +software on the PC isn't installed correctly, or isn't started, or you +got the name of the PC wrong. +

    +If ACLIENT doesn't resolve via DNS then use the IP address of the +client in the above test. +

  6. +Run the command nmblookup -d 2 '*' +

    +This time we are trying the same as the previous test but are trying +it via a broadcast to the default broadcast address. A number of +NetBIOS / TCP/IP hosts on the network should respond, although Samba may +not catch all of the responses in the short time it listens. You +should see got a positive name query response +messages from several hosts. +

    +If this doesn't give a similar result to the previous test then +nmblookup isn't correctly getting your broadcast address through its +automatic mechanism. In this case you should experiment with the +interfaces option in smb.conf to manually configure your IP +address, broadcast and netmask. +

    +If your PC and server aren't on the same subnet then you will need to +use the -B option to set the broadcast address to that of the PCs +subnet. +

    +This test will probably fail if your subnet mask and broadcast address are +not correct. (Refer to TEST 3 notes above). +

  7. +Run the command smbclient //BIGSERVER/TMP. You should +then be prompted for a password. You should use the password of the account +you are logged into the unix box with. If you want to test with +another account then add the -U accountname option to the end of +the command line. eg: +smbclient //bigserver/tmp -Ujohndoe +

    Note

    +It is possible to specify the password along with the username +as follows: +smbclient //bigserver/tmp -Ujohndoe%secret +

    +Once you enter the password you should get the smb> prompt. If you +don't then look at the error message. If it says invalid network +name then the service "tmp" is not correctly setup in your smb.conf. +

    +If it says bad password then the likely causes are: +

    1. + you have shadow passwords (or some other password system) but didn't + compile in support for them in smbd +

    2. + your valid users configuration is incorrect +

    3. + you have a mixed case password and you haven't enabled the password level option at a high enough level +

    4. + the path line in smb.conf is incorrect. Check it with testparm +

    5. + you enabled password encryption but didn't map unix to samba users. Run

      smbpasswd -a username

      . +

    +Once connected you should be able to use the commands +dir get put etc. +Type help command for instructions. You should +especially check that the amount of free disk space shown is correct +when you type dir. +

  8. +On the PC, type the command net view \\BIGSERVER. You will +need to do this from within a "dos prompt" window. You should get back a +list of available shares on the server. +

    +If you get a network name not found or similar error then netbios +name resolution is not working. This is usually caused by a problem in +nmbd. To overcome it you could do one of the following (you only need +to choose one of them): +

    1. + fixup the nmbd installation +

    2. + add the IP address of BIGSERVER to the wins server box in the + advanced TCP/IP setup on the PC. +

    3. + enable windows name resolution via DNS in the advanced section of + the TCP/IP setup +

    4. + add BIGSERVER to your lmhosts file on the PC. +

    +If you get a invalid network name or bad password error then the +same fixes apply as they did for the smbclient -L test above. In +particular, make sure your hosts allow line is correct (see the man +pages) +

    +Also, do not overlook that fact that when the workstation requests the +connection to the samba server it will attempt to connect using the +name with which you logged onto your Windows machine. You need to make +sure that an account exists on your Samba server with that exact same +name and password. +

    +If you get specified computer is not receiving requests or similar +it probably means that the host is not contactable via tcp services. +Check to see if the host is running tcp wrappers, and if so add an entry in +the hosts.allow file for your client (or subnet, etc.) +

  9. +Run the command net use x: \\BIGSERVER\TMP. You should +be prompted for a password then you should get a command completed +successfully message. If not then your PC software is incorrectly +installed or your smb.conf is incorrect. make sure your hosts allow +and other config lines in smb.conf are correct. +

    +It's also possible that the server can't work out what user name to +connect you as. To see if this is the problem add the line user = username to the [tmp] section of +smb.conf where username is the +username corresponding to the password you typed. If you find this +fixes things you may need the username mapping option. +

    +It might also be the case that your client only sends encrypted passwords +and you have encrypt passwords = no in smb.conf +Turn it back on to fix. +

  10. +Run the command nmblookup -M testgroup where +testgroup is the name of the workgroup that your Samba server and +Windows PCs belong to. You should get back the IP address of the +master browser for that workgroup. +

    +If you don't then the election process has failed. Wait a minute to +see if it is just being slow then try again. If it still fails after +that then look at the browsing options you have set in smb.conf. Make +sure you have preferred master = yes to ensure that +an election is held at startup. +

  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 +specified in smb.conf). You should be able to double click on the name +of the server and get a list of shares. If you get a "invalid +password" error when you do then you are probably running WinNT and it +is refusing to browse a server that has no encrypted password +capability and is in user level security mode. In this case either set +security = server AND +password server = Windows_NT_Machine in your +smb.conf file, or make sure encrypt passwords is +set to "yes". +

diff --git a/docs/htmldocs/domain-member.html b/docs/htmldocs/domain-member.html new file mode 100644 index 0000000000..313c6e0fc7 --- /dev/null +++ b/docs/htmldocs/domain-member.html @@ -0,0 +1,534 @@ +Chapter 7. Domain Membership

Chapter 7. Domain Membership

John H. Terpstra

Samba Team

Jeremy Allison

Samba Team

Gerald (Jerry) Carter

Samba Team

Andrew Tridgell

Samba Team

Jelmer R. Vernooij

The Samba Team

+Domain Membership is a subject of vital concern, Samba must be able to +participate as a member server in a Microsoft Domain security context, and +Samba must be capable of providing Domain machine member trust accounts, +otherwise it would not be capable of offering a viable option for many users. +

+This chapter covers background information pertaining to domain membership, +Samba configuration for it, and MS Windows client procedures for joining a +domain. Why is this necessary? Because both are areas in which there exists +within the current MS Windows networking world and particularly in the +UNIX/Linux networking and administration world, a considerable level of +mis-information, incorrect understanding, and a lack of knowledge. Hopefully +this chapter will fill the voids. +

Features and Benefits

+MS Windows workstations and servers that want to participate in domain security need to +be made Domain members. Participating in Domain security is often called +Single Sign On or SSO for short. This +chapter describes the process that must be followed to make a workstation +(or another server - be it an MS Windows NT4 / 200x +server) or a Samba server a member of an MS Windows Domain security context. +

+Samba-3 can join an MS Windows NT4 style domain as a native member server, an +MS Windows Active Directory Domain as a native member server, or a Samba Domain +Control network. +

+Domain membership has many advantages: +

  • + MS Windows workstation users get the benefit of SSO +

  • + Domain user access rights and file ownership / access controls can be set + from the single Domain SAM (Security Account Manager) database + (works with Domain member servers as well as with MS Windows workstations + that are domain members) +

  • + Only MS Windows NT4 / 200x / XP Professional + workstations that are Domain members + can use network logon facilities +

  • + Domain Member workstations can be better controlled through the use of + Policy files (NTConfig.POL) and Desktop Profiles. +

  • + Through the use of logon scripts, users can be given transparent access to network + applications that run off application servers +

  • + Network administrators gain better application and user access management + abilities because there is no need to maintain user accounts on any network + client or server, other than the central Domain database + (either NT4/Samba SAM style Domain, NT4 Domain that is back ended with an + LDAP directory, or via an Active Directory infrastructure) +

MS Windows Workstation/Server Machine Trust Accounts

+A machine trust account is an account that is used to authenticate a client +machine +(rather than a user) to the Domain Controller server. In Windows terminology, +this is known as a "Computer Account." +

+The password of a machine trust account acts as the shared secret for +secure communication with the Domain Controller. This is a security +feature to prevent an unauthorized machine with the same NetBIOS name +from joining the domain and gaining access to domain user/group +accounts. Windows NT, 200x, XP Professional clients use machine trust +accounts, but Windows 9x / Me / XP Home clients do not. Hence, a +Windows 9x / Me / XP Home client is never a true member of a domain +because it does not possess a machine trust account, and thus has no +shared secret with the domain controller. +

+A Windows NT4 PDC stores each machine trust account in the Windows Registry. +The introduction of MS Windows 2000 saw the introduction of Active Directory, +the new repository for machine trust accounts. +

+A Samba PDC, however, stores each machine trust account in two parts, +as follows: + +

  • + A Domain Security Account (stored in the + passdb backend that has been configured in the + smb.conf file. The precise nature of the account information that is + stored depends on the type of backend database that has been chosen. +

    + The older format of this data is the smbpasswd database + which contains the UNIX login ID, the UNIX user identifier (UID), and the + LanMan and NT encrypted passwords. There is also some other information in + this file that we do not need to concern ourselves with here. +

    + The two newer database types are called ldapsam, + tdbsam. Both store considerably more data than the + older smbpasswd file did. The extra information + enables new user account controls to be used. +

  • + A corresponding UNIX account, typically stored in + /etc/passwd. Work is in progress to allow a + simplified mode of operation that does not require UNIX user accounts, but + this may not be a feature of the early releases of Samba-3. +

+

+There are three ways to create machine trust accounts: +

  • + Manual creation from the UNIX/Linux command line. Here, both the Samba and + corresponding UNIX account are created by hand. +

  • + + Using the MS Windows NT4 Server Manager (either from an NT4 Domain member + server, or using the Nexus toolkit available from the Microsoft web site. + This tool can be run from any MS Windows machine so long as the user is + logged on as the administrator account. +

  • + "On-the-fly" creation. The Samba machine trust account is automatically + created by Samba at the time the client is joined to the domain. + (For security, this is the recommended method.) The corresponding UNIX + account may be created automatically or manually. +

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 /etc/passwd. +This can be done using vipw or another 'add user' command +that is normally used to create new UNIX accounts. The following is an example for a Linux based Samba server: + + + + +

+

+root# /usr/sbin/useradd -g 100 -d /dev/null -c "machine nickname" \
+   -s /bin/false machine_name$ 
+
+root# passwd -l machine_name$
+

+

+ +On *BSD systems, this can be done using the chpass utility: +

+

+root# chpass -a \
+  "machine_name$:*:101:100::0:0:Workstation machine_name:/dev/null:/sbin/nologin"
+

+

+The /etc/passwd entry will list the machine name +with a "$" appended, won't have a password, will have a null shell and no +home directory. For example a machine named 'doppy' would have an +/etc/passwd entry like this: +

+doppy$:x:505:100:machine_nickname:/dev/null:/bin/false
+

+Above, machine_nickname can be any +descriptive name for the client, i.e., BasementComputer. +machine_name absolutely must be the NetBIOS +name of the client to be joined to the domain. The "$" must be +appended to the NetBIOS name of the client or Samba will not recognize +this as a machine trust account. +

+Now that the corresponding UNIX account has been created, the next step is to create +the Samba account for the client containing the well-known initial +machine trust account password. This can be done using the +smbpasswd command +as shown here: +

+

+root# smbpasswd -a -m machine_name
+

+

+where machine_name is the machine's NetBIOS +name. The RID of the new machine account is generated from the UID of +the corresponding UNIX account. +

Join the client to the domain immediately

+ Manually creating a machine trust account using this method is the + equivalent of creating a machine trust account on a Windows NT PDC using + + the Server Manager. From the time at which the + account is created to the time which the client joins the domain and + changes the password, your domain is vulnerable to an intruder joining + your domain using a machine with the same NetBIOS name. A PDC inherently + trusts members of the domain and will serve out a large degree of user + information to such clients. You have been warned! +

Using NT4 Server Manager to Add Machine Accounts to the Domain

+If the machine from which you are trying to manage the domain is an +MS Windows NT4 workstation or MS Windows 200x / XP Professional +then the tool of choice is the package called SRVTOOLS.EXE. +When executed in the target directory this will unpack SrvMge.exe +and UsrMgr.exe (both are domain management tools for MS Windows NT4 workstation). +

+If your workstation is a Microsoft Windows 9x/Me family product + you should download the Nexus.exe package from the Microsoft web site. +When executed from the target directory this will unpack the same tools but for use on +this platform. +

+Further information about these tools may be obtained from the following locations: +http://support.microsoft.com/default.aspx?scid=kb;en-us;173673 +http://support.microsoft.com/default.aspx?scid=kb;en-us;172540 +

+Launch the srvmgr.exe (Server Manager for Domains) and follow these steps: +

Procedure 7.1. Server Manager Account Machine Account Management

  1. + From the menu select Computer +

  2. + Click on Select Domain +

  3. + Click on the name of the domain you wish to administer in the + Select Domain panel and then click + OK. +

  4. + Again from the menu select Computer +

  5. + Select Add to Domain +

  6. + In the dialog box, click on the radio button to + Add NT Workstation of Server, then + enter the machine name in the field provided, then click the + Add button. +

"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 +is joined to the domain. +

Since each Samba machine trust account requires a corresponding UNIX account, a method +for automatically creating the UNIX account is usually supplied; this requires configuration of the +add machine script option in +smb.conf. This method is not required, however; corresponding UNIX +accounts may also be created manually. +

+Below is an example for a RedHat Linux system. +

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

Making an MS Windows Workstation or Server a Domain Member

+The procedure for making an MS Windows workstation of server a member of the domain varies +with the version of Windows: +

Windows 200x XP Professional

+ When the user elects to make the client a domain member, Windows 200x prompts for + an account and password that has privileges to create machine accounts in the domain. + A Samba administrative account (i.e., a Samba account that has root privileges on the + Samba server) must be entered here; the operation will fail if an ordinary user + account is given. +

+ Note: For security reasons the password for this administrative account should be set + to a password that is other than that used for the root user in the + /etc/passwd. +

+ The name of the account that is used to create domain member machine accounts can be + anything the network administrator may choose. If it is other than root + then this is easily mapped to root using the file pointed to be the smb.conf parameter + username map = /etc/samba/smbusers. +

+ The session key of the Samba administrative account acts as an + encryption key for setting the password of the machine trust + account. The machine trust account will be created on-the-fly, or + updated if it already exists. +

Windows NT4

+ If the machine trust account was created manually, on the + Identification Changes menu enter the domain name, but do not + check the box Create a Computer Account in the Domain. + In this case, the existing machine trust account is used to join the machine + to the domain. +

+ If the machine trust account is to be created + on-the-fly, on the Identification Changes menu enter the domain + name, and check the box Create a Computer Account in the + Domain. In this case, joining the domain proceeds as above + for Windows 2000 (i.e., you must supply a Samba administrative account when + prompted). +

Samba

Joining a Samba client to a domain is documented in + the domain member chapter. +

Domain Member Server

+This mode of server operation involves the Samba machine being made a member +of a domain security context. This means by definition that all user +authentication will be done from a centrally defined authentication regime. +The authentication regime may come from an NT3/4 style (old domain technology) +server, or it may be provided from an Active Directory server (ADS) running on +MS Windows 2000 or later. +

+ +Of course it should be clear that the authentication back end itself could be +from any distributed directory architecture server that is supported by Samba. +This can be LDAP (from OpenLDAP), or Sun's iPlanet, of NetWare Directory +Server, etc. + +

+Please refer to the chapter on setting up a PDC +for more information regarding how to create a domain +machine account for a domain member server as well as for information +regarding how to enable the Samba domain member machine to join the domain and +to be fully trusted by it. +

Joining an NT4 type Domain with Samba-3

+

Table 7.1. Assumptions

NetBIOS name:SERV1
Win2K/NT domain name:MIDEARTH
Domain's PDC NetBIOS name:DOMPDC
Domain's BDC NetBIOS names:DOMBDC1 and DOMBDC2

+

+First, you must edit your smb.conf file to tell Samba it should +now use domain security. +

+ Change (or add) your + security line in the [global] section +of your smb.conf to read: +

+

security = domain

+

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

+

workgroup = MIDEARTH

+

+as this is the name of the domain we are joining. +

+You must also have the parameter +encrypt passwords set to yes + in order for your users to authenticate to the NT PDC. +

+Finally, add (or modify) a password server line in the [global] +section to read: +

+

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 rpc join -S DOMPDC -UAdministrator%password
+

+

+If the -S DOMPDC argument is not given then +the domain name will be obtained from smb.conf. +

+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, we use it for the -S option. +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 man page for more details. +

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

+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/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. +

+Finally, restart your Samba daemons and get ready for +clients to begin using domain security! The way you can restart your +samba daemons depends on your distribution, but in most cases running +

+	root# /etc/init.d/samba restart
+

+does the job. +

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 +to your server. This means that if domain user DOM\fred + attaches to your domain security Samba server, there needs +to be a local UNIX user fred to represent that user in the UNIX +filesystem. This is very similar to the older Samba security mode +security = server, +where Samba would pass through the authentication request to a Windows +NT server in the same way as a Windows 95 or Windows 98 server would. +

+ Please refer to the chapter on winbind for information on a system +to automatically assign UNIX uids and gids to Windows NT Domain users and groups. +

+The advantage to domain-level security is that the +authentication in domain-level security is passed down the authenticated +RPC channel in exactly the same way that an NT server would do it. This +means Samba servers now participate in domain trust relationships in +exactly the same way NT servers do (i.e., you can add Samba servers into +a resource domain and have the authentication passed on from a resource +domain PDC to an account domain PDC). +

+In addition, with security = server every Samba +daemon on a server has to keep a connection open to the +authenticating server for as long as that daemon lasts. This can drain +the connection resources on a Microsoft NT server and cause it to run +out of available connections. With security = domain, +however, the Samba daemons connect to the PDC/BDC only for as long +as is necessary to authenticate the user, and then drop the connection, +thus conserving PDC connection resources. +

+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. +

Note

+Much of the text of this document +was first published in the Web magazine +LinuxWorld as the article Doing +the NIS/NT Samba. +

Samba ADS Domain Membership

+This is a rough guide to setting up Samba 3.0 with Kerberos authentication against a +Windows2000 KDC. A familiarity with Kerberos is assumed. +

Setup your smb.conf

+You must use at least the following 3 options in smb.conf: +

realm = your.kerberos.REALM
security = ADS
encrypt passwords = yes

+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

+

Note

+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. It is expected that the above +required options will change soon when active directory integration will get +better. +

Setup your /etc/krb5.conf

+The minimal configuration for krb5.conf is: +

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

+Test your config by doing a kinit +USERNAME@REALM and +making sure that your password is accepted by the Win2000 KDC. +

Note

+The realm must be uppercase or you will get Cannot find KDC for +requested realm while getting initial credentials error (Kerberos +is case-sensitive!). +

Note

+Time between the two servers must be synchronized. You will get a +kinit(v5): Clock skew too great while getting initial credentials +if the time difference is more than five minutes. +

+You also must ensure that you can do a reverse DNS lookup on the IP +address of your KDC. Also, the name that this reverse lookup maps to +must either be the NetBIOS name of the KDC (ie. the hostname with no +domain attached) or it can alternatively be the NetBIOS name +followed by the realm. +

+The easiest way to ensure you get this right is to add a +/etc/hosts entry mapping the IP address of your KDC to +its NetBIOS name. If you don't get this right then you will get a +local error when you try to join the realm. +

+If all you want is Kerberos support in smbclient then you can skip +straight to Test with smbclient now. +Creating a computer account +and testing your servers +is only needed if you want Kerberos support for smbd and winbindd. +

Create the computer account

+As a user that has write permission on the Samba private directory +(usually root) run: +

+root#  net ads join -U Administrator%password
+

+

Possible errors

+

ADS support not compiled in

Samba must be reconfigured (remove config.cache) and recompiled + (make clean all install) after the Kerberos libs and headers are installed. +

net ads join prompts for user name

You need to login to the domain using kinit + USERNAME@REALM. + USERNAME must be a user who has rights to add a machine + to the domain.

+

Test your server setup

+If the join was successful, you will see a new computer account with the +NetBIOS name of your Samba server in Active Directory (in the "Computers" +folder under Users and Computers. +

+On a Windows 2000 client try net use * \\server\share. You should +be logged in with Kerberos without needing to know a password. If +this fails then run klist tickets. Did you get a ticket for the +server? Does it have an encoding type of DES-CBC-MD5 ? +

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 +specify the -k option to choose Kerberos authentication. +

Notes

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

+W2k doesn't seem to create the _kerberos._udp and _ldap._tcp in +their defaults DNS setup. Maybe this will be fixed later in service packs. +

Common Errors

+In the process of adding / deleting / re-adding domain member machine accounts there are +many traps for the unwary player and there are many “little” things that can go wrong. +It is particularly interesting how often subscribers on the samba mailing list have concluded +after repeated failed attempts to add a machine account that it is necessary to "re-install" +MS Windows on t he machine. In truth, it is seldom necessary to reinstall because of this type +of problem. The real solution is often very simple, and with understanding of how MS Windows +networking functions easy to overcome. +

Can Not Add Machine Back to Domain

+“ A Windows workstation was reinstalled. The original domain machine +account was deleted and added immediately. The workstation will not join the domain if I use +the same machine name. Attempts to add the machine fail with a message that the machine already +exists on the network - I know it doesn't. Why is this failing?” +

+The original name is still in the NetBIOS name cache and must expire after machine account +deletion BEFORE adding that same name as a domain member again. The best advice is to delete +the old account and then to add the machine with a new name. +

Adding Machine to Domain Fails

+ “Adding a Windows 200x or XP Professional machine to the Samba PDC Domain fails with a +message that, The machine could not be added at this time, there is a network problem. + Please try again later. Why?” +

+You should check that there is an add machine script in your smb.conf +file. If there is not, please add one that is appropriate for your OS platform. If a script +has been defined you will need to debug it's operation. Increase the log level +in the smb.conf file to level 10, then try to rejoin the domain. Check the logs to see which +operation is failing. +

+Possible causes include: +

  • + The script does not actually exist, or could not be located in the path specified. +

    + Corrective Action: Fix it. Make sure that when run manually + that the script will add both the UNIX system account _and_ the Samba SAM account. +

  • + The machine could not be added to the UNIX system accounts file /etc/passwd +

    + Corrective Action: Check that the machine name is a legal UNIX + system account name. ie: If the UNIX utility useradd is called + then make sure that the machine name you are trying to add can be added using this + tool. Useradd on some systems will not allow any upper case characters + nor will it allow spaces in the name. +

I can't join a Windows 2003 PDC

Windows 2003 requires SMB signing. Client side SMB signing has + only been implemented partially in Samba 3.0. Set client use spnego = no when communicating + with a windows 2003 server.

diff --git a/docs/htmldocs/groupmapping.html b/docs/htmldocs/groupmapping.html new file mode 100644 index 0000000000..39d317e8cf --- /dev/null +++ b/docs/htmldocs/groupmapping.html @@ -0,0 +1,196 @@ +Chapter 12. Mapping MS Windows and UNIX Groups

Chapter 12. Mapping MS Windows and UNIX Groups

Jean François Micouleau

Gerald (Jerry) Carter

Samba Team

John H. Terpstra

Samba Team

+ Starting with Samba-3, new group mapping functionality is available to create associations + between Windows group SIDs and UNIX groups. The groupmap subcommand + included with the net tool can be used to manage these associations. +

Warning

+ The first immediate reason to use the group mapping on a Samba PDC, is that + + the domain admin group has been removed and should no longer + be specified in smb.conf. This parameter was used to give the listed users membership + in the Domain Admins Windows group which gave local admin rights on their workstations + (in default configurations). +

Features and Benefits

+ Samba allows the administrator to create MS Windows NT4 / 200x group accounts and to + arbitrarily associate them with UNIX/Linux group accounts. +

+ Group accounts can be managed using the MS Windows NT4 or MS Windows 200x / XP Professional MMC tools. + Appropriate interface scripts should be provided in smb.conf if it is desired that UNIX / Linux system + accounts should be automatically created when these tools are used. In the absence of these scripts, and + so long as winbind is running, Samba accounts group accounts that are created using these tools will be + allocated UNIX UIDs/GIDs from the parameters set by the idmap uid/idmap gid settings + in the smb.conf file. +

Figure 12.1. IDMAP groups

IDMAP groups

+ Administrators should be aware that where smb.conf group interface scripts make + direct calls to the UNIX/Linux system tools (eg: the shadow utilities, groupadd, + groupdel, groupmod) then the resulting UNIX/Linux group names will be subject + to any limits imposed by these tools. If the tool does NOT allow upper case characters + or space characters, then the creation of an MS Windows NT4 / 200x style group of + Engineering Managers will attempt to create an identically named + UNIX/Linux group, an attempt that will of course fail! +

+ There are several possible work-arounds for the operating system tools limitation. One + method is to use a script that generates a name for the UNIX/Linux system group that + fits the operating system limits, and that then just passes the UNIX/Linux group id (GID) + back to the calling Samba interface. This will provide a dynamic work-around solution. +

+ Another work-around is to manually create a UNIX/Linux group, then manually create the + MS Windows NT4 / 200x group on the Samba server and then use the net groupmap + tool to connect the two to each other. +

Discussion

+ When installing MS Windows NT4 / 200x on a computer, the installation + program creates default users and groups, notably the Administrators group, + and gives that group privileges necessary privileges to perform essential system tasks. + eg: Ability to change the date and time or to kill (or close) any process running on the + local machine. +

+ The 'Administrator' user is a member of the 'Administrators' group, and thus inherits + 'Administrators' group privileges. If a 'joe' user is created to be a member of the + 'Administrator' group, 'joe' has exactly the same rights as 'Administrator'. +

+ When an MS Windows NT4 / W200x is made a domain member, the "Domain Admins" group of the + PDC is added to the local 'Administrators' group of the workstation. Every member of the + 'Domain Administrators' group inherits the rights of the local 'Administrators' group when + logging on the workstation. +

+ The following steps describe how to make Samba PDC users members of the 'Domain Admins' group? +

  1. + create a unix group (usually in /etc/group), let's call it domadm +

  2. add to this group the users that must be Administrators. For example + if you want joe, john and mary, your entry in /etc/group will + look like: +

    +		domadm:x:502:joe,john,mary
    +		

    +

  3. + Map this domadm group to the "Domain Admins" group by running the command: +

    +

    +root# net groupmap add ntgroup="Domain Admins" unixgroup=domadm
    +

    +

    + The quotes around "Domain Admins" are necessary due to the space in the group name. + Also make sure to leave no whitespace surrounding the equal character (=). +

+ Now joe, john and mary are domain administrators! +

+ It is possible to map any arbitrary UNIX group to any Windows NT4 / 200x group as well as + making any UNIX group a Windows domain group. For example, if you wanted to include a + UNIX group (e.g. acct) in a ACL on a local file or printer on a domain member machine, + you would flag that group as a domain group by running the following on the Samba PDC: +

+

+root# net groupmap add rid=1000 ntgroup="Accounting" unixgroup=acct
+

+

+ Be aware that the RID parameter is a unsigned 32 bit integer that should + normally start at 1000. However, this rid must not overlap with any RID assigned + to a user. Verifying this is done differently depending on the passdb backend + you are using. Future versions of the tools may perform the verification automatically, + but for now the burden is on you. +

Example Configuration

+ You can list the various groups in the mapping database by executing + net groupmap list. Here is an example: +

+

+root#  net groupmap list
+System Administrators (S-1-5-21-2547222302-1596225915-2414751004-1002) -> sysadmin
+Domain Admins (S-1-5-21-2547222302-1596225915-2414751004-512) -> domadmin
+Domain Users (S-1-5-21-2547222302-1596225915-2414751004-513) -> domuser
+Domain Guests (S-1-5-21-2547222302-1596225915-2414751004-514) -> domguest
+

+

+ For complete details on net groupmap, refer to the net(8) man page. +

Configuration Scripts

+ Everyone needs tools. Some of us like to create our own, others prefer to use canned tools + (ie: prepared by someone else for general use). +

Sample smb.conf add group script

+ A script to create complying group names for use by the Samba group interfaces: +

+

Example 12.1. smbgrpadd.sh

+
+#!/bin/bash
+
+# Add the group using normal system groupadd tool.
+groupadd smbtmpgrp00
+
+thegid=`cat /etc/group | grep smbtmpgrp00 | cut -d ":" -f3`
+
+# Now change the name to what we want for the MS Windows networking end
+cp /etc/group /etc/group.bak
+cat /etc/group.bak | sed s/smbtmpgrp00/$1/g > /etc/group
+
+# Now return the GID as would normally happen.
+echo $thegid
+exit 0
+

+

+ The smb.conf entry for the above script would look like: +

add group script = /path_to_tool/smbgrpadd.sh %g

+

Script to configure Group Mapping

+ In our example we have created a UNIX/Linux group called ntadmin. + Our script will create the additional groups Orks, Elves, Gnomes: +

+

+#!/bin/bash
+
+net groupmap modify ntgroup="Domain Admins" unixgroup=ntadmin
+net groupmap modify ntgroup="Domain Users" unixgroup=users
+net groupmap modify ntgroup="Domain Guests" unixgroup=nobody
+net groupmap modify ntgroup="Administrators" unixgroup=root
+net groupmap modify ntgroup="Users" unixgroup=users
+net groupmap modify ntgroup="Guests" unixgroup=nobody
+net groupmap modify ntgroup="System Operators" unixgroup=sys
+net groupmap modify ntgroup="Account Operators" unixgroup=root
+net groupmap modify ntgroup="Backup Operators" unixgroup=bin
+net groupmap modify ntgroup="Print Operators" unixgroup=lp
+net groupmap modify ntgroup="Replicators" unixgroup=daemon
+net groupmap modify ntgroup="Power Users" unixgroup=sys
+
+groupadd Orks
+groupadd Elves
+groupadd Gnomes
+
+net groupmap add ntgroup="Orks"       unixgroup=Orks         type=d
+net groupmap add ntgroup="Elves"      unixgroup=Elves        type=d
+net groupmap add ntgroup="Gnomes"     unixgroup=Gnomes       type=d
+

+

+ Of course it is expected that the administrator will modify this to suit local needs. + For information regarding the use of the net groupmap tool please + refer to the man page. +

Common Errors

+At this time there are many little surprises for the unwary administrator. In a real sense +it is imperative that every step of automated control scripts must be carefully tested +manually before putting them into active service. +

Adding Groups Fails

+ This is a common problem when the groupadd is called directly + by the Samba interface script for the add group script in + the smb.conf file. +

+ The most common cause of failure is an attempt to add an MS Windows group account + that has either an upper case character and/or a space character in it. +

+ There are three possible work-arounds. Firstly, use only group names that comply + with the limitations of the UNIX/Linux groupadd system tool. + The second involves use of the script mentioned earlier in this chapter, and the + third option is to manually create a UNIX/Linux group account that can substitute + for the MS Windows group name, then use the procedure listed above to map that group + to the MS Windows group. +

Adding MS Windows Groups to MS Windows Groups Fails

+ Samba-3 does NOT support nested groups from the MS Windows control environment. +

Adding Domain Users to the Power Users group

+ What must I do to add Domain Users to the Power Users group? +

+ The Power Users group is a group that is local to each Windows + 200x / XP Professional workstation. You can not add the Domain Users group to the Power Users + group automatically, this must be done on each workstation by logging in as the local workstation + administrator and then using click on Start / Control Panel / Users and Passwords + now click on the 'Advanced' tab, then on the 'Advanced' Button. +

+ Now click on 'Groups', then double click on 'Power Users'. This will launch the panel to add users + or groups to the local machine 'Power Uses' group. Click on the 'Add' button, select the domain + from which the 'Domain Users' group is to be added, double click on the 'Domain Users' group, then + click on the 'Ok' button. Note: If a logon box is presented during this process please remember to + enter the connect as DOMAIN\UserName. ie: For the domain MIDEARTH and the user 'root' enter + MIDEARTH\root. +

diff --git a/docs/htmldocs/integrate-ms-networks.html b/docs/htmldocs/integrate-ms-networks.html new file mode 100644 index 0000000000..73971d2a72 --- /dev/null +++ b/docs/htmldocs/integrate-ms-networks.html @@ -0,0 +1,415 @@ +Chapter 26. Integrating MS Windows networks with Samba

Chapter 26. Integrating MS Windows networks with Samba

John H. Terpstra

Samba Team

(Jan 01 2001)

+This section deals with NetBIOS over TCP/IP name to IP address resolution. If +your MS Windows clients are NOT configured to use NetBIOS over TCP/IP then this +section does not apply to your installation. If your installation involves use of +NetBIOS over TCP/IP then this section may help you to resolve networking problems. +

Note

+ NetBIOS over TCP/IP has nothing to do with NetBEUI. NetBEUI is NetBIOS + over Logical Link Control (LLC). On modern networks it is highly advised + to NOT run NetBEUI at all. Note also that there is NO such thing as + NetBEUI over TCP/IP - the existence of such a protocol is a complete + and utter mis-apprehension. +

Features and Benefits

+Many MS Windows network administrators have never been exposed to basic TCP/IP +networking as it is implemented in a UNIX/Linux operating system. Likewise, many UNIX and +Linux administrators have not been exposed to the intricacies of MS Windows TCP/IP based +networking (and may have no desire to be either). +

+This chapter gives a short introduction to the basics of how a name can be resolved to +it's IP address for each operating system environment. +

Background Information

+Since the introduction of MS Windows 2000 it is possible to run MS Windows networking +without the use of NetBIOS over TCP/IP. NetBIOS over TCP/IP uses UDP port 137 for NetBIOS +name resolution and uses TCP port 139 for NetBIOS session services. When NetBIOS over +TCP/IP is disabled on MS Windows 2000 and later clients then only TCP port 445 will be +used and UDP port 137 and TCP port 139 will not. +

Note

+When using Windows 2000 or later clients, if NetBIOS over TCP/IP is NOT disabled, then +the client will use UDP port 137 (NetBIOS Name Service, also known as the Windows Internet +Name Service or WINS), TCP port 139 AND TCP port 445 (for actual file and print traffic). +

+When NetBIOS over TCP/IP is disabled the use of DNS is essential. Most installations that +disable NetBIOS over TCP/IP today use MS Active Directory Service (ADS). ADS requires + +Dynamic DNS with Service Resource Records (SRV RR) and with Incremental Zone Transfers (IXFR). + +Use of DHCP with ADS is recommended as a further means of maintaining central control +over client workstation network configuration. +

Name Resolution in a pure UNIX/Linux world

+The key configuration files covered in this section are: +

  • /etc/hosts

  • /etc/resolv.conf

  • /etc/host.conf

  • /etc/nsswitch.conf

/etc/hosts

+Contains a static list of IP addresses and names. +eg: +

+127.0.0.1	localhost localhost.localdomain
+192.168.1.1	bigbox.caldera.com	bigbox	alias4box
+

+The purpose of /etc/hosts is to provide a +name resolution mechanism so that uses do not need to remember +IP addresses. +

+Network packets that are sent over the physical network transport +layer communicate not via IP addresses but rather using the Media +Access Control address, or MAC address. IP addresses are currently +32 bits in length and are typically presented as four (4) decimal +numbers that are separated by a dot (or period). eg: 168.192.1.1. +

+MAC Addresses use 48 bits (or 6 bytes) and are typically represented +as two digit hexadecimal numbers separated by colons. eg: +40:8e:0a:12:34:56 +

+Every network interface must have an MAC address. Associated with +a MAC address there may be one or more IP addresses. There is NO +relationship between an IP address and a MAC address, all such assignments +are arbitrary or discretionary in nature. At the most basic level all +network communications takes place using MAC addressing. Since MAC +addresses must be globally unique, and generally remains fixed for +any particular interface, the assignment of an IP address makes sense +from a network management perspective. More than one IP address can +be assigned per MAC address. One address must be the primary IP address, +this is the address that will be returned in the ARP reply. +

+When a user or a process wants to communicate with another machine +the protocol implementation ensures that the "machine name" or "host +name" is resolved to an IP address in a manner that is controlled +by the TCP/IP configuration control files. The file +/etc/hosts is one such file. +

+When the IP address of the destination interface has been +determined a protocol called ARP/RARP is used to identify +the MAC address of the target interface. ARP stands for Address +Resolution Protocol, and is a broadcast oriented method that +uses UDP (User Datagram Protocol) to send a request to all +interfaces on the local network segment using the all 1's MAC +address. Network interfaces are programmed to respond to two +MAC addresses only; their own unique address and the address +ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will +contain the MAC address and the primary IP address for each +interface. +

+The /etc/hosts file is foundational to all +UNIX/Linux TCP/IP installations and as a minimum will contain +the localhost and local network interface IP addresses and the +primary names by which they are known within the local machine. +This file helps to prime the pump so that a basic level of name +resolution can exist before any other method of name resolution +becomes available. +

/etc/resolv.conf

+This file tells the name resolution libraries: +

  • The name of the domain to which the machine + belongs +

  • The name(s) of any domains that should be + automatically searched when trying to resolve unqualified + host names to their IP address +

  • The name or IP address of available Domain + Name Servers that may be asked to perform name to address + translation lookups +

/etc/host.conf

+/etc/host.conf is the primary means by +which the setting in /etc/resolv.conf may be affected. It is a +critical configuration file. This file controls the order by +which name resolution may proceed. The typical structure is: +

+order hosts,bind
+multi on
+

+then both addresses should be returned. Please refer to the +man page for host.conf for further details. +

/etc/nsswitch.conf

+This file controls the actual name resolution targets. The +file typically has resolver object specifications as follows: +

+# /etc/nsswitch.conf
+#
+# Name Service Switch configuration file.
+#
+
+passwd:		compat
+# Alternative entries for password authentication are:
+# passwd:	compat files nis ldap winbind
+shadow:		compat
+group:		compat
+
+hosts:		files nis dns
+# Alternative entries for host name resolution are:
+# hosts:	files dns nis nis+ hesiod db compat ldap wins
+networks:	nis files dns
+
+ethers:		nis files
+protocols:	nis files
+rpc:		nis files
+services:	nis files
+

+Of course, each of these mechanisms requires that the appropriate +facilities and/or services are correctly configured. +

+It should be noted that unless a network request/message must be +sent, TCP/IP networks are silent. All TCP/IP communications assumes a +principal of speaking only when necessary. +

+Starting with version 2.2.0 samba has Linux support for extensions to +the name service switch infrastructure so that linux clients will +be able to obtain resolution of MS Windows NetBIOS names to IP +Addresses. To gain this functionality Samba needs to be compiled +with appropriate arguments to the make command (i.e.: make +nsswitch/libnss_wins.so). The resulting library should +then be installed in the /lib directory and +the "wins" parameter needs to be added to the "hosts:" line in +the /etc/nsswitch.conf file. At this point it +will be possible to ping any MS Windows machine by its NetBIOS +machine name, so long as that machine is within the workgroup to +which both the samba machine and the MS Windows machine belong. +

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 +the "computer name", "machine name", "networking name", "netbios name", +or "SMB name". All terms mean the same thing with the exception of +"netbios name" which can apply also to the name of the workgroup or the +domain name. The terms "workgroup" and "domain" are really just a +simple name with which the machine is associated. All NetBIOS names +are exactly 16 characters in length. The 16th character is reserved. +It is used to store a one byte value that indicates service level +information for the NetBIOS name that is registered. A NetBIOS machine +name is therefore registered for each service type that is provided by +the client/server. +

+The following are typical NetBIOS name/service type registrations: +

Table 26.1. 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

Table 26.2. 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 +names as per the above. This is in vast contrast to TCP/IP +installations where traditionally the system administrator will +determine in the /etc/hosts or in the DNS database what names +are associated with each IP address. +

+One further point of clarification should be noted, the /etc/hosts +file and the DNS records do not provide the NetBIOS name type information +that MS Windows clients depend on to locate the type of service that may +be needed. An example of this is what happens when an MS Windows client +wants to locate a domain logon server. It finds 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 +IP address that is returned in the enumerated list of IP addresses. +Whichever machine first replies then ends up providing the logon services. +

+The name "workgroup" or "domain" really can be confusing since these +have the added significance of indicating what is the security +architecture of the MS Windows network. The term "workgroup" indicates +that the primary nature of the network environment is that of a +peer-to-peer design. In a WORKGROUP all machines are responsible for +their own security, and generally such security is limited to use of +just a password (known as SHARE MODE security). In most situations +with peer-to-peer networking the users who control their own machines +will simply opt to have no security at all. It is possible to have +USER MODE security in a WORKGROUP environment, thus requiring use +of a user name and a matching password. +

+MS Windows networking is thus predetermined to use machine names +for all local and remote machine message passing. The protocol used is +called Server Message Block (SMB) and this is implemented using +the NetBIOS protocol (Network Basic Input Output System). NetBIOS can +be encapsulated using LLC (Logical Link Control) protocol - in which case +the resulting protocol is called NetBEUI (Network Basic Extended User +Interface). NetBIOS can also be run over IPX (Internetworking Packet +Exchange) protocol as used by Novell NetWare, and it can be run +over TCP/IP protocols - in which case the resulting protocol is called +NBT or NetBT, the NetBIOS over TCP/IP. +

+MS Windows machines use a complex array of name resolution mechanisms. +Since we are primarily concerned with TCP/IP this demonstration is +limited to this area. +

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 +machines that that machine has communicated with over the +past 10-15 minutes. It is more efficient to obtain an IP address +for a machine from the local cache than it is to go through all the +configured name resolution mechanisms. +

+If a machine whose name is in the local name cache has been shut +down before the name had been expired and flushed from the cache, then +an attempt to exchange a message with that machine will be subject +to time-out delays. i.e.: Its name is in the cache, so a name resolution +lookup will succeed, but the machine can not respond. This can be +frustrating for users - but it is a characteristic of the protocol. +

+The MS Windows utility that allows examination of the NetBIOS +name cache is called "nbtstat". The Samba equivalent of this +is called nmblookup. +

The LMHOSTS file

+This file is usually located in MS Windows NT 4.0 or +2000 in C:\WINNT\SYSTEM32\DRIVERS\ETC and contains +the IP Address and the machine name in matched pairs. The +LMHOSTS file performs NetBIOS name +to IP address mapping. +

+It typically looks like: +

+# Copyright (c) 1998 Microsoft Corp.
+#
+# This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
+# over TCP/IP) stack for Windows98
+#
+# This file contains the mappings of IP addresses to NT computernames
+# (NetBIOS) names.  Each entry should be kept on an individual line.
+# The IP address should be placed in the first column followed by the
+# corresponding computername. The address and the computername
+# should be separated by at least one space or tab. The "#" character
+# is generally used to denote the start of a comment (see the exceptions
+# below).
+#
+# This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
+# files and offers the following extensions:
+#
+#      #PRE
+#      #DOM:<domain>
+#      #INCLUDE <filename>
+#      #BEGIN_ALTERNATE
+#      #END_ALTERNATE
+#      \0xnn (non-printing character support)
+#
+# Following any entry in the file with the characters "#PRE" will cause
+# the entry to be preloaded into the name cache. By default, entries are
+# not preloaded, but are parsed only after dynamic name resolution fails.
+#
+# Following an entry with the "#DOM:<domain>" tag will associate the
+# entry with the domain specified by <domain>. This affects how the
+# browser and logon services behave in TCP/IP environments. To preload
+# the host name associated with #DOM entry, it is necessary to also add a
+# #PRE to the line. The <domain> is always preloaded although it will not
+# be shown when the name cache is viewed.
+#
+# Specifying "#INCLUDE <filename>" will force the RFC NetBIOS (NBT)
+# software to seek the specified <filename> and parse it as if it were
+# local. <filename> is generally a UNC-based name, allowing a
+# centralized lmhosts file to be maintained on a server.
+# It is ALWAYS necessary to provide a mapping for the IP address of the
+# server prior to the #INCLUDE. This mapping must use the #PRE directive.
+# In addition the share "public" in the example below must be in the
+# LanManServer list of "NullSessionShares" in order for client machines to
+# be able to read the lmhosts file successfully. This key is under
+# \machine\system\currentcontrolset\services\lanmanserver\
+# parameters\nullsessionshares
+# in the registry. Simply add "public" to the list found there.
+#
+# The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
+# statements to be grouped together. Any single successful include
+# will cause the group to succeed.
+#
+# Finally, non-printing characters can be embedded in mappings by
+# first surrounding the NetBIOS name in quotations, then using the
+# \0xnn notation to specify a hex value for a non-printing character.
+#
+# The following example illustrates all of these extensions:
+#
+# 102.54.94.97     rhino         #PRE #DOM:networking  #net group's DC
+# 102.54.94.102    "appname  \0x14"                    #special app server
+# 102.54.94.123    popular            #PRE             #source server
+# 102.54.94.117    localsrv           #PRE             #needed for the include
+#
+# #BEGIN_ALTERNATE
+# #INCLUDE \\localsrv\public\lmhosts
+# #INCLUDE \\rhino\public\lmhosts
+# #END_ALTERNATE
+#
+# In the above example, the "appname" server contains a special
+# character in its name, the "popular" and "localsrv" server names are
+# preloaded, and the "rhino" server name is specified so it can be used
+# to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
+# system is unavailable.
+#
+# Note that the whole file is parsed including comments on each lookup,
+# so keeping the number of comments to a minimum will improve performance.
+# Therefore it is not advisable to simply add lmhosts file entries onto the
+# end of this file.
+

HOSTS file

+This file is usually located in MS Windows NT 4.0 or 2000 in +C:\WINNT\SYSTEM32\DRIVERS\ETC and contains +the IP Address and the IP hostname in matched pairs. It can be +used by the name resolution infrastructure in MS Windows, depending +on how the TCP/IP environment is configured. This file is in +every way the equivalent of the UNIX/Linux /etc/hosts file. +

DNS Lookup

+This capability is configured in the TCP/IP setup area in the network +configuration facility. If enabled, an elaborate name resolution sequence +is followed the precise nature of which is dependant on how the NetBIOS +Node Type parameter is configured. A Node Type of 0 means that +NetBIOS broadcast (over UDP broadcast) is used if the name +that is the subject of a name lookup is not found in the NetBIOS name +cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to +Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the +WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast +lookup is used. +

WINS Lookup

+A WINS (Windows Internet Name Server) service is the equivalent of the +rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores +the names and IP addresses that are registered by a Windows client +if the TCP/IP setup has been given at least one WINS Server IP Address. +

+To configure Samba to be a WINS server the following parameter needs +to be added to the smb.conf file: +

wins support = Yes

+To configure Samba to use a WINS server the following parameters are +needed in the smb.conf file: +

wins support = No
wins server = xxx.xxx.xxx.xxx

+where xxx.xxx.xxx.xxx is the IP address +of the WINS server. +

For information about setting up Samba as a WINS server, read + the chapter on network browsing.

Common Errors

+TCP/IP network configuration problems find every network administrator sooner or later. +The cause can be anything from keyboard mishaps, forgetfulness, simple mistakes, and +carelessness. Of course, no one is every deliberately careless! +

Pinging works only in one way

+ “I can ping my samba server from Windows, but I can + not ping my Windows machine from the samba server.” +

+ The Windows machine was at IP Address 192.168.1.2 with netmask 255.255.255.0, the + Samba server (Linux) was at IP Address 192.168.1.130 with netmask 255.255.255.128. + The machines were on a local network with no external connections. +

+ Due to inconsistent netmasks, the Windows machine was on network 192.168.1.0/24, while + the Samba server was on network 192.168.1.128/25 - logically a different network. +

Very Slow Network Connections

+ A common causes of slow network response includes: +

  • Client is configured to use DNS and DNS server is down

  • Client is configured to use remote DNS server, but remote connection is down

  • Client is configured to use a WINS server, but there is no WINS server

  • Client is NOT configured to use a WINS server, but there is a WINS server

  • Firewall is filtering our DNS or WINS traffic

Samba server name change problem

+ “The name of the samba server was changed, samba was restarted, samba server can not be + pinged by new name from MS Windows NT4 Workstation, but it does still respond to ping using + the old name. Why?” +

+ From this description three (3) things are rather obvious: +

  • WINS is NOT in use, only broadcast based name resolution is used

  • The samba server was renamed and restarted within the last 10-15 minutes

  • The old samba server name is still in the NetBIOS name cache on the MS Windows NT4 Workstation

+ To find what names are present in the NetBIOS name cache on the MS Windows NT4 machine, + open a cmd shell, then: +

+

+C:\> nbtstat -n
+
+              NetBIOS Local Name Table
+
+   Name                 Type          Status
+------------------------------------------------
+FRODO            <03>  UNIQUE      Registered
+ADMINSTRATOR     <03>  UNIQUE      Registered
+FRODO            <00>  UNIQUE      Registered
+SARDON           <00>  GROUP       Registered
+FRODO            <20>  UNIQUE      Registered
+FRODO            <1F>  UNIQUE      Registered
+
+
+C:\> nbtstat -c
+
+             NetBIOS Remote Cache Name Table
+
+   Name                 Type       Host Address     Life [sec]
+--------------------------------------------------------------
+GANDALF	<20>  UNIQUE      192.168.1.1          240
+
+C:\> 
+

+

+ In the above example, GANDALF is the Samba server and FRODO is the MS Windows NT4 Workstation. + The first listing shows the contents of the Local Name Table (i.e.: Identity information on + the MS Windows workstation), the second shows the NetBIOS name in the NetBIOS name cache. + The name cache contains the remote machines known to this workstation. +

diff --git a/docs/htmldocs/ix01.html b/docs/htmldocs/ix01.html new file mode 100644 index 0000000000..6e09e98de4 --- /dev/null +++ b/docs/htmldocs/ix01.html @@ -0,0 +1,39 @@ +Index

Index

L

ldap admin dn, Configuring Samba
ldap delete dn, Configuring Samba
ldap filter, Configuring Samba
ldap machine suffix, Configuring Samba
ldap passwd sync, Configuring Samba, Password synchronisation
ldap ssl, Configuring Samba, Security and sambaSamAccount
ldap suffix, Configuring Samba
ldap trust ids, Configuring Samba
ldap user suffix, Configuring Samba
libnss_wins.so, /etc/nsswitch.conf
Links
hard, MS Windows NTFS Comparison with UNIX File Systems
soft, MS Windows NTFS Comparison with UNIX File Systems
Linuxprinting.org, CUPS Print Drivers from Linuxprinting.org
lm announce, What is Browsing?
lm interval, What is Browsing?
LMB (see Local Master Browser)
LMHOSTS, The LMHOSTS file
load printers, Parameters Recommended for Use, A little Experiment to warn you, The [global] Section
local master, What is Browsing?, Setting up WORKGROUP Browsing
Local Master Browser, Use of the Remote Announce parameter
locking, Discussion
locking.tdb, The printing *.tdb Files
(see also TDB)
log files
monitoring, Assumptions
log level, Adding Machine to Domain Fails, extd_audit, Debug levels
logon drive, Windows NT4 Workstation
logon home, LDAP special attributes for sambaSamAccounts, Windows 9x / Me User Profiles, Mixed Windows 9x / Me and Windows NT4/200x User Profiles, Windows NT4 Workstation, Sharing Profiles between W9x/Me and NT4/200x/XP workstations
logon path, LDAP special attributes for sambaSamAccounts, Mixed Windows 9x / Me and Windows NT4/200x User Profiles, Windows 9x / Me Profile Setup, Windows NT4 Workstation, Sharing Profiles between W9x/Me and NT4/200x/XP workstations
logon script, LDAP special attributes for sambaSamAccounts
lpadmin, CUPS Print Drivers from Linuxprinting.org, Setting up Quotas
lppause command, Parameters Recommended for Use, Linking of smbd with libcups.so, From Windows Clients to a CUPS/Samba Print Server, Pre-conditions
lpq cache time, Parameters Recommended for Use, The [global] Section
lpq command, Parameters Recommended for Use, Linking of smbd with libcups.so, Pre-conditions
lpresume command, Parameters Recommended for Use, Linking of smbd with libcups.so, Pre-conditions
lprm command, Parameters Recommended for Use, Linking of smbd with libcups.so, Pre-conditions
lpstat, Troubleshooting revisited

P

page_log, The page_log File Syntax
passdb backend, MS Windows Workstation/Server Machine Trust Accounts, Account Information Databases, Technical Information, The pdbedit Command, Configuring Samba, Configuring, Users can not logon, auth methods does not work, Passdb Backends and Authentication
password level, Password checking, The tests, Case handling of passwords, Slow Logins
password server, Server Security (User Level Security), Security Mode and Master Browsers, Joining an NT4 type Domain with Samba-3, The tests
patch, Patches
path, "The network name cannot be found", The [printers] Section, Any [my_printer_name] Section, Print Commands, Creating the [print$] Share, Parameters in the [print$] Section, Subdirectory Structure in [print$], Samba receiving Jobfiles and passing them to CUPS, Auto-Deletion or Preservation of CUPS Spool Files, Permissions on +/var/spool/samba/ get reset after each +reboot, The tests
PCL, GDI on Windows -- PostScript on UNIX, UNIX Printfile Conversion and GUI Basics, Driver Execution on the Server, Network PostScript RIP: CUPS Filters on Server -- clients use +PostScript Driver with CUPS-PPDs
PDF, Windows Drivers, GDI and EMF, PostScript Printer Description (PPD) Specification
pdf, MIME type Conversion Rules
PDL, GDI on Windows -- PostScript on UNIX, PostScript and Ghostscript
PJL, Network PostScript RIP: CUPS Filters on Server -- clients use +PostScript Driver with CUPS-PPDs, Benefits of using "CUPS PostScript Driver for +Windows NT/2k/XP" instead of Adobe Driver, Adobe and CUPS PostScript Drivers for Windows Clients
point and print, Driver Installation Methods on Windows Clients, Three familiar Methods for driver upload plus a new one, cupsomatic/Foomatic -- how do they fit into the Picture?, Run "cupsaddsmb" (quiet Mode), Installing the PostScript Driver on a Client, Manual Driver Installation in 15 Steps
PostScript, Using CUPS/Samba in an advanced Way -- intelligent printing +with PostScript Driver Download, GDI on Windows -- PostScript on UNIX, UNIX Printfile Conversion and GUI Basics, PostScript and Ghostscript, Prefilters, Driver Execution on the Server, Network PostScript RIP: CUPS Filters on Server -- clients use +PostScript Driver with CUPS-PPDs, CUPS: a "Magical Stone"?, CUPS Package of "PostScript Driver for WinNT/2k/XP"
(see also Ghostscript)
RIP, PostScript and Ghostscript
PPD, PostScript and Ghostscript, PostScript Printer Description (PPD) Specification, PostScript Printer Descriptions (PPDs) for non-PS Printers, PPDs for non-PS Printers on UNIX, PPDs for non-PS Printers on Windows, CUPS: a "Magical Stone"?, Installing the PostScript Driver on a Client
CUPS (see CUPS-PPD)
preferred master, What is Browsing?, Setting up WORKGROUP Browsing, Forcing Samba to be the master, Making Samba the domain master, The tests
preserve case, Windows 9x / Me Profile Setup
print command, Parameters Recommended for Use, The [global] Section, Default Print Commands for various UNIX Print Subsystems, Setting up your own Print Commands, Linking of smbd with libcups.so, From Windows Clients to a CUPS/Samba Print Server, Pre-conditions, Manual Configuration
print ok , Parameters Recommended for Use
printable, Parameters Recommended for Use, The [printers] Section, Any [my_printer_name] Section
printcap, Parameters Recommended for Use, Default Print Commands for various UNIX Print Subsystems, Basic Configuration of CUPS support, Linking of smbd with libcups.so, More complex smb.conf Settings for +CUPS, From Windows Clients to a CUPS/Samba Print Server, Pre-conditions
printcap name, Parameters Recommended for Use, The [global] Section
printer, Parameters Recommended for Use
printer admin, Parameters Recommended for Use, The [global] Section, Any [my_printer_name] Section, Parameters in the [print$] Section, Setting Drivers for existing Printers with a Client GUI, IMPORTANT! Setting Device Modes on new Printers, Always make first Client Connection as root or "printer admin", Setting Default Print Options for the Client Drivers, Adding new Printers with the Windows NT APW, More complex smb.conf Settings for +CUPS, What is required for adddriver and setdriver to succeed, Print options for all users can't be set on Win2K/XP
printer name, Parameters Recommended for Use
printing, Parameters Recommended for Use, The [global] Section, Default Print Commands for various UNIX Print Subsystems, Setting up your own Print Commands, Basic Configuration of CUPS support, Linking of smbd with libcups.so, More complex smb.conf Settings for +CUPS, From Windows Clients to a CUPS/Samba Print Server, Pre-conditions, Manual Configuration
printing.tdb, The printing *.tdb Files
(see also TDB)
PrintPro (see ESP Print Pro)
public, The [printers] Section

R

read list, User and Group Based Controls
read only, Miscellaneous Controls, The [printers] Section, Parameters in the [print$] Section
read raw, Read raw
read size, Read size
remote announce, NetBIOS over TCP/IP, How Browsing Functions, Use of the Remote Announce parameter, Browsing support in Samba
remote browse sync, NetBIOS over TCP/IP, How Browsing Functions, Use of the Remote Browse Sync parameter
root preexec, Logon Scripts
rpcclient
adddriver, Run "cupsaddsmb" with verbose Output, Understanding cupsaddsmb, Installing PostScript Driver Files manually (using +rpcclient), Understanding the rpcclient man page, What is required for adddriver and setdriver to succeed, Manual Driver Installation in 15 Steps
enumdrivers, Installing PostScript Driver Files manually (using +rpcclient), Manual Driver Installation in 15 Steps
enumports, Installing PostScript Driver Files manually (using +rpcclient)
enumprinters, Installing PostScript Driver Files manually (using +rpcclient), What is required for adddriver and setdriver to succeed, Manual Driver Installation in 15 Steps, Troubleshooting revisited
getdriver, Producing an Example by querying a Windows Box, Manual Driver Installation in 15 Steps
getprinter, Producing an Example by querying a Windows Box, Manual Driver Installation in 15 Steps, Troubleshooting revisited
setdriver, Caveats to be considered, Run "cupsaddsmb" with verbose Output, Understanding cupsaddsmb, Installing PostScript Driver Files manually (using +rpcclient), What is required for adddriver and setdriver to succeed, Manual Driver Installation in 15 Steps
rsync, Accessing the samba sources via rsync and ftp

S

secrets.tdb, The printing *.tdb Files
(see also TDB)
security, Samba Security Modes, Domain Security Mode (User Level Security), Server Security (User Level Security), What makes Samba a SERVER?, What makes Samba a Domain Controller?, What makes Samba a Domain Member?, Constantly Losing Connections to Password Server, Preparing for Domain Control, Security Mode and Master Browsers, Joining an NT4 type Domain with Samba-3, Why is this better than security = server?, Setup your smb.conf, Run "cupsaddsmb" (quiet Mode), "cupsaddsmb" keeps asking for root password in + neverending loop, Passdb Backends and Authentication, The tests, Configuring WfW password handling
security mask, File and Directory Permissions Based Controls, Interaction with the standard Samba create mask + parameters
Server Manager, MS Windows Workstation/Server Machine Trust Accounts, Manual Creation of Machine Trust Accounts
sessionid.tdb, The printing *.tdb Files
(see also TDB)
share_info.tdb, The printing *.tdb Files
(see also TDB)
short preserve case, Miscellaneous Controls, Windows 9x / Me Profile Setup
Short-Cuts, MS Windows NTFS Comparison with UNIX File Systems
show add printer wizard, Parameters Recommended for Use, The [global] Section, Adding new Printers with the Windows NT APW
SID, Features and Benefits
Single Sign On, Caveats to be considered
smbclient, Testing with smbclient, The tests
socket options, Socket options
spooling
central, Central spooling vs. "Peer-to-Peer" printing
peer-to-peer, Central spooling vs. "Peer-to-Peer" printing
spooling-only, CUPS/Samba as a "spooling-only" Print Server; "raw" printing +with Vendor Drivers on Windows Clients
strict locking, Discussion
diff --git a/docs/htmldocs/locking.html b/docs/htmldocs/locking.html new file mode 100644 index 0000000000..07228df19d --- /dev/null +++ b/docs/htmldocs/locking.html @@ -0,0 +1,637 @@ +Chapter 14. File and Record Locking

Chapter 14. File and Record Locking

Jeremy Allison

Samba Team

Jelmer R. Vernooij

The Samba Team

John H. Terpstra

Samba Team

Eric Roseme

HP Oplocks Usage Recommendations Whitepaper

+One area which causes trouble for many network administrators is locking. +The extent of the problem is readily evident from searches over the internet. +

Features and Benefits

+Samba provides all the same locking semantics that MS Windows clients expect +and that MS Windows NT4 / 200x servers provide also. +

+The term locking has exceptionally broad meaning and covers +a range of functions that are all categorized under this one term. +

+Opportunistic locking is a desirable feature when it can enhance the +perceived performance of applications on a networked client. However, the +opportunistic locking protocol is not robust, and therefore can +encounter problems when invoked beyond a simplistic configuration, or +on extended, slow, or faulty networks. In these cases, operating +system management of opportunistic locking and/or recovering from +repetitive errors can offset the perceived performance advantage that +it is intended to provide. +

+The MS Windows network administrator needs to be aware that file and record +locking semantics (behaviour) can be controlled either in Samba or by way of registry +settings on the MS Windows client. +

Note

+Sometimes it is necessary to disable locking control settings BOTH on the Samba +server as well as on each MS Windows client! +

Discussion

+There are two types of locking which need to be performed by a SMB server. +The first is record locking which allows a client to lock +a range of bytes in a open file. The second is the deny modes +that are specified when a file is open. +

+Record locking semantics under UNIX are very different from record locking under +Windows. Versions of Samba before 2.2 have tried to use the native fcntl() unix +system call to implement proper record locking between different Samba clients. +This can not be fully correct due to several reasons. The simplest is the fact +that a Windows client is allowed to lock a byte range up to 2^32 or 2^64, +depending on the client OS. The unix locking only supports byte ranges up to 2^31. +So it is not possible to correctly satisfy a lock request above 2^31. There are +many more differences, too many to be listed here. +

+Samba 2.2 and above implements record locking completely independent of the +underlying unix system. If a byte range lock that the client requests happens +to fall into the range 0-2^31, Samba hands this request down to the UNIX system. +All other locks can not be seen by unix anyway. +

+Strictly an SMB server should check for locks before every read and write call on +a file. Unfortunately with the way fcntl() works this can be slow and may over-stress +the rpc.lockd. It is also almost always unnecessary as clients are supposed to +independently make locking calls before reads and writes anyway if locking is +important to them. By default Samba only makes locking calls when explicitly asked +to by a client, but if you set strict locking = yes then it +will make lock checking calls on every read and write. +

+You can also disable byte range locking completely using locking = no. +This is useful for those shares that don't support locking or don't need it +(such as cdroms). In this case Samba fakes the return codes of locking calls to +tell clients that everything is OK. +

+The second class of locking is the deny modes. These +are set by an application when it opens a file to determine what types of +access should be allowed simultaneously with its open. A client may ask for +DENY_NONE, DENY_READ, +DENY_WRITE or DENY_ALL. There are also special compatibility +modes called DENY_FCB and DENY_DOS. +

Opportunistic Locking Overview

+Opportunistic locking (Oplocks) is invoked by the Windows file system +(as opposed to an API) via registry entries (on the server AND client) +for the purpose of enhancing network performance when accessing a file +residing on a server. Performance is enhanced by caching the file +locally on the client which allows: +

Read-ahead:

+ The client reads the local copy of the file, eliminating network latency +

Write caching:

+ The client writes to the local copy of the file, eliminating network latency +

Lock caching:

+ The client caches application locks locally, eliminating network latency +

+The performance enhancement of oplocks is due to the opportunity of +exclusive access to the file - even if it is opened with deny-none - +because Windows monitors the file's status for concurrent access from +other processes. +

Windows defines 4 kinds of Oplocks:

Level1 Oplock:

+ The redirector sees that the file was opened with deny + none (allowing concurrent access), verifies that no + other process is accessing the file, checks that + oplocks are enabled, then grants deny-all/read-write/exclusive + access to the file. The client now performs + operations on the cached local file. +

+ If a second process attempts to open the file, the open + is deferred while the redirector "breaks" the original + oplock. The oplock break signals the caching client to + write the local file back to the server, flush the + local locks, and discard read-ahead data. The break is + then complete, the deferred open is granted, and the + multiple processes can enjoy concurrent file access as + dictated by mandatory or byte-range locking options. + However, if the original opening process opened the + file with a share mode other than deny-none, then the + second process is granted limited or no access, despite + the oplock break. +

Level2 Oplock:

+ Performs like a level1 oplock, except caching is only + operative for reads. All other operations are performed + on the server disk copy of the file. +

Filter Oplock:

+ Does not allow write or delete file access +

Batch Oplock:

+ Manipulates file openings and closings - allows caching + of file attributes +

+An important detail is that oplocks are invoked by the file system, not +an application API. Therefore, an application can close an oplocked +file, but the file system does not relinquish the oplock. When the +oplock break is issued, the file system then simply closes the file in +preparation for the subsequent open by the second process. +

+Opportunistic Locking is actually an improper name for this feature. +The true benefit of this feature is client-side data caching, and +oplocks is merely a notification mechanism for writing data back to the +networked storage disk. The limitation of opportunistic locking is the +reliability of the mechanism to process an oplock break (notification) +between the server and the caching client. If this exchange is faulty +(usually due to timing out for any number of reasons) then the +client-side caching benefit is negated. +

+The actual decision that a user or administrator should consider is +whether it is sensible to share amongst multiple users data that will +be cached locally on a client. In many cases the answer is no. +Deciding when to cache or not cache data is the real question, and thus +"opportunistic locking" should be treated as a toggle for client-side +caching. Turn it "ON" when client-side caching is desirable and +reliable. Turn it "OFF" when client-side caching is redundant, +unreliable, or counter-productive. +

+Opportunistic locking is by default set to "on" by Samba on all +configured shares, so careful attention should be given to each case to +determine if the potential benefit is worth the potential for delays. +The following recommendations will help to characterize the environment +where opportunistic locking may be effectively configured. +

+Windows Opportunistic Locking is a lightweight performance-enhancing +feature. It is not a robust and reliable protocol. Every +implementation of Opportunistic Locking should be evaluated as a +tradeoff between perceived performance and reliability. Reliability +decreases as each successive rule above is not enforced. Consider a +share with oplocks enabled, over a wide area network, to a client on a +South Pacific atoll, on a high-availability server, serving a +mission-critical multi-user corporate database, during a tropical +storm. This configuration will likely encounter problems with oplocks. +

+Oplocks can be beneficial to perceived client performance when treated +as a configuration toggle for client-side data caching. If the data +caching is likely to be interrupted, then oplock usage should be +reviewed. Samba enables opportunistic locking by default on all +shares. Careful attention should be given to the client usage of +shared data on the server, the server network reliability, and the +opportunistic locking configuration of each share. +n mission critical high availability environments, data integrity is +often a priority. Complex and expensive configurations are implemented +to ensure that if a client loses connectivity with a file server, a +failover replacement will be available immediately to provide +continuous data availability. +

+Windows client failover behavior is more at risk of application +interruption than other platforms because it is dependant upon an +established TCP transport connection. If the connection is interrupted +- as in a file server failover - a new session must be established. +It is rare for Windows client applications to be coded to recover +correctly from a transport connection loss, therefore most applications +will experience some sort of interruption - at worst, abort and +require restarting. +

+If a client session has been caching writes and reads locally due to +opportunistic locking, it is likely that the data will be lost when the +application restarts, or recovers from the TCP interrupt. When the TCP +connection drops, the client state is lost. When the file server +recovers, an oplock break is not sent to the client. In this case, the +work from the prior session is lost. Observing this scenario with +oplocks disabled, and the client was writing data to the file server +real-time, then the failover will provide the data on disk as it +existed at the time of the disconnect. +

+In mission critical high availability environments, careful attention +should be given to opportunistic locking. Ideally, comprehensive +testing should be done with all affected applications with oplocks +enabled and disabled. +

Exclusively Accessed Shares

+Opportunistic locking is most effective when it is confined to shares +that are exclusively accessed by a single user, or by only one user at +a time. Because the true value of opportunistic locking is the local +client caching of data, any operation that interrupts the caching +mechanism will cause a delay. +

+Home directories are the most obvious examples of where the performance +benefit of opportunistic locking can be safely realized. +

Multiple-Accessed Shares or Files

+As each additional user accesses a file in a share with opportunistic +locking enabled, the potential for delays and resulting perceived poor +performance increases. When multiple users are accessing a file on a +share that has oplocks enabled, the management impact of sending and +receiving oplock breaks, and the resulting latency while other clients +wait for the caching client to flush data, offset the performance gains +of the caching user. +

+As each additional client attempts to access a file with oplocks set, +the potential performance improvement is negated and eventually results +in a performance bottleneck. +

UNIX or NFS Client Accessed Files

+Local UNIX and NFS clients access files without a mandatory +file locking mechanism. Thus, these client platforms are incapable of +initiating an oplock break request from the server to a Windows client +that has a file cached. Local UNIX or NFS file access can therefore +write to a file that has been cached by a Windows client, which +exposes the file to likely data corruption. +

+If files are shared between Windows clients, and either local UNIX +or NFS users, then turn opportunistic locking off. +

Slow and/or Unreliable Networks

+The biggest potential performance improvement for opportunistic locking +occurs when the client-side caching of reads and writes delivers the +most differential over sending those reads and writes over the wire. +This is most likely to occur when the network is extremely slow, +congested, or distributed (as in a WAN). However, network latency also +has a very high impact on the reliability of the oplock break +mechanism, and thus increases the likelihood of encountering oplock +problems that more than offset the potential perceived performance +gain. Of course, if an oplock break never has to be sent, then this is +the most advantageous scenario to utilize opportunistic locking. +

+If the network is slow, unreliable, or a WAN, then do not configure +opportunistic locking if there is any chance of multiple users +regularly opening the same file. +

Multi-User Databases

+Multi-user databases clearly pose a risk due to their very nature - +they are typically heavily accessed by numerous users at random +intervals. Placing a multi-user database on a share with opportunistic +locking enabled will likely result in a locking management bottleneck +on the Samba server. Whether the database application is developed +in-house or a commercially available product, ensure that the share +has opportunistic locking disabled. +

PDM Data Shares

+Process Data Management (PDM) applications such as IMAN, Enovia, and +Clearcase, are increasing in usage with Windows client platforms, and +therefore SMB data stores. PDM applications manage multi-user +environments for critical data security and access. The typical PDM +environment is usually associated with sophisticated client design +applications that will load data locally as demanded. In addition, the +PDM application will usually monitor the data-state of each client. +In this case, client-side data caching is best left to the local +application and PDM server to negotiate and maintain. It is +appropriate to eliminate the client OS from any caching tasks, and the +server from any oplock management, by disabling opportunistic locking on +the share. +

Beware of Force User

+Samba includes an smb.conf parameter called force user that changes +the user accessing a share from the incoming user to whatever user is +defined by the smb.conf variable. If opportunistic locking is enabled +on a share, the change in user access causes an oplock break to be sent +to the client, even if the user has not explicitly loaded a file. In +cases where the network is slow or unreliable, an oplock break can +become lost without the user even accessing a file. This can cause +apparent performance degradation as the client continually reconnects +to overcome the lost oplock break. +

+Avoid the combination of the following: +

  • + force user in the smb.conf share configuration. +

  • + Slow or unreliable networks +

  • + Opportunistic Locking Enabled +

Advanced Samba Opportunistic Locking Parameters

+Samba provides opportunistic locking parameters that allow the +administrator to adjust various properties of the oplock mechanism to +account for timing and usage levels. These parameters provide good +versatility for implementing oplocks in environments where they would +likely cause problems. The parameters are: +oplock break wait time, +oplock contention limit. +

+For most users, administrators, and environments, if these parameters +are required, then the better option is to simply turn oplocks off. +The samba SWAT help text for both parameters reads "DO NOT CHANGE THIS +PARAMETER UNLESS YOU HAVE READ AND UNDERSTOOD THE SAMBA OPLOCK CODE." +This is good advice. +

Mission Critical High Availability

+In mission critical high availability environments, data integrity is +often a priority. Complex and expensive configurations are implemented +to ensure that if a client loses connectivity with a file server, a +failover replacement will be available immediately to provide +continuous data availability. +

+Windows client failover behavior is more at risk of application +interruption than other platforms because it is dependant upon an +established TCP transport connection. If the connection is interrupted +- as in a file server failover - a new session must be established. +It is rare for Windows client applications to be coded to recover +correctly from a transport connection loss, therefore most applications +will experience some sort of interruption - at worst, abort and +require restarting. +

+If a client session has been caching writes and reads locally due to +opportunistic locking, it is likely that the data will be lost when the +application restarts, or recovers from the TCP interrupt. When the TCP +connection drops, the client state is lost. When the file server +recovers, an oplock break is not sent to the client. In this case, the +work from the prior session is lost. Observing this scenario with +oplocks disabled, and the client was writing data to the file server +real-time, then the failover will provide the data on disk as it +existed at the time of the disconnect. +

+In mission critical high availability environments, careful attention +should be given to opportunistic locking. Ideally, comprehensive +testing should be done with all affected applications with oplocks +enabled and disabled. +

Samba Opportunistic Locking Control

+Opportunistic Locking is a unique Windows file locking feature. It is +not really file locking, but is included in most discussions of Windows +file locking, so is considered a de facto locking feature. +Opportunistic Locking is actually part of the Windows client file +caching mechanism. It is not a particularly robust or reliable feature +when implemented on the variety of customized networks that exist in +enterprise computing. +

+Like Windows, Samba implements Opportunistic Locking as a server-side +component of the client caching mechanism. Because of the lightweight +nature of the Windows feature design, effective configuration of +Opportunistic Locking requires a good understanding of its limitations, +and then applying that understanding when configuring data access for +each particular customized network and client usage state. +

+Opportunistic locking essentially means that the client is allowed to download and cache +a file on their hard drive while making changes; if a second client wants to access the +file, the first client receives a break and must synchronise the file back to the server. +This can give significant performance gains in some cases; some programs insist on +synchronising the contents of the entire file back to the server for a single change. +

+Level1 Oplocks (aka just plain "oplocks") is another term for opportunistic locking. +

+Level2 Oplocks provides opportunistic locking for a file that will be treated as +read only. Typically this is used on files that are read-only or +on files that the client has no initial intention to write to at time of opening the file. +

+Kernel Oplocks are essentially a method that allows the Linux kernel to co-exist with +Samba's oplocked files, although this has provided better integration of MS Windows network +file locking with the under lying OS, SGI IRIX and Linux are the only two OS's that are +oplock aware at this time. +

+Unless your system supports kernel oplocks, you should disable oplocks if you are +accessing the same files from both UNIX/Linux and SMB clients. Regardless, oplocks should +always be disabled if you are sharing a database file (e.g., Microsoft Access) between +multiple clients, as any break the first client receives will affect synchronisation of +the entire file (not just the single record), which will result in a noticeable performance +impairment and, more likely, problems accessing the database in the first place. Notably, +Microsoft Outlook's personal folders (*.pst) react very badly to oplocks. If in doubt, +disable oplocks and tune your system from that point. +

+If client-side caching is desirable and reliable on your network, you will benefit from +turning on oplocks. If your network is slow and/or unreliable, or you are sharing your +files among other file sharing mechanisms (e.g., NFS) or across a WAN, or multiple people +will be accessing the same files frequently, you probably will not benefit from the overhead +of your client sending oplock breaks and will instead want to disable oplocks for the share. +

+Another factor to consider is the perceived performance of file access. If oplocks provide no +measurable speed benefit on your network, it might not be worth the hassle of dealing with them. +

Example Configuration

+In the following we examine two distinct aspects of Samba locking controls. +

Disabling Oplocks

+You can disable oplocks on a per-share basis with the following: +

+

[acctdata]
oplocks = False
level2 oplocks = False

+

+The default oplock type is Level1. Level2 Oplocks are enabled on a per-share basis +in the smb.conf file. +

+Alternately, you could disable oplocks on a per-file basis within the share: +

+

veto oplock files = /*.mdb/*.MDB/*.dbf/*.DBF/

+

+If you are experiencing problems with oplocks as apparent from Samba's log entries, +you may want to play it safe and disable oplocks and level2 oplocks. +

Disabling Kernel OpLocks

+Kernel OpLocks is an smb.conf parameter that notifies Samba (if +the UNIX kernel has the capability to send a Windows client an oplock +break) when a UNIX process is attempting to open the file that is +cached. This parameter addresses sharing files between UNIX and +Windows with Oplocks enabled on the Samba server: the UNIX process +can open the file that is Oplocked (cached) by the Windows client and +the smbd process will not send an oplock break, which exposes the file +to the risk of data corruption. If the UNIX kernel has the ability to +send an oplock break, then the kernel oplocks parameter enables Samba +to send the oplock break. Kernel oplocks are enabled on a per-server +basis in the smb.conf file. +

+

kernel oplocks = yes

+The default is "no". +

+Veto OpLocks is an smb.conf parameter that identifies specific files for +which Oplocks are disabled. When a Windows client opens a file that +has been configured for veto oplocks, the client will not be granted +the oplock, and all operations will be executed on the original file on +disk instead of a client-cached file copy. By explicitly identifying +files that are shared with UNIX processes, and disabling oplocks for +those files, the server-wide Oplock configuration can be enabled to +allow Windows clients to utilize the performance benefit of file +caching without the risk of data corruption. Veto Oplocks can be +enabled on a per-share basis, or globally for the entire server, in the +smb.conf file: +

+

Example 14.1. Share with some files oplocked

[global]
veto oplock files = /filename.htm/*.txt/
[share_name]
veto oplock files = /*.exe/filename.ext/

+

+ oplock break wait time is an smb.conf parameter that adjusts the time +interval for Samba to reply to an oplock break request. Samba +recommends "DO NOT CHANGE THIS PARAMETER UNLESS YOU HAVE READ AND +UNDERSTOOD THE SAMBA OPLOCK CODE." Oplock Break Wait Time can only be +configured globally in the smb.conf file: +

+

oplock break wait time = 0 (default)

+

+Oplock break contention limit is an smb.conf parameter that limits the +response of the Samba server to grant an oplock if the configured +number of contending clients reaches the limit specified by the +parameter. Samba recommends "DO NOT CHANGE THIS PARAMETER UNLESS YOU +HAVE READ AND UNDERSTOOD THE SAMBA OPLOCK CODE." Oplock Break +Contention Limit can be enable on a per-share basis, or globally for +the entire server, in the smb.conf file: +

+

Example 14.2. 

[global]
oplock break contention limit = 2 (default)
[share_name]
oplock break contention limit = 2 (default)

+

MS Windows Opportunistic Locking and Caching Controls

+There is a known issue when running applications (like Norton Anti-Virus) on a Windows 2000/ XP +workstation computer that can affect any application attempting to access shared database files +across a network. This is a result of a default setting configured in the Windows 2000/XP +operating system known as Opportunistic Locking. When a workstation +attempts to access shared data files located on another Windows 2000/XP computer, +the Windows 2000/XP operating system will attempt to increase performance by locking the +files and caching information locally. When this occurs, the application is unable to +properly function, which results in an Access Denied + error message being displayed during network operations. +

+All Windows operating systems in the NT family that act as database servers for data files +(meaning that data files are stored there and accessed by other Windows PCs) may need to +have opportunistic locking disabled in order to minimize the risk of data file corruption. +This includes Windows 9x/Me, Windows NT, Windows 200x and Windows XP. +

+If you are using a Windows NT family workstation in place of a server, you must also +disable opportunistic locking (oplocks) on that workstation. For example, if you use a +PC with the Windows NT Workstation operating system instead of Windows NT Server, and you +have data files located on it that are accessed from other Windows PCs, you may need to +disable oplocks on that system. +

+The major difference is the location in the Windows registry where the values for disabling +oplocks are entered. Instead of the LanManServer location, the LanManWorkstation location +may be used. +

+You can verify (or change or add, if necessary) this Registry value using the Windows +Registry Editor. When you change this registry value, you will have to reboot the PC +to ensure that the new setting goes into effect. +

+The location of the client registry entry for opportunistic locking has changed in +Windows 2000 from the earlier location in Microsoft Windows NT. +

Note

+Windows 2000 will still respect the EnableOplocks registry value used to disable oplocks +in earlier versions of Windows. +

+You can also deny the granting of opportunistic locks by changing the following registry entries: +

+

+	HKEY_LOCAL_MACHINE\System\
+		CurrentControlSet\Services\MRXSmb\Parameters\
+
+		OplocksDisabled REG_DWORD 0 or 1
+		Default: 0 (not disabled)
+

+

Note

+The OplocksDisabled registry value configures Windows clients to either request or not +request opportunistic locks on a remote file. To disable oplocks, the value of + OplocksDisabled must be set to 1. +

+

+	HKEY_LOCAL_MACHINE\System\
+		CurrentControlSet\Services\LanmanServer\Parameters
+
+		EnableOplocks REG_DWORD 0 or 1
+		Default: 1 (Enabled by Default)
+
+		EnableOpLockForceClose REG_DWORD 0 or 1
+		Default: 0 (Disabled by Default)
+

+

Note

+The EnableOplocks value configures Windows-based servers (including Workstations sharing +files) to allow or deny opportunistic locks on local files. +

+To force closure of open oplocks on close or program exit EnableOpLockForceClose must be set to 1. +

+An illustration of how level II oplocks work: +

  • + Station 1 opens the file, requesting oplock. +

  • + Since no other station has the file open, the server grants station 1 exclusive oplock. +

  • + Station 2 opens the file, requesting oplock. +

  • + Since station 1 has not yet written to the file, the server asks station 1 to Break + to Level II Oplock. +

  • + Station 1 complies by flushing locally buffered lock information to the server. +

  • + Station 1 informs the server that it has Broken to Level II Oplock (alternatively, + station 1 could have closed the file). +

  • + The server responds to station 2's open request, granting it level II oplock. + Other stations can likewise open the file and obtain level II oplock. +

  • + Station 2 (or any station that has the file open) sends a write request SMB. + The server returns the write response. +

  • + The server asks all stations that have the file open to Break to None, meaning no + station holds any oplock on the file. Because the workstations can have no cached + writes or locks at this point, they need not respond to the break-to-none advisory; + all they need do is invalidate locally cashed read-ahead data. +

Workstation Service Entries

+	\HKEY_LOCAL_MACHINE\System\
+		CurrentControlSet\Services\LanmanWorkstation\Parameters
+
+	UseOpportunisticLocking   REG_DWORD   0 or 1
+	Default: 1 (true)
+

+Indicates whether the redirector should use opportunistic-locking (oplock) performance +enhancement. This parameter should be disabled only to isolate problems. +

Server Service Entries

+	\HKEY_LOCAL_MACHINE\System\
+		CurrentControlSet\Services\LanmanServer\Parameters
+
+	EnableOplocks   REG_DWORD   0 or 1
+	Default: 1 (true)
+

+Specifies whether the server allows clients to use oplocks on files. Oplocks are a +significant performance enhancement, but have the potential to cause lost cached +data on some networks, particularly wide-area networks. +

+	MinLinkThroughput   REG_DWORD   0 to infinite bytes per second
+	Default: 0
+

+Specifies the minimum link throughput allowed by the server before it disables +raw and opportunistic locks for this connection. +

+	MaxLinkDelay   REG_DWORD   0 to 100,000 seconds
+	Default: 60
+

+Specifies the maximum time allowed for a link delay. If delays exceed this number, +the server disables raw I/O and opportunistic locking for this connection. +

+	OplockBreakWait   REG_DWORD   10 to 180 seconds
+	Default: 35
+

+Specifies the time that the server waits for a client to respond to an oplock break +request. Smaller values can allow detection of crashed clients more quickly but can +potentially cause loss of cached data. +

Persistent Data Corruption

+If you have applied all of the settings discussed in this chapter but data corruption problems +and other symptoms persist, here are some additional things to check out: +

+We have credible reports from developers that faulty network hardware, such as a single +faulty network card, can cause symptoms similar to read caching and data corruption. +If you see persistent data corruption even after repeated reindexing, you may have to +rebuild the data files in question. This involves creating a new data file with the +same definition as the file to be rebuilt and transferring the data from the old file +to the new one. There are several known methods for doing this that can be found in +our Knowledge Base. +

Common Errors

+In some sites locking problems surface as soon as a server is installed, in other sites +locking problems may not surface for a long time. Almost without exception, when a locking +problem does surface it will cause embarrassment and potential data corruption. +

+Over the past few years there have been a number of complaints on the samba mailing lists +that have claimed that samba caused data corruption. Three causes have been identified +so far: +

  • + Incorrect configuration of opportunistic locking (incompatible with the application + being used. This is a VERY common problem even where MS Windows NT4 or MS Windows 200x + based servers were in use. It is imperative that the software application vendors' + instructions for configuration of file locking should be followed. If in doubt, + disable oplocks on both the server and the client. Disabling of all forms of file + caching on the MS Windows client may be necessary also. +

  • + Defective network cards, cables, or HUBs / Switched. This is generally a more + prevalent factor with low cost networking hardware, though occasionally there + have been problems with incompatibilities in more up market hardware also. +

  • + There have been some random reports of samba log files being written over data + files. This has been reported by very few sites (about 5 in the past 3 years) + and all attempts to reproduce the problem have failed. The Samba-Team has been + unable to catch this happening and thus has NOT been able to isolate any particular + cause. Considering the millions of systems that use samba, for the sites that have + been affected by this as well as for the Samba-Team this is a frustrating and + a vexing challenge. If you see this type of thing happening please create a bug + report on https://bugzilla.samba.org without delay. Make sure that you give as much + information as you possibly can to help isolate the cause and to allow reproduction + of the problem (an essential step in problem isolation and correction). +

locking.tdb error messages

+ “ + We are seeing lots of errors in the samba logs like: +” +

+tdb(/usr/local/samba_2.2.7/var/locks/locking.tdb): rec_read bad magic
+ 0x4d6f4b61 at offset=36116
+

+“ + What do these mean? + ” +

+ Corrupted tdb. Stop all instances of smbd, delete locking.tdb, restart smbd. +

Problems saving files in MS Office on Windows XP

This is a bug in Windows XP. More information can be + found in Microsoft Knowledge Base article 812937.

Long delays deleting files over network with XP SP1

It sometimes takes approximately 35 seconds to delete files over the network after XP SP1 has been applied

This is a bug in Windows XP. More information can be + found in + Microsoft Knowledge Base article 811492.

Additional Reading

+You may want to check for an updated version of this white paper on our Web site from +time to time. Many of our white papers are updated as information changes. For those papers, +the Last Edited date is always at the top of the paper. +

+Section of the Microsoft MSDN Library on opportunistic locking: +

+Opportunistic Locks, Microsoft Developer Network (MSDN), Windows Development > +Windows Base Services > Files and I/O > SDK Documentation > File Storage > File Systems +> About File Systems > Opportunistic Locks, Microsoft Corporation. +http://msdn.microsoft.com/library/en-us/fileio/storage_5yk3.asp +

+Microsoft Knowledge Base Article Q224992 "Maintaining Transactional Integrity with OPLOCKS", +Microsoft Corporation, April 1999, http://support.microsoft.com/default.aspx?scid=kb;en-us;Q224992. +

+Microsoft Knowledge Base Article Q296264 "Configuring Opportunistic Locking in Windows 2000", +Microsoft Corporation, April 2001, http://support.microsoft.com/default.aspx?scid=kb;en-us;Q296264. +

+Microsoft Knowledge Base Article Q129202 "PC Ext: Explanation of Opportunistic Locking on Windows NT", + Microsoft Corporation, April 1995, http://support.microsoft.com/default.aspx?scid=kb;en-us;Q129202. +

diff --git a/docs/htmldocs/migration.html b/docs/htmldocs/migration.html new file mode 100644 index 0000000000..36b6edb0b1 --- /dev/null +++ b/docs/htmldocs/migration.html @@ -0,0 +1 @@ +Part IV. Migration and Updating diff --git a/docs/htmldocs/msdfs.html b/docs/htmldocs/msdfs.html new file mode 100644 index 0000000000..9fdf906ed0 --- /dev/null +++ b/docs/htmldocs/msdfs.html @@ -0,0 +1,51 @@ +Chapter 17. Hosting a Microsoft Distributed File System tree on Samba

Chapter 17. Hosting a Microsoft Distributed File System tree on Samba

Shirish Kalele

Samba Team & Veritas Software

12 Jul 2000

Features and Benefits

+ The Distributed File System (or DFS) provides a means of separating the logical + view of files and directories that users see from the actual physical locations + of these resources on the network. It allows for higher availability, smoother + storage expansion, load balancing etc. +

+ For information about DFS, refer to the +Microsoft documentation. +

+ This document explains how to host a DFS tree on a UNIX machine (for DFS-aware + clients to browse) using Samba. +

+ To enable SMB-based DFS for Samba, configure it with the --with-msdfs + option. Once built, a Samba server can be made a DFS server by setting the global + boolean host msdfs + parameter in the smb.conf file. You designate a share as a DFS + root using the share level boolean msdfs root parameter. A DFS root directory on Samba hosts DFS + links in the form of symbolic links that point to other servers. For example, a symbolic link + junction->msdfs:storage1\share1 in the share directory acts + as the DFS junction. When DFS-aware clients attempt to access the junction link, + they are redirected to the storage location (in this case, \\storage1\share1). +

+ DFS trees on Samba work with all DFS-aware clients ranging from Windows 95 to 200x. +

+ Here's an example of setting up a DFS tree on a Samba server. +

Example 17.1. smb.conf with DFS configured

[global]
netbios name = GANDALF
host msdfs = yes
[dfs]
path = /export/dfsroot
msdfs root = yes

In the /export/dfsroot directory we set up our DFS links to + other servers on the network.

+root# cd /export/dfsroot
+root# chown root /export/dfsroot
+root# chmod 755 /export/dfsroot
+root# ln -s msdfs:storageA\\shareA linka
+root# ln -s msdfs:serverB\\share,serverC\\share linkb
+

You should set up the permissions and ownership of + the directory acting as the DFS root such that only designated + users can create, delete or modify the msdfs links. Also note + that symlink names should be all lowercase. This limitation exists + to have Samba avoid trying all the case combinations to get at + the link name. Finally set up the symbolic links to point to the + network shares you want, and start Samba.

Users on DFS-aware clients can now browse the DFS tree + on the Samba server at \\samba\dfs. Accessing + links linka or linkb (which appear as directories to the client) + takes users directly to the appropriate shares on the network.

Common Errors

  • Windows clients need to be rebooted + if a previously mounted non-dfs share is made a DFS + root or vice versa. A better way is to introduce a + new share and make it the DFS root.

  • Currently there's a restriction that msdfs + symlink names should all be lowercase.

  • For security purposes, the directory + acting as the root of the DFS tree should have ownership + and permissions set so that only designated users can + modify the symbolic links in the directory.

diff --git a/docs/htmldocs/net.8.html b/docs/htmldocs/net.8.html index 4db6d92a8a..cacc1090f6 100644 --- a/docs/htmldocs/net.8.html +++ b/docs/htmldocs/net.8.html @@ -1,943 +1,144 @@ - - - %globalentities; - ]> - - - - net - 8 - - - - - net - Tool for administration of Samba and remote +net

Name

net — Tool for administration of Samba and remote CIFS servers. - - - - - - net - <ads|rap|rpc> - -h - -w workgroup - -W myworkgroup - -U user - -I ip-address - -p port - -n myname - -s conffile - -S server - -l - -P - -D debuglevel - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - The samba net utility is meant to work just like the net utility +

Synopsis

net {<ads|rap|rpc>} [-h] [-w workgroup] [-W myworkgroup] [-U user] [-I ip-address] [-p port] [-n myname] [-s conffile] [-S server] [-l] [-P] [-D debuglevel]

DESCRIPTION

This tool is part of the Samba(7) suite.

The samba net utility is meant to work just like the net utility available for windows and DOS. The first argument should be used to specify the protocol to use when executing a certain command. ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3) clients and RPC can be used for NT4 and Windows 2000. If this argument is omitted, net will try to determine it automatically. Not all commands are available on all protocols. - - - - - - OPTIONS - - - - --h|--help -Print a summary of command line options. - - - - - -w target-workgroup - +

OPTIONS

-h|--help

Print a summary of command line options. +

-w target-workgroup

Sets target workgroup or domain. You have to specify either this option or the IP address or the name of a server. - - - - - -W workgroup - +

-W workgroup

Sets client workgroup or domain - - - - - -U user - +

-U user

User name to use - - - - - -I ip-address - +

-I ip-address

IP address of target server to use. You have to specify either this option or a target workgroup or a target server. - - - - - -p port - +

-p port

Port on the target server to connect to (usually 139 or 445). Defaults to trying 445 first, then 139. - - - - - --n <primary NetBIOS name> -This option allows you to override +

-n <primary NetBIOS name>

This option allows you to override the NetBIOS name that Samba uses for itself. This is identical -to setting the netbios namenetbios name parameter in the smb.conf file. +to setting the netbios name parameter in the smb.conf file. However, a command line setting will take precedence over settings in -smb.conf. - - - --s <configuration file> -The file specified contains the +smb.conf.

-s <configuration file>

The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - - -S server - +compile time.

-S server

Name of target server. You should specify either this option or a target workgroup or a target IP address. - - - - - -l - +

-l

When listing data, give more information on each item. - - - - - -P - +

-P

Make queries to the external server using the machine account of the local server. - - - - - --d|--debug=debuglevel - -debuglevel is an integer +

-d|--debug=debuglevel

debuglevel is an integer from 0 to 10. The default value if this parameter is -not specified is zero. - -The higher this value, the more detail will be +not specified is zero.

The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of -information about operations carried out. - -Levels above 1 will generate considerable +information about operations carried out.

Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log -data, most of which is extremely cryptic. - -Note that specifying this parameter here will -override the log levellog level parameter -in the smb.conf file. - - - - - - -COMMANDS - - - TIME - - The NET TIME command allows you to view the time on a remote server - or synchronise the time on the local server with the time on the remote server. - - -TIME - -Without any options, the NET TIME command +data, most of which is extremely cryptic.

Note that specifying this parameter here will +override the log level parameter +in the smb.conf file.

COMMANDS

TIME

The NET TIME command allows you to view the time on a remote server + or synchronise the time on the local server with the time on the remote server.

TIME

Without any options, the NET TIME command displays the time on the remote server. - - - - - -TIME SYSTEM - - Displays the time on the remote server in a format ready for /bin/date - - - - -TIME SET -Tries to set the date and time of the local server to that on -the remote server using /bin/date. - - - - -TIME ZONE - -Displays the timezone in hours from GMT on the remote computer. - - - - - -[RPC|ADS] JOIN [TYPE] [-U username[%password]] [options] - - +

TIME SYSTEM

Displays the time on the remote server in a format ready for /bin/date

TIME SET

Tries to set the date and time of the local server to that on +the remote server using /bin/date.

TIME ZONE

Displays the timezone in hours from GMT on the remote computer.

[RPC|ADS] JOIN [TYPE] [-U username[%password]] [options]

Join a domain. If the account already exists on the server, and [TYPE] is MEMBER, the machine will attempt to join automatically. (Assuming that the machine has been created in server manager) Otherwise, a password will be prompted for, and a new account may -be created. - - +be created.

[TYPE] may be PDC, BDC or MEMBER to specify the type of server joining the domain. - - - - -[RPC] OLDJOIN [options] - -Join a domain. Use the OLDJOIN option to join the domain +

[RPC] OLDJOIN [options]

Join a domain. Use the OLDJOIN option to join the domain using the old style of domain joining - you need to create a trust -account in server manager first. - - - -[RPC|ADS] USER - - -[RPC|ADS] USER DELETE <replaceable>target</replaceable> - -Delete specified user - - - - -[RPC|ADS] USER LIST - -List all users - - - - -[RPC|ADS] USER INFO <replaceable>target</replaceable> - -List the domain groups of a the specified user. - - - - -[RPC|ADS] USER ADD <replaceable>name</replaceable> [password] [-F user flags] [-C comment] - -Add specified user. - - - - -[RPC|ADS] GROUP - - -[RPC|ADS] GROUP [misc options] [targets] -List user groups. - - - -[RPC|ADS] GROUP DELETE <replaceable>name</replaceable> [misc. options] - -Delete specified group. - - - - -[RPC|ADS] GROUP ADD <replaceable>name</replaceable> [-C comment] - -Create specified group. - - - - - -[RAP|RPC] SHARE - - -[RAP|RPC] SHARE [misc. options] [targets] - -Enumerates all exported resources (network shares) on target server. - - - - -[RAP|RPC] SHARE ADD <replaceable>name=serverpath</replaceable> [-C comment] [-M maxusers] [targets] - -Adds a share from a server (makes the export active). Maxusers +account in server manager first.

[RPC|ADS] USER

[RPC|ADS] USER DELETE target

Delete specified user

[RPC|ADS] USER LIST

List all users

[RPC|ADS] USER INFO target

List the domain groups of a the specified user.

[RPC|ADS] USER ADD name [password] [-F user flags] [-C comment]

Add specified user.

[RPC|ADS] GROUP

[RPC|ADS] GROUP [misc options] [targets]

List user groups.

[RPC|ADS] GROUP DELETE name [misc. options]

Delete specified group.

[RPC|ADS] GROUP ADD name [-C comment]

Create specified group.

[RAP|RPC] SHARE

[RAP|RPC] SHARE [misc. options] [targets]

Enumerates all exported resources (network shares) on target server.

[RAP|RPC] SHARE ADD name=serverpath [-C comment] [-M maxusers] [targets]

Adds a share from a server (makes the export active). Maxusers specifies the number of users that can be connected to the -share simultaneously. - - - - -SHARE DELETE <replaceable>sharenam</replaceable> - -Delete specified share. - - - - -[RPC|RAP] FILE - - -[RPC|RAP] FILE - -List all open files on remote server. - - - - -[RPC|RAP] FILE CLOSE <replaceable>fileid</replaceable> - -Close file with specified fileid on -remote server. - - - - -[RPC|RAP] FILE INFO <replaceable>fileid</replaceable> - - -Print information on specified fileid. +share simultaneously.

SHARE DELETE sharenam

Delete specified share.

[RPC|RAP] FILE

[RPC|RAP] FILE

List all open files on remote server.

[RPC|RAP] FILE CLOSE fileid

Close file with specified fileid on +remote server.

[RPC|RAP] FILE INFO fileid

+Print information on specified fileid. Currently listed are: file-id, username, locks, path, permissions. - - - - - -[RAP|RPC] FILE USER - -Currently NOT implemented. - - - - - - -SESSION - - -RAP SESSION - -Without any other options, SESSION enumerates all active SMB/CIFS -sessions on the target server. - - - - -RAP SESSION DELETE|CLOSE <replaceable>CLIENT_NAME</replaceable> - -Close the specified sessions. - - - - -RAP SESSION INFO <replaceable>CLIENT_NAME</replaceable> - -Give a list with all the open files in specified session. - - - - - - -RAP SERVER <replaceable>DOMAIN</replaceable> - -List all servers in specified domain or workgroup. Defaults -to local domain. - - - - -RAP DOMAIN - -Lists all domains and workgroups visible on the -current network. - - - - -RAP PRINTQ - - -RAP PRINTQ LIST <replaceable>QUEUE_NAME</replaceable> - -Lists the specified print queue and print jobs on the server. -If the QUEUE_NAME is omitted, all -queues are listed. - - - - -RAP PRINTQ DELETE <replaceable>JOBID</replaceable> - -Delete job with specified id. - - - - - - -RAP VALIDATE <replaceable>user</replaceable> [<replaceable>password</replaceable>] - - +

[RAP|RPC] FILE USER

Note

Currently NOT implemented.

SESSION

RAP SESSION

Without any other options, SESSION enumerates all active SMB/CIFS +sessions on the target server.

RAP SESSION DELETE|CLOSE CLIENT_NAME

Close the specified sessions.

RAP SESSION INFO CLIENT_NAME

Give a list with all the open files in specified session.

RAP SERVER DOMAIN

List all servers in specified domain or workgroup. Defaults +to local domain.

RAP DOMAIN

Lists all domains and workgroups visible on the +current network.

RAP PRINTQ

RAP PRINTQ LIST QUEUE_NAME

Lists the specified print queue and print jobs on the server. +If the QUEUE_NAME is omitted, all +queues are listed.

RAP PRINTQ DELETE JOBID

Delete job with specified id.

RAP VALIDATE user [password]

Validate whether the specified user can log in to the remote server. If the password is not specified on the commandline, it will be prompted. - - -Currently NOT implemented. - - - - -RAP GROUPMEMBER - - -RAP GROUPMEMBER LIST <replaceable>GROUP</replaceable> - -List all members of the specified group. - - - - -RAP GROUPMEMBER DELETE <replaceable>GROUP</replaceable> <replaceable>USER</replaceable> - -Delete member from group. - - - - -RAP GROUPMEMBER ADD <replaceable>GROUP</replaceable> <replaceable>USER</replaceable> - -Add member to group. - - - - - - -RAP ADMIN <replaceable>command</replaceable> - -Execute the specified command on +

Note

Currently NOT implemented.

RAP GROUPMEMBER

RAP GROUPMEMBER LIST GROUP

List all members of the specified group.

RAP GROUPMEMBER DELETE GROUP USER

Delete member from group.

RAP GROUPMEMBER ADD GROUP USER

Add member to group.

RAP ADMIN command

Execute the specified command on the remote server. Only works with OS/2 servers. - - -Currently NOT implemented. - - - - -RAP SERVICE - - -RAP SERVICE START <replaceable>NAME</replaceable> [arguments...] - -Start the specified service on the remote server. Not implemented yet. - -Currently NOT implemented. - - - - -RAP SERVICE STOP - -Stop the specified service on the remote server. - -Currently NOT implemented. - - - - - - -RAP PASSWORD <replaceable>USER</replaceable> <replaceable>OLDPASS</replaceable> <replaceable>NEWPASS</replaceable> - - -Change password of USER from OLDPASS to NEWPASS. - - - - - -LOOKUP - - -LOOKUP HOST <replaceable>HOSTNAME</replaceable> [<replaceable>TYPE</replaceable>] - - +

Note

Currently NOT implemented.

RAP SERVICE

RAP SERVICE START NAME [arguments...]

Start the specified service on the remote server. Not implemented yet.

Note

Currently NOT implemented.

RAP SERVICE STOP

Stop the specified service on the remote server.

Note

Currently NOT implemented.

RAP PASSWORD USER OLDPASS NEWPASS

+Change password of USER from OLDPASS to NEWPASS. +

LOOKUP

LOOKUP HOST HOSTNAME [TYPE]

Lookup the IP address of the given host with the specified type (netbios suffix). The type defaults to 0x20 (workstation). - - - +

LOOKUP LDAP [DOMAIN

Give IP address of LDAP server of specified DOMAIN. Defaults to local domain.

LOOKUP KDC [REALM]

Give IP address of KDC for the specified REALM. +Defaults to local realm.

LOOKUP DC [DOMAIN]

Give IP's of Domain Controllers for specified +DOMAIN. Defaults to local domain.

LOOKUP MASTER DOMAIN

Give IP of master browser for specified DOMAIN +or workgroup. Defaults to local domain.

CACHE

Samba uses a general caching interface called 'gencache'. It +can be controlled using 'NET CACHE'.

All the timeout parameters support the suffixes: - -LOOKUP LDAP [<replaceable>DOMAIN</replaceable> +

s - Seconds
m - Minutes
h - Hours
d - Days
w - Weeks

-Give IP address of LDAP server of specified DOMAIN. Defaults to local domain. - - - - -LOOKUP KDC [<replaceable>REALM</replaceable>] - -Give IP address of KDC for the specified REALM. -Defaults to local realm. - - - - -LOOKUP DC [<replaceable>DOMAIN</replaceable>] - -Give IP's of Domain Controllers for specified -DOMAIN. Defaults to local domain. - - - - -LOOKUP MASTER <replaceable>DOMAIN</replaceable> - -Give IP of master browser for specified DOMAIN -or workgroup. Defaults to local domain. - - - - - - -CACHE - -Samba uses a general caching interface called 'gencache'. It -can be controlled using 'NET CACHE'. - -All the timeout parameters support the suffixes: - - -s - Seconds -m - Minutes -h - Hours -d - Days -w - Weeks - - - - - -CACHE ADD <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable> - -Add specified key+data to the cache with the given timeout. - - - - -CACHE DEL <replaceable>key</replaceable> - -Delete key from the cache. - - - - -CACHE SET <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable> - -Update data of existing cache entry. - - - - -CACHE SEARCH <replaceable>PATTERN</replaceable> - -Search for the specified pattern in the cache data. - - - - -CACHE LIST - - +

CACHE ADD key data time-out

Add specified key+data to the cache with the given timeout.

CACHE DEL key

Delete key from the cache.

CACHE SET key data time-out

Update data of existing cache entry.

CACHE SEARCH PATTERN

Search for the specified pattern in the cache data.

CACHE LIST

List all current items in the cache. - - - - - -CACHE FLUSH - -Remove all the current items from the cache. - - - - - - -GETLOCALSID [DOMAIN] - -Print the SID of the specified domain, or if the parameter is -omitted, the SID of the domain the local server is in. - - - - -SETLOCALSID S-1-5-21-x-y-z - -Sets domain sid for the local server to the specified SID. - - - - -GROUPMAP - -Manage the mappings between Windows group SIDs and UNIX groups. -Parameters take the for "parameter=value". Common options include: - - -unixgroup - Name of the UNIX group -ntgroup - Name of the Windows NT group (must be - resolvable to a SID -rid - Unsigned 32-bit integer -sid - Full SID in the form of "S-1-..." -type - Type of the group; either 'domain', 'local', - or 'builtin' -comment - Freeform text description of the group - - - -GROUPMAP ADD - -Add a new group mapping entry - -net groupmap add {rid=int|sid=string} unixgroup=string [type={domain|local|builtin}] [ntgroup=string] [comment=string] - - - - -GROUPMAP DELETE - -Delete a group mapping entry - -net groupmap delete {ntgroup=string|sid=SID} - - - - -GROUPMAP MODIFY - -Update en existing group entry - -net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] [comment=string] [type={domain|local} - - - -GROUPMAP LIST - -List existing group mapping entries - -net groupmap list [verbose] [ntgroup=string] [sid=SID] - - - - - - - -MAXRID - -Prints out the highest RID currently in use on the local +

CACHE FLUSH

Remove all the current items from the cache.

GETLOCALSID [DOMAIN]

Print the SID of the specified domain, or if the parameter is +omitted, the SID of the domain the local server is in.

SETLOCALSID S-1-5-21-x-y-z

Sets domain sid for the local server to the specified SID.

GROUPMAP

Manage the mappings between Windows group SIDs and UNIX groups. +Parameters take the for "parameter=value". Common options include:

  • unixgroup - Name of the UNIX group

  • ntgroup - Name of the Windows NT group (must be + resolvable to a SID

  • rid - Unsigned 32-bit integer

  • sid - Full SID in the form of "S-1-..."

  • type - Type of the group; either 'domain', 'local', + or 'builtin'

  • comment - Freeform text description of the group

GROUPMAP ADD

Add a new group mapping entry

net groupmap add {rid=int|sid=string} unixgroup=string [type={domain|local|builtin}] [ntgroup=string] [comment=string]

GROUPMAP DELETE

Delete a group mapping entry

net groupmap delete {ntgroup=string|sid=SID}

GROUPMAP MODIFY

Update en existing group entry

net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] [comment=string] [type={domain|local}

GROUPMAP LIST

List existing group mapping entries

net groupmap list [verbose] [ntgroup=string] [sid=SID]

MAXRID

Prints out the highest RID currently in use on the local server (by the active 'passdb backend'). - - - - - -RPC INFO - -Print information about the domain of the remote server, +

RPC INFO

Print information about the domain of the remote server, such as domain name, domain sid and number of users and groups. - - - - - -[RPC|ADS] TESTJOIN - -Check whether participation in a domain is still valid. - - - - -[RPC|ADS] CHANGETRUSTPW - -Force change of domain trust password. - - - - -RPC TRUSTDOM - - -RPC TRUSTDOM ADD <replaceable>DOMAIN</replaceable> - -Add a interdomain trust account for -DOMAIN to the remote server. - - - - - -RPC TRUSTDOM DEL <replaceable>DOMAIM</replaceable> - -Remove interdomain trust account for -DOMAIN from the remote server. - - -Currently NOT implemented. - - - - -RPC TRUSTDOM ESTABLISH <replaceable>DOMAIN</replaceable> - - +

[RPC|ADS] TESTJOIN

Check whether participation in a domain is still valid.

[RPC|ADS] CHANGETRUSTPW

Force change of domain trust password.

RPC TRUSTDOM

RPC TRUSTDOM ADD DOMAIN

Add a interdomain trust account for +DOMAIN to the remote server. +

RPC TRUSTDOM DEL DOMAIM

Remove interdomain trust account for +DOMAIN from the remote server. +

Note

Currently NOT implemented.

RPC TRUSTDOM ESTABLISH DOMAIN

Establish a trust relationship to a trusting domain. Interdomain account must already be created on the remote PDC. - - - - - -RPC TRUSTDOM REVOKE <replaceable>DOMAIN</replaceable> -Abandon relationship to trusted domain - - - - -RPC TRUSTDOM LIST - -List all current interdomain trust relationships. - - - - - - -RPC ABORTSHUTDOWN - -Abort the shutdown of a remote server. - - - - -SHUTDOWN [-t timeout] [-r] [-f] [-C message] - -Shut down the remote server. - - - --r - +

RPC TRUSTDOM REVOKE DOMAIN

Abandon relationship to trusted domain

RPC TRUSTDOM LIST

List all current interdomain trust relationships.

RPC ABORTSHUTDOWN

Abort the shutdown of a remote server.

SHUTDOWN [-t timeout] [-r] [-f] [-C message]

Shut down the remote server.

-r

Reboot after shutdown. - - - - --f - +

-f

Force shutting down all applications. - - - - --t timeout - +

-t timeout

Timeout before system will be shut down. An interactive user of the system can use this time to cancel the shutdown. - -'> - - --C message -Display the specified message on the screen to -announce the shutdown. - - - - - - -SAMDUMP - -Print out sam database of remote server. You need -to run this on either a BDC. - - - -VAMPIRE - -Export users, aliases and groups from remote server to +

-C message

Display the specified message on the screen to +announce the shutdown.

SAMDUMP

Print out sam database of remote server. You need +to run this on either a BDC.

VAMPIRE

Export users, aliases and groups from remote server to local server. Can only be run an a BDC. - - - - - -GETSID - -Fetch domain SID and store it in the local secrets.tdb. - - - - -ADS LEAVE - -Make the remote host leave the domain it is part of. - - - - -ADS STATUS - -Print out status of machine account of the local machine in ADS. +

GETSID

Fetch domain SID and store it in the local secrets.tdb.

ADS LEAVE

Make the remote host leave the domain it is part of.

ADS STATUS

Print out status of machine account of the local machine in ADS. Prints out quite some debug info. Aimed at developers, regular -users should use NET ADS TESTJOIN. - - - - -ADS PRINTER - - -ADS PRINTER INFO [<replaceable>PRINTER</replaceable>] [<replaceable>SERVER</replaceable>] - - -Lookup info for PRINTER on SERVER. The printer name defaults to "*", the -server name defaults to the local host. - - - - -ADS PRINTER PUBLISH <replaceable>PRINTER</replaceable> - -Publish specified printer using ADS. - - - - -ADS PRINTER REMOVE <replaceable>PRINTER</replaceable> - -Remove specified printer from ADS directory. - - - - - - -ADS SEARCH <replaceable>EXPRESSION</replaceable> <replaceable>ATTRIBUTES...</replaceable> - -Perform a raw LDAP search on a ADS server and dump the results. The +users should use NET ADS TESTJOIN.

ADS PRINTER

ADS PRINTER INFO [PRINTER] [SERVER]

+Lookup info for PRINTER on SERVER. The printer name defaults to "*", the +server name defaults to the local host.

ADS PRINTER PUBLISH PRINTER

Publish specified printer using ADS.

ADS PRINTER REMOVE PRINTER

Remove specified printer from ADS directory.

ADS SEARCH EXPRESSION ATTRIBUTES...

Perform a raw LDAP search on a ADS server and dump the results. The expression is a standard LDAP search expression, and the -attributes are a list of LDAP fields to show in the results. - -Example: net ads search '(objectCategory=group)' sAMAccountName - - - - - -ADS DN <replaceable>DN</replaceable> <replaceable>(attributes)</replaceable> - - +attributes are a list of LDAP fields to show in the results.

Example: net ads search '(objectCategory=group)' sAMAccountName +

ADS DN DN (attributes)

Perform a raw LDAP search on a ADS server and dump the results. The DN standard LDAP DN, and the attributes are a list of LDAP fields to show in the result. - - -Example: net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName - - - - -WORKGROUP - -Print out workgroup name for specified kerberos realm. - - - - - -HELP [COMMAND] - -Gives usage information for the specified command. - - - - - - - VERSION - - This man page is complete for version 3.0 of the Samba - suite. - - - - AUTHOR - - The original Samba software and related utilities +

Example: net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName

WORKGROUP

Print out workgroup name for specified kerberos realm.

HELP [COMMAND]

Gives usage information for the specified command.

VERSION

This man page is complete for version 3.0 of the Samba + suite.

AUTHOR

The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The net manpage was written by Jelmer Vernooij. - - - - + to the way the Linux kernel is developed.

The net manpage was written by Jelmer Vernooij.

diff --git a/docs/htmldocs/nmbd.8.html b/docs/htmldocs/nmbd.8.html index 815534dad9..ad1c7990c0 100644 --- a/docs/htmldocs/nmbd.8.html +++ b/docs/htmldocs/nmbd.8.html @@ -1,354 +1,147 @@ - - - %globalentities; - ]> - - - - nmbd - 8 - - - - - nmbd - NetBIOS name server to provide NetBIOS - over IP naming services to clients - - - - - nmbd - -D - -F - -S - -a - -i - -o - -h - -V - -d <debug level> - -H <lmhosts file> - -l <log directory> - -n <primary netbios name> - -p <port number> - -s <configuration file> - - - - - DESCRIPTION - This program is part of the Samba - 7 suite. - - nmbd is a server that understands +nmbd

Name

nmbd — NetBIOS name server to provide NetBIOS + over IP naming services to clients

Synopsis

nmbd [-D] [-F] [-S] [-a] [-i] [-o] [-h] [-V] [-d <debug level>] [-H <lmhosts file>] [-l <log directory>] [-n <primary netbios name>] [-p <port number>] [-s <configuration file>]

DESCRIPTION

This program is part of the Samba(7) suite.

nmbd is a server that understands and can reply to NetBIOS over IP name service requests, like those produced by SMB/CIFS clients such as Windows 95/98/ME, Windows NT, Windows 2000, Windows XP and LanManager clients. It also participates in the browsing protocols which make up the - Windows "Network Neighborhood" view. - - SMB/CIFS clients, when they start up, may wish to + Windows "Network Neighborhood" view.

SMB/CIFS clients, when they start up, may wish to locate an SMB/CIFS server. That is, they wish to know what - IP number a specified host is using. - - Amongst other services, nmbd will + IP number a specified host is using.

Amongst other services, nmbd will listen for such requests, and if its own NetBIOS name is specified it will respond with the IP number of the host it is running on. Its "own NetBIOS name" is by default the primary DNS name of the host it is running on, - but this can be overridden with the -n - option (see OPTIONS below). Thus nmbd will + but this can be overridden with the -n + option (see OPTIONS below). Thus nmbd will reply to broadcast queries for its own name(s). Additional - names for nmbd to respond on can be set - via parameters in the smb.conf - 5 configuration file. - - nmbd can also be used as a WINS + names for nmbd to respond on can be set + via parameters in the smb.conf(5) configuration file.

nmbd can also be used as a WINS (Windows Internet Name Server) server. What this basically means is that it will act as a WINS database server, creating a database from name registration requests that it receives and - replying to queries from clients for these names. - - In addition, nmbd can act as a WINS + replying to queries from clients for these names.

In addition, nmbd can act as a WINS proxy, relaying broadcast queries from clients that do not understand how to talk the WINS protocol to a WINS - server. - - - - OPTIONS - - - - -D - If specified, this parameter causes - nmbd to operate as a daemon. That is, + server.

OPTIONS

-D

If specified, this parameter causes + nmbd to operate as a daemon. That is, it detaches itself and runs in the background, fielding - requests on the appropriate port. By default, nmbd + requests on the appropriate port. By default, nmbd will operate as a daemon if launched from a command shell. - nmbd can also be operated from the inetd + nmbd can also be operated from the inetd meta-daemon, although this is not recommended. - - - - - -F - If specified, this parameter causes - the main nmbd process to not daemonize, +

-F

If specified, this parameter causes + the main nmbd process to not daemonize, i.e. double-fork and disassociate with the terminal. Child processes are still created as normal to service each connection request, but the main process does not exit. This operation mode is suitable for running - nmbd under process supervisors such - as supervise and svscan - from Daniel J. Bernstein's daemontools + nmbd under process supervisors such + as supervise and svscan + from Daniel J. Bernstein's daemontools package, or the AIX process monitor. - - - - - -S - If specified, this parameter causes - nmbd to log to standard output rather - than a file. - - - - -i - If this parameter is specified it causes the +

-S

If specified, this parameter causes + nmbd to log to standard output rather + than a file.

-i

If this parameter is specified it causes the server to run "interactively", not as a daemon, even if the server is executed on the command line of a shell. Setting this parameter negates the implicit daemon mode when run from the - command line. nmbd also logs to standard - output, as if the -S parameter had been - given. - - - - --h|--help -Print a summary of command line options. - - - - - -H <filename> - NetBIOS lmhosts file. The lmhosts + command line. nmbd also logs to standard + output, as if the -S parameter had been + given.

-h|--help

Print a summary of command line options. +

-H <filename>

NetBIOS lmhosts file. The lmhosts file is a list of NetBIOS names to IP addresses that is loaded by the nmbd server and used via the name - resolution mechanism name resolve ordername resolve order described in smb.conf - 5 to resolve any + resolution mechanism name resolve order described in smb.conf(5) to resolve any NetBIOS name queries needed by the server. Note - that the contents of this file are NOT - used by nmbd to answer any name queries. + that the contents of this file are NOT + used by nmbd to answer any name queries. Adding a line to this file affects name NetBIOS resolution - from this host ONLY. - - The default path to this file is compiled into + from this host ONLY.

The default path to this file is compiled into Samba as part of the build process. Common defaults - are /usr/local/samba/lib/lmhosts, - /usr/samba/lib/lmhosts or - /etc/samba/lmhosts. See the lmhosts - 5 man page for details on the contents of this file. - - - - - --V -Prints the version number for -smbd. - - - --s <configuration file> -The file specified contains the + are /usr/local/samba/lib/lmhosts, + /usr/samba/lib/lmhosts or + /etc/samba/lmhosts. See the lmhosts(5) man page for details on the contents of this file.

-V

Prints the version number for +smbd.

-s <configuration file>

The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - --d|--debug=debuglevel - -debuglevel is an integer +compile time.

-d|--debug=debuglevel

debuglevel is an integer from 0 to 10. The default value if this parameter is -not specified is zero. - -The higher this value, the more detail will be +not specified is zero.

The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of -information about operations carried out. - -Levels above 1 will generate considerable +information about operations carried out.

Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log -data, most of which is extremely cryptic. - -Note that specifying this parameter here will -override the log levellog level parameter -in the smb.conf file. - - - - --l|--logfile=logbasename -File name for log/debug files. The extension -".client" will be appended. The log file is +data, most of which is extremely cryptic.

Note that specifying this parameter here will +override the log level parameter +in the smb.conf file.

-l|--logfile=logbasename

File name for log/debug files. The extension +".client" will be appended. The log file is never removed by the client. - - - - - - -p <UDP port number> - UDP port number is a positive integer value. +

-p <UDP port number>

UDP port number is a positive integer value. This option changes the default UDP port number (normally 137) - that nmbd responds to name queries on. Don't + that nmbd responds to name queries on. Don't use this option unless you are an expert, in which case you - won't need help! - - - - - - - FILES - - - - /etc/inetd.conf - If the server is to be run by the - inetd meta-daemon, this file + won't need help!

FILES

/etc/inetd.conf

If the server is to be run by the + inetd meta-daemon, this file must contain suitable startup information for the meta-daemon. - - - - - /etc/rc - or whatever initialization script your - system uses). - - If running the server as a daemon at startup, +

/etc/rc

or whatever initialization script your + system uses).

If running the server as a daemon at startup, this file will need to contain an appropriate startup - sequence for the server. - - - - /etc/services - If running the server via the - meta-daemon inetd, this file + sequence for the server.

/etc/services

If running the server via the + meta-daemon inetd, this file must contain a mapping of service name (e.g., netbios-ssn) to service port (e.g., 139) and protocol type (e.g., tcp). - - - - - /usr/local/samba/lib/smb.conf - This is the default location of - the smb.conf - 5 server +

/usr/local/samba/lib/smb.conf

This is the default location of + the smb.conf(5) server configuration file. Other common places that systems - install this file are /usr/samba/lib/smb.conf - and /etc/samba/smb.conf. - - When run as a WINS server (see the - wins supportwins support - parameter in the smb.conf - 5 man page), - nmbd - will store the WINS database in the file wins.dat - in the var/locks directory configured under - wherever Samba was configured to install itself. - - If nmbd is acting as a - browse master (see the local masterlocal master - parameter in the smb.conf - 5 man page, nmbd - will store the browsing database in the file browse.dat - in the var/locks directory + install this file are /usr/samba/lib/smb.conf + and /etc/samba/smb.conf.

When run as a WINS server (see the + wins support + parameter in the smb.conf(5) man page), + nmbd + will store the WINS database in the file wins.dat + in the var/locks directory configured under + wherever Samba was configured to install itself.

If nmbd is acting as a + browse master (see the local master + parameter in the smb.conf(5) man page, nmbd + will store the browsing database in the file browse.dat + in the var/locks directory configured under wherever Samba was configured to install itself. - - - - - - - SIGNALS - - To shut down an nmbd process it is recommended - that SIGKILL (-9) NOT be used, except as a last +

SIGNALS

To shut down an nmbd process it is recommended + that SIGKILL (-9) NOT be used, except as a last resort, as this may leave the name database in an inconsistent state. - The correct way to terminate nmbd is to send it - a SIGTERM (-15) signal and wait for it to die on its own. - - nmbd will accept SIGHUP, which will cause - it to dump out its namelists into the file namelist.debug - in the /usr/local/samba/var/locks - directory (or the var/locks directory configured + The correct way to terminate nmbd is to send it + a SIGTERM (-15) signal and wait for it to die on its own.

nmbd will accept SIGHUP, which will cause + it to dump out its namelists into the file namelist.debug + in the /usr/local/samba/var/locks + directory (or the var/locks directory configured under wherever Samba was configured to install itself). This will also - cause nmbd to dump out its server database in - the log.nmb file. - - The debug log level of nmbd may be raised or lowered - using smbcontrol - 1 (SIGUSR[1|2] signals + cause nmbd to dump out its server database in + the log.nmb file.

The debug log level of nmbd may be raised or lowered + using smbcontrol(1) (SIGUSR[1|2] signals are no longer used since Samba 2.2). This is to allow transient problems to be diagnosed, whilst still running - at a normally low log level. - - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - SEE ALSO - - inetd - 8, smbd - 8, smb.conf - 5, smbclient - 1, testparm - 1, testprns - 1, and the Internet - RFC's rfc1001.txt, rfc1002.txt. + at a normally low log level.

VERSION

This man page is correct for version 3.0 of + the Samba suite.

SEE ALSO

+ inetd(8), smbd(8), smb.conf(5), smbclient(1), testparm(1), testprns(1), and the Internet + RFC's rfc1001.txt, rfc1002.txt. In addition the CIFS (formerly SMB) specification is available - as a link from the Web page - http://samba.org/cifs/. - - - - AUTHOR - - The original Samba software and related utilities + as a link from the Web page + http://samba.org/cifs/.

AUTHOR

The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook - XML 4.2 for Samba 3.0 was done by Alexander Bokovoy. - - - + XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.

diff --git a/docs/htmldocs/nmblookup.1.html b/docs/htmldocs/nmblookup.1.html index 26320c93b2..21e84c9c71 100644 --- a/docs/htmldocs/nmblookup.1.html +++ b/docs/htmldocs/nmblookup.1.html @@ -1,322 +1,105 @@ - - - %globalentities; - ]> - - - - nmblookup - 1 - - - - - nmblookup - NetBIOS over TCP/IP client used to lookup NetBIOS - names - - - - - nmblookup - -M - -R - -S - -r - -A - -h - -B <broadcast address> - -U <unicast address> - -d <debug level> - -s <smb config file> - -i <NetBIOS scope> - -T - -f - name - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - nmblookup is used to query NetBIOS names +nmblookup

Name

nmblookup — NetBIOS over TCP/IP client used to lookup NetBIOS + names

Synopsis

nmblookup [-M] [-R] [-S] [-r] [-A] [-h] [-B <broadcast address>] [-U <unicast address>] [-d <debug level>] [-s <smb config file>] [-i <NetBIOS scope>] [-T] [-f] {name}

DESCRIPTION

This tool is part of the Samba(7) suite.

nmblookup is used to query NetBIOS names and map them to IP addresses in a network using NetBIOS over TCP/IP queries. The options allow the name queries to be directed at a particular IP broadcast area or to a particular machine. All queries - are done over UDP. - - - - OPTIONS - - - - -M - Searches for a master browser by looking - up the NetBIOS name name with a - type of 0x1d. If - name is "-" then it does a lookup on the special name - __MSBROWSE__. Please note that in order to + are done over UDP.

OPTIONS

-M

Searches for a master browser by looking + up the NetBIOS name name with a + type of 0x1d. If + name is "-" then it does a lookup on the special name + __MSBROWSE__. Please note that in order to use the name "-", you need to make sure "-" isn't parsed as an argument, e.g. use : - nmblookup -M -- -. - - - - -R - Set the recursion desired bit in the packet + nmblookup -M -- -.

-R

Set the recursion desired bit in the packet to do a recursive lookup. This is used when sending a name query to a machine running a WINS server and the user wishes to query the names in the WINS server. If this bit is unset the normal (broadcast responding) NetBIOS processing code on a machine is used instead. See RFC1001, RFC1002 for details. - - - - - -S - Once the name query has returned an IP +

-S

Once the name query has returned an IP address then do a node status query as well. A node status query returns the NetBIOS names registered by a host. - - - - - - -r - Try and bind to UDP port 137 to send and receive UDP +

-r

Try and bind to UDP port 137 to send and receive UDP datagrams. The reason for this option is a bug in Windows 95 where it ignores the source port of the requesting packet and only replies to UDP port 137. Unfortunately, on most UNIX systems root privilege is needed to bind to this port, and - in addition, if the nmbd - 8 daemon is running on this machine it also binds to this port. - - - - - - -A - Interpret name as - an IP Address and do a node status query on this address. - - - - - - - - --n <primary NetBIOS name> -This option allows you to override + in addition, if the nmbd(8) daemon is running on this machine it also binds to this port. +

-A

Interpret name as + an IP Address and do a node status query on this address.

-n <primary NetBIOS name>

This option allows you to override the NetBIOS name that Samba uses for itself. This is identical -to setting the netbios namenetbios name parameter in the smb.conf file. +to setting the netbios name parameter in the smb.conf file. However, a command line setting will take precedence over settings in -smb.conf. - - - --i <scope> -This specifies a NetBIOS scope that -nmblookup will use to communicate with when +smb.conf.

-i <scope>

This specifies a NetBIOS scope that +nmblookup will use to communicate with when generating NetBIOS names. For details on the use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes are -very rarely used, only set this parameter +very rarely used, only set this parameter if you are the system administrator in charge of all the -NetBIOS systems you communicate with. - - - --W|--workgroup=domain -Set the SMB domain of the username. This +NetBIOS systems you communicate with.

-W|--workgroup=domain

Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local -SAM (as opposed to the Domain SAM). - - - --O socket options -TCP socket options to set on the client +SAM (as opposed to the Domain SAM).

-O socket options

TCP socket options to set on the client socket. See the socket options parameter in -the smb.conf manual page for the list of valid -options. - - - - - --h|--help -Print a summary of command line options. - - - - - -B <broadcast address> - Send the query to the given broadcast address. Without +the smb.conf manual page for the list of valid +options.

-h|--help

Print a summary of command line options. +

-B <broadcast address>

Send the query to the given broadcast address. Without this option the default behavior of nmblookup is to send the query to the broadcast address of the network interfaces as - either auto-detected or defined in the interfaces - parameter of the smb.conf - 5 file. - - - - - - - -U <unicast address> - Do a unicast query to the specified address or - host unicast address. This option - (along with the -R option) is needed to - query a WINS server. - - - - - - --V -Prints the version number for -smbd. - - - --s <configuration file> -The file specified contains the + either auto-detected or defined in the interfaces + parameter of the smb.conf(5) file. +

-U <unicast address>

Do a unicast query to the specified address or + host unicast address. This option + (along with the -R option) is needed to + query a WINS server.

-V

Prints the version number for +smbd.

-s <configuration file>

The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - --d|--debug=debuglevel - -debuglevel is an integer +compile time.

-d|--debug=debuglevel

debuglevel is an integer from 0 to 10. The default value if this parameter is -not specified is zero. - -The higher this value, the more detail will be +not specified is zero.

The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of -information about operations carried out. - -Levels above 1 will generate considerable +information about operations carried out.

Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log -data, most of which is extremely cryptic. - -Note that specifying this parameter here will -override the log levellog level parameter -in the smb.conf file. - - - - --l|--logfile=logbasename -File name for log/debug files. The extension -".client" will be appended. The log file is +data, most of which is extremely cryptic.

Note that specifying this parameter here will +override the log level parameter +in the smb.conf file.

-l|--logfile=logbasename

File name for log/debug files. The extension +".client" will be appended. The log file is never removed by the client. - - - - - - -T - This causes any IP addresses found in the +

-T

This causes any IP addresses found in the lookup to be looked up via a reverse DNS lookup into a - DNS name, and printed out before each - - IP address .... NetBIOS name - - pair that is the normal output. - - - - -f - + DNS name, and printed out before each

IP address .... NetBIOS name

pair that is the normal output.

-f

Show which flags apply to the name that has been looked up. Possible answers are zero or more of: Response, Authoritative, Truncated, Recursion_Desired, Recursion_Available, Broadcast. - - - - - - name - This is the NetBIOS name being queried. Depending +

name

This is the NetBIOS name being queried. Depending upon the previous options this may be a NetBIOS name or IP address. If a NetBIOS name then the different name types may be specified by appending '#<type>' to the name. This name may also be '*', which will return all registered names within a broadcast - area. - - - - - - - EXAMPLES - - nmblookup can be used to query - a WINS server (in the same way nslookup is - used to query DNS servers). To query a WINS server, nmblookup - must be called like this: - - nmblookup -U server -R 'name' - - For example, running : - - nmblookup -U samba.org -R 'IRIX#1B' - - would query the WINS server samba.org for the domain - master browser (1B name type) for the IRIX workgroup. - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - SEE ALSO - nmbd - 8, samba - 7, and smb.conf - 5. - - - - AUTHOR - - The original Samba software and related utilities + area.

EXAMPLES

nmblookup can be used to query + a WINS server (in the same way nslookup is + used to query DNS servers). To query a WINS server, nmblookup + must be called like this:

nmblookup -U server -R 'name'

For example, running :

nmblookup -U samba.org -R 'IRIX#1B'

would query the WINS server samba.org for the domain + master browser (1B name type) for the IRIX workgroup.

VERSION

This man page is correct for version 3.0 of + the Samba suite.

AUTHOR

The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook - XML 4.2 for Samba 3.0 was done by Alexander Bokovoy. - - - + XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.

diff --git a/docs/htmldocs/ntlm_auth.1.html b/docs/htmldocs/ntlm_auth.1.html index 3fe48ac02d..e048efae7b 100644 --- a/docs/htmldocs/ntlm_auth.1.html +++ b/docs/htmldocs/ntlm_auth.1.html @@ -31,7 +31,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

-l|--logfile=logbasename

File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. diff --git a/docs/htmldocs/optional.html b/docs/htmldocs/optional.html new file mode 100644 index 0000000000..bd76a344f8 --- /dev/null +++ b/docs/htmldocs/optional.html @@ -0,0 +1,35 @@ +Part III. Advanced Configuration

Advanced Configuration

Valuable Nuts and Bolts Information

+Samba has several features that you might want or might not want to use. The chapters in this part each cover specific Samba features. +

Table of Contents

10. Samba / MS Windows Network Browsing Guide
Features and Benefits
What is Browsing?
Discussion
NetBIOS over TCP/IP
TCP/IP - without NetBIOS
DNS and Active Directory
How Browsing Functions
Setting up WORKGROUP Browsing
Setting up DOMAIN Browsing
Forcing Samba to be the master
Making Samba the domain master
Note about broadcast addresses
Multiple interfaces
Use of the Remote Announce parameter
Use of the Remote Browse Sync parameter
WINS - The Windows Internetworking Name Server
Setting up a WINS server
WINS Replication
Static WINS Entries
Helpful Hints
Windows Networking Protocols
Name Resolution Order
Technical Overview of browsing
Browsing support in Samba
Problem resolution
Browsing across subnets
Common Errors
How can one flush the Samba NetBIOS name cache without restarting Samba?
My client reports "This server is not configured to list shared resources"
I get an Unable to browse the network error
11. Account Information Databases
Features and Benefits
Backwards Compatibility Backends
New Backends
Technical Information
Important Notes About Security
Mapping User Identifiers between MS Windows and UNIX
Mapping Common UIDs/GIDs on Distributed Machines
Account Management Tools
The smbpasswd Command
The pdbedit Command
Password Backends
Plain Text
smbpasswd - Encrypted Password Database
tdbsam
ldapsam
MySQL
XML
Common Errors
Users can not logon
Users being added to wrong backend database
auth methods does not work
12. Mapping MS Windows and UNIX Groups
Features and Benefits
Discussion
Example Configuration
Configuration Scripts
Sample smb.conf add group script
Script to configure Group Mapping
Common Errors
Adding Groups Fails
Adding MS Windows Groups to MS Windows Groups Fails
Adding Domain Users to the Power Users group
13. File, Directory and Share Access Controls
Features and Benefits
File System Access Controls
MS Windows NTFS Comparison with UNIX File Systems
Managing Directories
File and Directory Access Control
Share Definition Access Controls
User and Group Based Controls
File and Directory Permissions Based Controls
Miscellaneous Controls
Access Controls on Shares
Share Permissions Management
MS Windows Access Control Lists and UNIX Interoperability
Managing UNIX permissions Using NT Security Dialogs
Viewing File Security on a Samba Share
Viewing file ownership
Viewing File or Directory Permissions
Modifying file or directory permissions
Interaction with the standard Samba create mask + parameters
Interaction with the standard Samba file attribute mapping
Common Errors
Users can not write to a public share
I have set force user but Samba still makes root the owner of all the files I touch!
MS Word with Samba changes owner of file
14. File and Record Locking
Features and Benefits
Discussion
Opportunistic Locking Overview
Samba Opportunistic Locking Control
Example Configuration
MS Windows Opportunistic Locking and Caching Controls
Workstation Service Entries
Server Service Entries
Persistent Data Corruption
Common Errors
locking.tdb error messages
Problems saving files in MS Office on Windows XP
Long delays deleting files over network with XP SP1
Additional Reading
15. Securing Samba
Introduction
Features and Benefits
Technical Discussion of Protective Measures and Issues
Using host based protection
User based protection
Using interface protection
Using a firewall
Using a IPC$ share deny
NTLMv2 Security
Upgrading Samba
Common Errors
Smbclient works on localhost, but the network is dead
Why can users access home directories of other users?
16. Interdomain Trust Relationships
Features and Benefits
Trust Relationship Background
Native MS Windows NT4 Trusts Configuration
Creating an NT4 Domain Trust
Completing an NT4 Domain Trust
Inter-Domain Trust Facilities
Configuring Samba NT-style Domain Trusts
Samba as the Trusted Domain
Samba as the Trusting Domain
NT4-style Domain Trusts with Windows 2000
Common Errors
17. Hosting a Microsoft Distributed File System tree on Samba
Features and Benefits
Common Errors
18. Classical Printing Support
Features and Benefits
Technical Introduction
What happens if you send a Job from a Client
Printing Related Configuration Parameters
Parameters Recommended for Use
A simple Configuration to Print
Verification of "Settings in Use" with testparm
A little Experiment to warn you
Extended Sample Configuration to Print
Detailed Explanation of the Example's Settings
The [global] Section
The [printers] Section
Any [my_printer_name] Section
Print Commands
Default Print Commands for various UNIX Print Subsystems
Setting up your own Print Commands
Innovations in Samba Printing since 2.2
Client Drivers on Samba Server for Point'n'Print
The [printer$] Section is removed from Samba 3
Creating the [print$] Share
Parameters in the [print$] Section
Subdirectory Structure in [print$]
Installing Drivers into [print$]
Setting Drivers for existing Printers with a Client GUI
Setting Drivers for existing Printers with +rpcclient
Client Driver Install Procedure
The first Client Driver Installation
IMPORTANT! Setting Device Modes on new Printers
Further Client Driver Install Procedures
Always make first Client Connection as root or "printer admin"
Other Gotchas
Setting Default Print Options for the Client Drivers
Supporting large Numbers of Printers
Adding new Printers with the Windows NT APW
Weird Error Message Cannot connect under a +different Name
Be careful when assembling Driver Files
Samba and Printer Ports
Avoiding the most common Misconfigurations of the Client Driver
The Imprints Toolset
What is Imprints?
Creating Printer Driver Packages
The Imprints Server
The Installation Client
Add Network Printers at Logon without User Interaction
The addprinter command
Migration of "Classical" printing to Samba
Publishing Printer Information in Active Directory or LDAP
Common Errors
I give my root password but I don't get access
My printjobs get spooled into the spooling directory, but then get lost
19. CUPS Printing Support in Samba 3.0
Introduction
Features and Benefits
Overview
Basic Configuration of CUPS support
Linking of smbd with libcups.so
Simple smb.conf Settings for CUPS
More complex smb.conf Settings for +CUPS
Advanced Configuration
Central spooling vs. "Peer-to-Peer" printing
CUPS/Samba as a "spooling-only" Print Server; "raw" printing +with Vendor Drivers on Windows Clients
Driver Installation Methods on Windows Clients
Explicitly enable "raw" printing for +application/octet-stream!
Three familiar Methods for driver upload plus a new one
Using CUPS/Samba in an advanced Way -- intelligent printing +with PostScript Driver Download
GDI on Windows -- PostScript on UNIX
Windows Drivers, GDI and EMF
UNIX Printfile Conversion and GUI Basics
PostScript and Ghostscript
Ghostscript -- the Software RIP for non-PostScript Printers
PostScript Printer Description (PPD) Specification
CUPS can use all Windows-formatted Vendor PPDs
CUPS also uses PPDs for non-PostScript Printers
The CUPS Filtering Architecture
MIME types and CUPS Filters
MIME type Conversion Rules
Filter Requirements
Prefilters
pstops
pstoraster
imagetops and imagetoraster
rasterto [printers specific]
CUPS Backends
cupsomatic/Foomatic -- how do they fit into the Picture?
The Complete Picture
mime.convs
"Raw" printing
"application/octet-stream" printing
PostScript Printer Descriptions (PPDs) for non-PS Printers
Difference between cupsomatic/foomatic-rip and +native CUPS printing
Examples for filtering Chains
Sources of CUPS drivers / PPDs
Printing with Interface Scripts
Network printing (purely Windows)
From Windows Clients to an NT Print Server
Driver Execution on the Client
Driver Execution on the Server
Network Printing (Windows clients -- UNIX/Samba Print +Servers)
From Windows Clients to a CUPS/Samba Print Server
Samba receiving Jobfiles and passing them to CUPS
Network PostScript RIP: CUPS Filters on Server -- clients use +PostScript Driver with CUPS-PPDs
PPDs for non-PS Printers on UNIX
PPDs for non-PS Printers on Windows
Windows Terminal Servers (WTS) as CUPS Clients
Printer Drivers running in "Kernel Mode" cause many +Problems
Workarounds impose Heavy Limitations
CUPS: a "Magical Stone"?
PostScript Drivers with no major problems -- even in Kernel +Mode
Setting up CUPS for driver Download
cupsaddsmb: the unknown Utility
Prepare your smb.conf for cupsaddsmb
CUPS Package of "PostScript Driver for WinNT/2k/XP"
Recognize the different Driver Files
Acquiring the Adobe Driver Files
ESP Print Pro Package of "PostScript Driver for +WinNT/2k/XP"
Caveats to be considered
Benefits of using "CUPS PostScript Driver for +Windows NT/2k/XP" instead of Adobe Driver
Run "cupsaddsmb" (quiet Mode)
Run "cupsaddsmb" with verbose Output
Understanding cupsaddsmb
How to recognize if cupsaddsmb completed successfully
cupsaddsmb with a Samba PDC
cupsaddsmb Flowchart
Installing the PostScript Driver on a Client
Avoiding critical PostScript Driver Settings on the +Client
Installing PostScript Driver Files manually (using +rpcclient)
A Check of the rpcclient man Page
Understanding the rpcclient man page
Producing an Example by querying a Windows Box
What is required for adddriver and setdriver to succeed
Manual Driver Installation in 15 Steps
Troubleshooting revisited
The printing *.tdb Files
Trivial DataBase Files
Binary Format
Losing *.tdb Files
Using tdbbackup
CUPS Print Drivers from Linuxprinting.org
foomatic-rip and Foomatic explained
foomatic-rip and Foomatic-PPD Download and Installation
Page Accounting with CUPS
Setting up Quotas
Correct and incorrect Accounting
Adobe and CUPS PostScript Drivers for Windows Clients
The page_log File Syntax
Possible Shortcomings
Future Developments
Other Accounting Tools
Additional Material
Auto-Deletion or Preservation of CUPS Spool Files
CUPS Configuration Settings explained
Pre-conditions
Manual Configuration
In Case of Trouble.....
Printing from CUPS to Windows attached +Printers
More CUPS filtering Chains
Common Errors
Win9x client can't install driver
"cupsaddsmb" keeps asking for root password in + neverending loop
"cupsaddsmb" gives "No PPD file for printer..." + message while PPD file is present
Client can't connect to Samba printer
Can't reconnect to Samba under new account + from Win2K/XP
Avoid being connected to the Samba server as the + "wrong" user
Upgrading to CUPS drivers from Adobe drivers on + NT/2K/XP clients gives problems
Can't use "cupsaddsmb" on Samba server which is + a PDC
Deleted Win2K printer driver is still shown
Win2K/XP "Local Security + Policies"
WinXP clients: "Administrator can not install + printers for all local users"
"Print Change Notify" functions on + NT-clients
WinXP-SP1
Print options for all users can't be set on Win2K/XP
Most common blunders in driver + settings on Windows clients
cupsaddsmb does not work + with newly installed printer
Permissions on +/var/spool/samba/ get reset after each +reboot
Printer named "lp" +intermittently swallows jobs and spits out completely different +ones
Location of Adobe PostScript driver files necessary for "cupsaddsmb"
An Overview of the CUPS Printing Processes
20. Stackable VFS modules
Features and Benefits
Discussion
Included modules
audit
extd_audit
fake_perms
recycle
netatalk
VFS modules available elsewhere
DatabaseFS
vscan
21. Winbind: Use of Domain Accounts
Features and Benefits
Introduction
What Winbind Provides
Target Uses
How Winbind Works
Microsoft Remote Procedure Calls
Microsoft Active Directory Services
Name Service Switch
Pluggable Authentication Modules
User and Group ID Allocation
Result Caching
Installation and Configuration
Introduction
Requirements
Testing Things Out
Conclusion
Common Errors
NSCD Problem Warning
22. Advanced Network Management
Features and Benefits
Remote Server Administration
Remote Desktop Management
Remote Management from NoMachines.Com
Network Logon Script Magic
Adding printers without user intervention
Common Errors
23. System and Account Policies
Features and Benefits
Creating and Managing System Policies
Windows 9x/Me Policies
Windows NT4 Style Policy Files
MS Windows 200x / XP Professional Policies
Managing Account/User Policies
Samba Editreg Toolset
Windows NT4/200x
Samba PDC
System Startup and Logon Processing Overview
Common Errors
Policy Does Not Work
24. Desktop Profile Management
Features and Benefits
Roaming Profiles
Samba Configuration for Profile Handling
Windows Client Profile Configuration Information
Sharing Profiles between W9x/Me and NT4/200x/XP workstations
Profile Migration from Windows NT4/200x Server to Samba
Mandatory profiles
Creating/Managing Group Profiles
Default Profile for Windows Users
MS Windows 9x/Me
MS Windows NT4 Workstation
MS Windows 200x/XP
Common Errors
Setting up roaming profiles for just a few user's or group's?
Can NOT use Roaming Profiles
Changing the default profile
25. PAM based Distributed Authentication
Features and Benefits
Technical Discussion
PAM Configuration Syntax
Example System Configurations
smb.conf PAM Configuration
Remote CIFS Authentication using winbindd.so
Password Synchronization using pam_smbpass.so
Common Errors
pam_winbind problem
Winbind is not resolving users and groups
26. Integrating MS Windows networks with Samba
Features and Benefits
Background Information
Name Resolution in a pure UNIX/Linux world
/etc/hosts
/etc/resolv.conf
/etc/host.conf
/etc/nsswitch.conf
Name resolution as used within MS Windows networking
The NetBIOS Name Cache
The LMHOSTS file
HOSTS file
DNS Lookup
WINS Lookup
Common Errors
Pinging works only in one way
Very Slow Network Connections
Samba server name change problem
27. Unicode/Charsets
Features and Benefits
What are charsets and unicode?
Samba and charsets
Conversion from old names
Japanese charsets
Common errors
CP850.so can't be found
28. Samba Backup Techniques
Note
Features and Benefits
29. High Availability Options
Note
diff --git a/docs/htmldocs/pam.html b/docs/htmldocs/pam.html new file mode 100644 index 0000000000..8edbdb26ca --- /dev/null +++ b/docs/htmldocs/pam.html @@ -0,0 +1,565 @@ +Chapter 25. PAM based Distributed Authentication

Chapter 25. PAM based Distributed Authentication

John H. Terpstra

Samba Team

Stephen Langasek

May 31, 2003

+This chapter you should help you to deploy winbind based authentication on any PAM enabled +UNIX/Linux system. Winbind can be used to enable user level application access authentication +from any MS Windows NT Domain, MS Windows 200x Active Directory based domain, or any Samba +based domain environment. It will also help you to configure PAM based local host access +controls that are appropriate to your Samba configuration. +

+In addition to knowing how to configure winbind into PAM, you will learn generic PAM management +possibilities and in particular how to deploy tools like pam_smbpass.so to your advantage. +

Note

+The use of Winbind require more than PAM configuration alone. Please refer to the Winbind chapter. +

Features and Benefits

+A number of UNIX systems (eg: Sun Solaris), as well as the xxxxBSD family and Linux, +now utilize the Pluggable Authentication Modules (PAM) facility to provide all authentication, +authorization and resource control services. Prior to the introduction of PAM, a decision +to use an alternative to the system password database (/etc/passwd) +would require the provision of alternatives for all programs that provide security services. +Such a choice would involve provision of alternatives to such programs as: login, +passwd, chown, etc. +

+PAM provides a mechanism that disconnects these security programs from the underlying +authentication/authorization infrastructure. PAM is configured either through one file +/etc/pam.conf (Solaris), or by editing individual files that are +located in /etc/pam.d. +

+On PAM enabled UNIX/Linux systems it is an easy matter to configure the system to use any +authentication backend, so long as the appropriate dynamically loadable library modules +are available for it. The backend may be local to the system, or may be centralised on a +remote server. +

+PAM support modules are available for: +

/etc/passwd:

+ There are several PAM modules that interact with this standard UNIX user + database. The most common are called: pam_unix.so, pam_unix2.so, pam_pwdb.so + and pam_userdb.so. +

Kerberos:

+ The pam_krb5.so module allows the use of any Kerberos compliant server. + This tool is used to access MIT Kerberos, Heimdal Kerberos, and potentially + Microsoft Active Directory (if enabled). +

LDAP:

+ The pam_ldap.so module allows the use of any LDAP v2 or v3 compatible backend + server. Commonly used LDAP backend servers include: OpenLDAP v2.0 and v2.1, + Sun ONE iDentity server, Novell eDirectory server, Microsoft Active Directory. +

NetWare Bindery:

+ The pam_ncp_auth.so module allows authentication off any bindery enabled + NetWare Core Protocol based server. +

SMB Password:

+ This module, called pam_smbpass.so, will allow user authentication off + the passdb backend that is configured in the Samba smb.conf file. +

SMB Server:

+ The pam_smb_auth.so module is the original MS Windows networking authentication + tool. This module has been somewhat outdated by the Winbind module. +

Winbind:

+ The pam_winbind.so module allows Samba to obtain authentication from any + MS Windows Domain Controller. It can just as easily be used to authenticate + users for access to any PAM enabled application. +

RADIUS:

+ There is a PAM RADIUS (Remote Access Dial-In User Service) authentication + module. In most cases the administrator will need to locate the source code + for this tool and compile and install it themselves. RADIUS protocols are + used by many routers and terminal servers. +

+Of the above, Samba provides the pam_smbpasswd.so and the pam_winbind.so modules alone. +

+Once configured, these permit a remarkable level of flexibility in the location and use +of distributed samba domain controllers that can provide wide are network bandwidth +efficient authentication services for PAM capable systems. In effect, this allows the +deployment of centrally managed and maintained distributed authentication from a single +user account database. +

Technical Discussion

+PAM is designed to provide the system administrator with a great deal of flexibility in +configuration of the privilege granting applications of their system. The local +configuration of system security controlled by PAM is contained in one of two places: +either the single system file, /etc/pam.conf; or the /etc/pam.d/ directory. +

PAM Configuration Syntax

+In this section we discuss the correct syntax of and generic options respected by entries to these files. +PAM specific tokens in the configuration file are case insensitive. The module paths, however, are case +sensitive since they indicate a file's name and reflect the case dependence of typical file-systems. +The case-sensitivity of the arguments to any given module is defined for each module in turn. +

+In addition to the lines described below, there are two special characters provided for the convenience +of the system administrator: comments are preceded by a `#' and extend to the next end-of-line; also, +module specification lines may be extended with a `\' escaped newline. +

+If the PAM authentication module (loadable link library file) is located in the +default location then it is not necessary to specify the path. In the case of +Linux, the default location is /lib/security. If the module +is located outside the default then the path must be specified as: +

+

+auth  required  /other_path/pam_strange_module.so
+

+

Anatomy of /etc/pam.d Entries

+The remaining information in this subsection was taken from the documentation of the Linux-PAM +project. For more information on PAM, see +The Official Linux-PAM home page +

+A general configuration line of the /etc/pam.conf file has the following form: +

+

+service-name   module-type   control-flag   module-path   args
+

+

+Below, we explain the meaning of each of these tokens. The second (and more recently adopted) +way of configuring Linux-PAM is via the contents of the /etc/pam.d/ directory. +Once we have explained the meaning of the above tokens, we will describe this method. +

service-name:

+ The name of the service associated with this entry. Frequently the service name is the conventional + name of the given application. For example, `ftpd', `rlogind' and `su', etc. . +

+ There is a special service-name, reserved for defining a default authentication mechanism. It has + the name `OTHER' and may be specified in either lower or upper case characters. Note, when there + is a module specified for a named service, the `OTHER' entries are ignored. +

module-type:

+ One of (currently) four types of module. The four types are as follows: +

  • + auth: this module type provides two aspects of authenticating the user. + Firstly, it establishes that the user is who they claim to be, by instructing the application + to prompt the user for a password or other means of identification. Secondly, the module can + grant group membership (independently of the /etc/groups file discussed + above) or other privileges through its credential granting properties. +

  • + account: this module performs non-authentication based account management. + It is typically used to restrict/permit access to a service based on the time of day, currently + available system resources (maximum number of users) or perhaps the location of the applicant + user `root' login only on the console. +

  • + session: primarily, this module is associated with doing things that need + to be done for the user before/after they can be given service. Such things include the logging + of information concerning the opening/closing of some data exchange with a user, mounting + directories, etc. +

  • + password: this last module type is required for updating the authentication + token associated with the user. Typically, there is one module for each `challenge/response' + based authentication (auth) module-type. +

control-flag:

+ The control-flag is used to indicate how the PAM library will react to the success or failure of the + module it is associated with. Since modules can be stacked (modules of the same type execute in series, + one after another), the control-flags determine the relative importance of each module. The application + is not made aware of the individual success or failure of modules listed in the + /etc/pam.conf file. Instead, it receives a summary success or fail response from + the Linux-PAM library. The order of execution of these modules is that of the entries in the + /etc/pam.conf file; earlier entries are executed before later ones. + As of Linux-PAM v0.60, this control-flag can be defined with one of two syntaxes. +

+ The simpler (and historical) syntax for the control-flag is a single keyword defined to indicate the + severity of concern associated with the success or failure of a specific module. There are four such + keywords: required, requisite, sufficient and optional. +

+ The Linux-PAM library interprets these keywords in the following manner: +

  • + required: this indicates that the success of the module is required for the + module-type facility to succeed. Failure of this module will not be apparent to the user until all + of the remaining modules (of the same module-type) have been executed. +

  • + requisite: like required, however, in the case that such a module returns a + failure, control is directly returned to the application. The return value is that associated with + the first required or requisite module to fail. Note, this flag can be used to protect against the + possibility of a user getting the opportunity to enter a password over an unsafe medium. It is + conceivable that such behavior might inform an attacker of valid accounts on a system. This + possibility should be weighed against the not insignificant concerns of exposing a sensitive + password in a hostile environment. +

  • + sufficient: the success of this module is deemed `sufficient' to satisfy + the Linux-PAM library that this module-type has succeeded in its purpose. In the event that no + previous required module has failed, no more `stacked' modules of this type are invoked. (Note, + in this case subsequent required modules are not invoked.). A failure of this module is not deemed + as fatal to satisfying the application that this module-type has succeeded. +

  • + optional: as its name suggests, this control-flag marks the module as not + being critical to the success or failure of the user's application for service. In general, + Linux-PAM ignores such a module when determining if the module stack will succeed or fail. + However, in the absence of any definite successes or failures of previous or subsequent stacked + modules this module will determine the nature of the response to the application. One example of + this latter case, is when the other modules return something like PAM_IGNORE. +

+ The more elaborate (newer) syntax is much more specific and gives the administrator a great deal of control + over how the user is authenticated. This form of the control flag is delimited with square brackets and + consists of a series of value=action tokens: +

+[value1=action1 value2=action2 ...]
+

+ Here, value1 is one of the following return values: success; open_err; symbol_err; service_err; + system_err; buf_err; perm_denied; auth_err; cred_insufficient; authinfo_unavail; user_unknown; maxtries; + new_authtok_reqd; acct_expired; session_err; cred_unavail; cred_expired; cred_err; no_module_data; conv_err; + authtok_err; authtok_recover_err; authtok_lock_busy; authtok_disable_aging; try_again; ignore; abort; + authtok_expired; module_unknown; bad_item; and default. The last of these (default) can be used to set + the action for those return values that are not explicitly defined. +

+ The action1 can be a positive integer or one of the following tokens: ignore; ok; done; bad; die; and reset. + A positive integer, J, when specified as the action, can be used to indicate that the next J modules of the + current module-type will be skipped. In this way, the administrator can develop a moderately sophisticated + stack of modules with a number of different paths of execution. Which path is taken can be determined by the + reactions of individual modules. +

  • + ignore: when used with a stack of modules, the module's return status will not + contribute to the return code the application obtains. +

  • + bad: this action indicates that the return code should be thought of as indicative + of the module failing. If this module is the first in the stack to fail, its status value will be used + for that of the whole stack. +

  • + die: equivalent to bad with the side effect of terminating the module stack and + PAM immediately returning to the application. +

  • + ok: this tells PAM that the administrator thinks this return code should + contribute directly to the return code of the full stack of modules. In other words, if the former + state of the stack would lead to a return of PAM_SUCCESS, the module's return code will override + this value. Note, if the former state of the stack holds some value that is indicative of a modules + failure, this 'ok' value will not be used to override that value. +

  • + done: equivalent to ok with the side effect of terminating the module stack and + PAM immediately returning to the application. +

  • + reset: clear all memory of the state of the module stack and start again with + the next stacked module. +

+ Each of the four keywords: required; requisite; sufficient; and optional, have an equivalent expression in + terms of the [...] syntax. They are as follows: +

+

  • + required is equivalent to [success=ok new_authtok_reqd=ok ignore=ignore default=bad] +

  • + requisite is equivalent to [success=ok new_authtok_reqd=ok ignore=ignore default=die] +

  • + sufficient is equivalent to [success=done new_authtok_reqd=done default=ignore] +

  • + optional is equivalent to [success=ok new_authtok_reqd=ok default=ignore] +

+

+ Just to get a feel for the power of this new syntax, here is a taste of what you can do with it. With Linux-PAM-0.63, + the notion of client plug-in agents was introduced. This is something that makes it possible for PAM to support + machine-machine authentication using the transport protocol inherent to the client/server application. With the + [ ... value=action ... ] control syntax, it is possible for an application to be configured + to support binary prompts with compliant clients, but to gracefully fall over into an alternative authentication + mode for older, legacy, applications. +

module-path:

+ The path-name of the dynamically loadable object file; the pluggable module itself. If the first character of the + module path is `/', it is assumed to be a complete path. If this is not the case, the given module path is appended + to the default module path: /lib/security (but see the notes above). +

+ The args are a list of tokens that are passed to the module when it is invoked. Much like arguments to a typical + Linux shell command. Generally, valid arguments are optional and are specific to any given module. Invalid arguments + are ignored by a module, however, when encountering an invalid argument, the module is required to write an error + to syslog(3). For a list of generic options see the next section. +

+ Note, if you wish to include spaces in an argument, you should surround that argument with square brackets. For example: +

+squid auth required pam_mysql.so user=passwd_query passwd=mada \
+        db=eminence [query=select user_name from internet_service where \
+                     user_name='%u' and password=PASSWORD('%p') and \
+                     service='web_proxy']
+

+ Note, when using this convention, you can include `[' characters inside the string, and if you wish to include a `]' + character inside the string that will survive the argument parsing, you should use `\['. In other words: +

+[..[..\]..]    -->   ..[..]..
+

+ Any line in (one of) the configuration file(s), that is not formatted correctly, will generally tend (erring on the + side of caution) to make the authentication process fail. A corresponding error is written to the system log files + with a call to syslog(3). +

Example System Configurations

+The following is an example /etc/pam.d/login configuration file. +This example had all options been uncommented is probably not usable +as it stacks many conditions before allowing successful completion +of the login process. Essentially all conditions can be disabled +by commenting them out except the calls to pam_pwdb.so. +

PAM: original login config

+#%PAM-1.0
+# The PAM configuration file for the `login' service
+#
+auth         required    pam_securetty.so
+auth         required    pam_nologin.so
+# auth       required    pam_dialup.so
+# auth       optional    pam_mail.so
+auth         required    pam_pwdb.so shadow md5
+# account    requisite   pam_time.so
+account      required    pam_pwdb.so
+session      required    pam_pwdb.so
+# session    optional    pam_lastlog.so
+# password   required    pam_cracklib.so retry=3
+password     required    pam_pwdb.so shadow md5
+

PAM: login using pam_smbpass

+PAM allows use of replaceable modules. Those available on a sample system include: +

$/bin/ls /lib/security +

+pam_access.so    pam_ftp.so          pam_limits.so     
+pam_ncp_auth.so  pam_rhosts_auth.so  pam_stress.so     
+pam_cracklib.so  pam_group.so        pam_listfile.so   
+pam_nologin.so   pam_rootok.so       pam_tally.so      
+pam_deny.so      pam_issue.so        pam_mail.so       
+pam_permit.so    pam_securetty.so    pam_time.so       
+pam_dialup.so    pam_lastlog.so      pam_mkhomedir.so  
+pam_pwdb.so      pam_shells.so       pam_unix.so       
+pam_env.so       pam_ldap.so         pam_motd.so       
+pam_radius.so    pam_smbpass.so      pam_unix_acct.so  
+pam_wheel.so     pam_unix_auth.so    pam_unix_passwd.so
+pam_userdb.so    pam_warn.so         pam_unix_session.so
+

+The following example for the login program replaces the use of +the pam_pwdb.so module which uses the system +password database (/etc/passwd, +/etc/shadow, /etc/group) with +the module pam_smbpass.so which uses the Samba +database which contains the Microsoft MD4 encrypted password +hashes. This database is stored in either +/usr/local/samba/private/smbpasswd, +/etc/samba/smbpasswd, or in +/etc/samba.d/smbpasswd, depending on the +Samba implementation for your UNIX/Linux system. The +pam_smbpass.so module is provided by +Samba version 2.2.1 or later. It can be compiled by specifying the +--with-pam_smbpass options when running Samba's +configure script. For more information +on the pam_smbpass module, see the documentation +in the source/pam_smbpass directory of the Samba +source distribution. +

+#%PAM-1.0
+# The PAM configuration file for the `login' service
+#
+auth        required    pam_smbpass.so nodelay
+account     required    pam_smbpass.so nodelay
+session     required    pam_smbpass.so nodelay
+password    required    pam_smbpass.so nodelay
+

+The following is the PAM configuration file for a particular +Linux system. The default condition uses pam_pwdb.so. +

+#%PAM-1.0
+# The PAM configuration file for the `samba' service
+#
+auth       required     pam_pwdb.so nullok nodelay shadow audit
+account    required     pam_pwdb.so audit nodelay
+session    required     pam_pwdb.so nodelay
+password   required     pam_pwdb.so shadow md5
+

+In the following example the decision has been made to use the +smbpasswd database even for basic samba authentication. Such a +decision could also be made for the passwd program and would +thus allow the smbpasswd passwords to be changed using the passwd +program. +

+#%PAM-1.0
+# The PAM configuration file for the `samba' service
+#
+auth       required     pam_smbpass.so nodelay
+account    required     pam_pwdb.so audit nodelay
+session    required     pam_pwdb.so nodelay
+password   required     pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf
+

Note

PAM allows stacking of authentication mechanisms. It is +also possible to pass information obtained within one PAM module through +to the next module in the PAM stack. Please refer to the documentation for +your particular system implementation for details regarding the specific +capabilities of PAM in this environment. Some Linux implementations also +provide the pam_stack.so module that allows all +authentication to be configured in a single central file. The +pam_stack.so method has some very devoted followers +on the basis that it allows for easier administration. As with all issues in +life though, every decision makes trade-offs, so you may want examine the +PAM documentation for further helpful information. +

smb.conf PAM Configuration

+ There is an option in smb.conf called obey pam restrictions. +The following is from the on-line help for this option in SWAT; +

+When Samba is configured to enable PAM support (i.e. +--with-pam), this parameter will +control whether or not Samba should obey PAM's account +and session management directives. The default behavior +is to use PAM for clear text authentication only and to +ignore any account or session management. Note that Samba always +ignores PAM for authentication in the case of +encrypt passwords = yes. +The reason is that PAM modules cannot support the challenge/response +authentication mechanism needed in the presence of SMB +password encryption. +

Default: obey pam restrictions = no

Remote CIFS Authentication using winbindd.so

+All operating systems depend on the provision of users credentials acceptable to the platform. +UNIX requires the provision of a user identifier (UID) as well as a group identifier (GID). +These are both simple integer type numbers that are obtained from a password backend such +as /etc/passwd. +

+Users and groups on a Windows NT server are assigned a relative id (rid) which is unique for +the domain when the user or group is created. To convert the Windows NT user or group into +a unix user or group, a mapping between rids and unix user and group ids is required. This +is one of the jobs that winbind performs. +

+As winbind users and groups are resolved from a server, user and group ids are allocated +from a specified range. This is done on a first come, first served basis, although all +existing users and groups will be mapped as soon as a client performs a user or group +enumeration command. The allocated unix ids are stored in a database file under the Samba +lock directory and will be remembered. +

+The astute administrator will realize from this that the combination of pam_smbpass.so, +winbindd, and a distributed passdb backend, such as ldap, will allow the establishment of a +centrally managed, distributed user/password database that can also be used by all PAM (eg: Linux) aware +programs and applications. This arrangement can have particularly potent advantages compared with the use of +Microsoft Active Directory Service (ADS) in so far as reduction of wide area network authentication traffic. +

Warning

+The rid to unix id database is the only location where the user and group mappings are +stored by winbindd. If this file is deleted or corrupted, there is no way for winbindd +to determine which user and group ids correspond to Windows NT user and group rids. +

Password Synchronization using pam_smbpass.so

+pam_smbpass is a PAM module which can be used on conforming systems to +keep the smbpasswd (Samba password) database in sync with the unix +password file. PAM (Pluggable Authentication Modules) is an API supported +under some Unices, such as Solaris, HPUX and Linux, that provides a +generic interface to authentication mechanisms. +

+This module authenticates a local smbpasswd user database. If you require +support for authenticating against a remote SMB server, or if you're +concerned about the presence of suid root binaries on your system, it is +recommended that you use pam_winbind instead. +

+Options recognized by this module are as follows: +

Table 25.1. Options recognized by pam_smbpass

debuglog more debugging info
auditlike debug, but also logs unknown usernames
use_first_passdon't prompt the user for passwords; take them from PAM_ items instead
try_first_passtry to get the password from a previous PAM module, fall back to prompting the user
use_authtoklike try_first_pass, but *fail* if the new PAM_AUTHTOK has not been previously set. (intended for stacking password modules only)
not_set_passdon't make passwords used by this module available to other modules.
nodelaydon't insert ~1 second delays on authentication failure.
nulloknull passwords are allowed.
nonullnull passwords are not allowed. Used to override the Samba configuration.
migrateonly meaningful in an "auth" context; used to update smbpasswd file with a password used for successful authentication.
smbconf=filespecify an alternate path to the smb.conf file.

+

+

  • Andrew Morgan, for providing the Linux-PAM + framework, without which none of this would have happened

  • Christian Gafton and Andrew Morgan again, for the + pam_pwdb module upon which pam_smbpass was originally based

  • Luke Leighton for being receptive to the idea, + and for the occasional good-natured complaint about the project's status + that keep me working on it :)

. +

+The following are examples of the use of pam_smbpass.so in the format of Linux +/etc/pam.d/ files structure. Those wishing to implement this +tool on other platforms will need to adapt this appropriately. +

Password Synchronisation Configuration

+A sample PAM configuration that shows the use of pam_smbpass to make +sure private/smbpasswd is kept in sync when /etc/passwd (/etc/shadow) +is changed. Useful when an expired password might be changed by an +application (such as ssh). +

+#%PAM-1.0
+# password-sync
+#
+auth       requisite    pam_nologin.so
+auth       required     pam_unix.so
+account    required     pam_unix.so
+password   requisite    pam_cracklib.so retry=3
+password   requisite    pam_unix.so shadow md5 use_authtok try_first_pass
+password   required     pam_smbpass.so nullok use_authtok try_first_pass
+session    required     pam_unix.so
+

Password Migration Configuration

+A sample PAM configuration that shows the use of pam_smbpass to migrate +from plaintext to encrypted passwords for Samba. Unlike other methods, +this can be used for users who have never connected to Samba shares: +password migration takes place when users ftp in, login using ssh, pop +their mail, etc. +

+#%PAM-1.0
+# password-migration
+#
+auth       requisite   pam_nologin.so
+# pam_smbpass is called IF pam_unix succeeds.
+auth       requisite   pam_unix.so
+auth       optional    pam_smbpass.so migrate
+account    required    pam_unix.so
+password   requisite   pam_cracklib.so retry=3
+password   requisite   pam_unix.so shadow md5 use_authtok try_first_pass
+password   optional    pam_smbpass.so nullok use_authtok try_first_pass
+session    required    pam_unix.so
+

Mature Password Configuration

+A sample PAM configuration for a 'mature' smbpasswd installation. +private/smbpasswd is fully populated, and we consider it an error if +the smbpasswd doesn't exist or doesn't match the UNIX password. +

+#%PAM-1.0
+# password-mature
+#
+auth       requisite    pam_nologin.so
+auth       required     pam_unix.so
+account    required     pam_unix.so
+password   requisite    pam_cracklib.so retry=3
+password   requisite    pam_unix.so shadow md5 use_authtok try_first_pass
+password   required     pam_smbpass.so use_authtok use_first_pass
+session    required     pam_unix.so
+

Kerberos Password Integration Configuration

+A sample PAM configuration that shows pam_smbpass used together with +pam_krb5. This could be useful on a Samba PDC that is also a member of +a Kerberos realm. +

+#%PAM-1.0
+# kdc-pdc
+#
+auth       requisite   pam_nologin.so
+auth       requisite   pam_krb5.so
+auth       optional    pam_smbpass.so migrate
+account    required    pam_krb5.so
+password   requisite   pam_cracklib.so retry=3
+password   optional    pam_smbpass.so nullok use_authtok try_first_pass
+password   required    pam_krb5.so use_authtok try_first_pass
+session    required    pam_krb5.so
+

Common Errors

+PAM can be a very fickle and sensitive to configuration glitches. Here we look at a few cases from +the Samba mailing list. +

pam_winbind problem

+ “ + I have the following PAM configuration: + ” +

+

+auth required /lib/security/pam_securetty.so
+auth sufficient /lib/security/pam_winbind.so
+auth sufficient /lib/security/pam_unix.so use_first_pass nullok
+auth required /lib/security/pam_stack.so service=system-auth
+auth required /lib/security/pam_nologin.so
+account required /lib/security/pam_stack.so service=system-auth
+account required /lib/security/pam_winbind.so
+password required /lib/security/pam_stack.so service=system-auth
+

+

+ “ + When I open a new console with [ctrl][alt][F1], then I cant log in with my user "pitie". + I've tried with user "scienceu+pitie" also. +” +

+ The problem may lie with your inclusion of pam_stack.so + service=system-auth. That file often contains a lot of stuff that may + duplicate what you're already doing. Try commenting out the pam_stack lines + for auth and account and see if things work. If they do, look at + /etc/pam.d/system-auth and copy only what you need from it into your + /etc/pam.d/login file. Alternatively, if you want all services to use + winbind, you can put the winbind-specific stuff in /etc/pam.d/system-auth. +

Winbind is not resolving users and groups

+ “ + My smb.conf file is correctly configured. I have specified + idmap uid = 12000, + and idmap gid = 3000-3500 + and winbind is running. When I do the following it all works fine. +” +

+root# wbinfo -u
+MIDEARTH+maryo
+MIDEARTH+jackb
+MIDEARTH+ameds
+...
+MIDEARTH+root
+
+root# wbinfo -g
+MIDEARTH+Domain Users
+MIDEARTH+Domain Admins
+MIDEARTH+Domain Guests
+...
+MIDEARTH+Accounts
+
+root# getent passwd
+root:x:0:0:root:/root:/bin/bash
+bin:x:1:1:bin:/bin:/bin/bash
+...
+maryo:x:15000:15003:Mary Orville:/home/MIDEARTH/maryo:/bin/false
+

+ “ + But the following command just fails: +” +

+root# chown 'maryo' a_file
+chown: `maryo': invalid user
+

+“ +This is driving me nuts! What can be wrong? +” +

+ Your system is likely running nscd, the name service + caching daemon. Shut it down, do NOT restart it! You will find your problem resolved. +

diff --git a/docs/htmldocs/passdb.html b/docs/htmldocs/passdb.html new file mode 100644 index 0000000000..4d5432fd70 --- /dev/null +++ b/docs/htmldocs/passdb.html @@ -0,0 +1,785 @@ +Chapter 11. Account Information Databases

Chapter 11. Account Information Databases

Jelmer R. Vernooij

The Samba Team

Gerald (Jerry) Carter

Samba Team

Jeremy Allison

Samba Team

John H. Terpstra

Samba Team

Olivier (lem) Lemaire

May 24, 2003

+Samba 3 implements a new capability to work concurrently with multiple account backends. +The possible new combinations of password backends allows Samba 3 a degree of flexibility +and scalability that previously could be achieved only with MS Windows Active Directory. +This chapter describes the new functionality and how to get the most out of it. +

+In the course of development of Samba-3, a number of requests were received to provide the +ability to migrate MS Windows NT4 SAM accounts to Samba-3 without the need to provide +matching UNIX/Linux accounts. We called this the Non UNIX Accounts (NUA) +capability. The intent was that an administrator could decide to use the tdbsam +backend and by simply specifying passdb backend = tdbsam_nua +this would allow Samba-3 to implement a solution that did not use UNIX accounts per se. Late +in the development cycle, the team doing this work hit upon some obstacles that prevents this +solution from being used. Given the delays with Samba-3 release a decision was made to NOT +deliver this functionality until a better method of recognising NT Group SIDs from NT User +SIDs could be found. This feature may thus return during the life cycle for the Samba-3 series. +

Note

+Samba-3 does NOT support Non-UNIX Account (NUA) operation for user accounts. +Samba-3 does support NUA operation for machine accounts. +

Features and Benefits

+Samba-3 provides for complete backwards compatibility with Samba-2.2.x functionality +as follows: +

Backwards Compatibility Backends

Plain Text:

+ This option uses nothing but the UNIX/Linux /etc/passwd + style back end. On systems that have PAM (Pluggable Authentication Modules) + support all PAM modules are supported. The behaviour is just as it was with + Samba-2.2.x, and the protocol limitations imposed by MS Windows clients + apply likewise. +

smbpasswd:

+ This option allows continues use of the smbpasswd + file that maintains a plain ASCII (text) layout that includes the MS Windows + LanMan and NT encrypted passwords as well as a field that stores some + account information. This form of password backend does NOT store any of + the MS Windows NT/200x SAM (Security Account Manager) information needed to + provide the extended controls that are needed for more comprehensive + interoperation with MS Windows NT4 / 200x servers. +

+ This backend should be used only for backwards compatibility with older + versions of Samba. It may be deprecated in future releases. +

ldapsam_compat (Samba-2.2 LDAP Compatibility):

+ There is a password backend option that allows continued operation with + a existing OpenLDAP backend that uses the Samba-2.2.x LDAP schema extension. + This option is provided primarily as a migration tool, although there is + no reason to force migration at this time. Note that this tool will eventually + be deprecated. +

New Backends

+Samba-3 introduces the following new password backend capabilities: +

tdbsam:

+ This backend provides a rich database backend for local servers. This + backend is NOT suitable for multiple domain controller (ie: PDC + one + or more BDC) installations. +

+ The tdbsam password backend stores the old + smbpasswd information PLUS the extended MS Windows NT / 200x + SAM information into a binary format TDB (trivial database) file. + The inclusion of the extended information makes it possible for Samba-3 + to implement the same account and system access controls that are possible + with MS Windows NT4 and MS Windows 200x based systems. +

+ The inclusion of the tdbsam capability is a direct + response to user requests to allow simple site operation without the overhead + of the complexities of running OpenLDAP. It is recommended to use this only + for sites that have fewer than 250 users. For larger sites or implementations + the use of OpenLDAP or of Active Directory integration is strongly recommended. +

ldapsam:

+ This provides a rich directory backend for distributed account installation. +

+ Samba-3 has a new and extended LDAP implementation that requires configuration + of OpenLDAP with a new format samba schema. The new format schema file is + included in the examples/LDAP directory of the Samba distribution. +

+ The new LDAP implementation significantly expands the control abilities that + were possible with prior versions of Samba. It is now possible to specify + "per user" profile settings, home directories, account access controls, and + much more. Corporate sites will see that the Samba-Team has listened to their + requests both for capability and to allow greater scalability. +

mysqlsam (MySQL based backend):

+ It is expected that the MySQL based SAM will be very popular in some corners. + This database backend will be on considerable interest to sites that want to + leverage existing MySQL technology. +

xmlsam (XML based datafile):

+ Allows the account and password data to be stored in an XML format + data file. This backend can not be used for normal operation, it can only + be used in conjunction with pdbedit's pdb2pdb + functionality. The DTD that is used might be subject to changes in the future. +

+ The xmlsam option can be useful for account migration between database + backends or backups. Use of this tool will allow the data to be edited before migration + into another backend format. +

Technical Information

+ 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. +

+ Newer windows clients send encrypted passwords (so-called Lanman and NT hashes) over + the wire, instead of plain text passwords. The newest clients will send only encrypted + passwords and refuse to send plain text passwords, unless their registry is tweaked. +

+ 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. +

+ In addition to 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 the users' profile is stored, and so on. 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 man page for smb.conf regarding the + passdb backend parameter. +

Figure 11.1. IDMAP

IDMAP

Important Notes About Security

+ 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. +

+ Ideally we would like a password scheme that involves neither plain text passwords + on the net nor on disk. Unfortunately this is not available as Samba is stuck with + having to be compatible with other SMB systems (WinNT, WfWg, Win95 etc). +

+ Windows NT 4.0 Service pack 3 changed the default setting so that plaintext passwords + are disabled from being sent over the wire. This mandates either the use of encrypted + password support or edit the Windows NT registry to re-enable plaintext passwords. +

+ The following versions of MS Windows do not support full domain security protocols, + although they may log onto a domain environment: +

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

  • Windows 95 with the network redirector update installed

  • Windows 98 [se]

  • Windows Me

Note

+ MS Windows XP Home does not have facilities to become a domain member and it can + not participate in domain logons. +

+ The following versions of MS Windows fully support domain security protocols. +

  • Windows NT 3.5x

  • Windows NT 4.0

  • Windows 2000 Professional

  • Windows 200x Server/Advanced Server

  • Windows XP Professional

+ 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. + Instead, it allows the client to negotiate either plain text _or_ encrypted password + handling. +

+ MS Windows clients will cache the encrypted password alone. Where plain text passwords + are re-enabled, through the appropriate registry change, the plain text password is NEVER + cached. This means that in the event that a network connections should become disconnected + (broken) only the cached (encrypted) password will be sent to the resource server to + affect a auto-reconnect. If the resource server does not support encrypted passwords the + auto-reconnect will fail. USE OF ENCRYPTED PASSWORDS IS STRONGLY ADVISED. +

Advantages of Encrypted Passwords

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

  • Plain text passwords are not stored anywhere in + memory or on disk.

  • WinNT doesn't like talking to a server + that does not support 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. +

  • Encrypted password support allows automatic share + (resource) reconnects.

  • Encrypted passwords are essential for PDC/BDC + operation.

Advantages of non-encrypted passwords

  • Plain text passwords are not kept + on disk, and are NOT cached in memory.

  • Uses same password file as other unix + services such as login and ftp

  • Use of 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.

Mapping User Identifiers between MS Windows and UNIX

+ Every operation in UNIX/Linux requires a user identifier (UID), just as in + MS Windows NT4 / 200x this requires a Security Identifier (SID). Samba provides + two means for mapping an MS Windows user to a UNIX/Linux UID. +

+ Firstly, all Samba SAM (Security Account Manager database) accounts require + a UNIX/Linux UID that the account will map to. As users are added to the account + information database, Samba will call the add user script + interface to add the account to the Samba host OS. In essence all accounts in + the local SAM require a local user account. +

+ The second way to affect Windows SID to UNIX UID mapping is via the + idmap uid, idmap gid parameters in smb.conf. + Please refer to the man page for information about these parameters. + These parameters are essential when mapping users from a remote SAM server. +

Mapping Common UIDs/GIDs on Distributed Machines

+ Samba-3 has a special facility that makes it possible to maintain identical UIDs and GIDs + on all servers in a distributed network. A distributed network is one where there exists + a PDC, one or more BDCs and/or one or more domain member servers. Why is this important? + This is important if files are being shared over more than one protocol (eg: NFS) and where + users are copying files across UNIX/Linux systems using tools such as rsync. +

+ The special facility is enabled using a parameter called idmap backend. + The default setting for this parameter is an empty string. Administrators should NOT set this + parameter except when an LDAP based passdb backend is in use. An example of use is: +

+

Example 11.1. 

[global]
idmap backend = ldapsam://ldap-server.quenya.org:636

+

Account Management Tools

+Samba provides two (2) tools for management of User and machine accounts. These tools are +called smbpasswd and pdbedit. A third tool is under +development but is NOT expected to ship in time for Samba-3.0.0. The new tool will be a TCL/TK +GUI tool that looks much like the MS Windows NT4 Domain User Manager - hopefully this will +be announced in time for the Samba-3.0.1 release. +

The smbpasswd Command

+ 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. +

+ 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: +

+ 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 changing an NT Domain user's password). +

+ smbpasswd can be used to: +

  • add user or machine accounts

  • delete user or machine accounts

  • enable user or machine accounts

  • disable user or machine accounts

  • set to NULL user passwords

  • manage interdomain trust accounts

+ To run smbpasswd as a normal user just type: +

+

+$ smbpasswd
+Old SMB password: secret
+

+ For secret type old value here - or hit return if + there was no old password +

+New SMB Password: new secret
+Repeat New SMB Password: new secret
+

+

+ 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. +

+ When invoked by an ordinary user it will only allow change of their own + SMB password. +

+ When run by root smbpasswd may take an optional argument, specifying + the user name whose SMB password you wish to change. 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. +

+ smbpasswd is designed to work in the way familiar to UNIX + users who use the passwd or yppasswd commands. + While designed for administrative use, this tool provides essential user level + password change capabilities. +

+ For more details on using smbpasswd refer to the man page (the + definitive reference). +

The pdbedit Command

+ pdbedit is a tool that can be used only by root. It is used to + manage the passdb backend. pdbedit can be used to: +

  • add, remove or modify user accounts

  • listing user accounts

  • migrate user accounts

+ The pdbedit tool is the only one that can manage the account + security and policy settings. It is capable of all operations that smbpasswd can + do as well as a super set of them. +

+ One particularly important purpose of the pdbedit is to allow + the migration of account information from one passdb backend to another. See the + XML password backend section of this chapter. +

+ The following is an example of the user account information that is stored in + a tdbsam password backend. This listing was produced by running: +

+$ pdbedit -Lv met
+UNIX username:        met
+NT username:
+Account Flags:        [UX         ]
+User SID:             S-1-5-21-1449123459-1407424037-3116680435-2004
+Primary Group SID:    S-1-5-21-1449123459-1407424037-3116680435-1201
+Full Name:            Melissa E Terpstra
+Home Directory:       \\frodo\met\Win9Profile
+HomeDir Drive:        H:
+Logon Script:         scripts\logon.bat
+Profile Path:         \\frodo\Profiles\met
+Domain:               MIDEARTH
+Account desc:
+Workstations:         melbelle
+Munged dial:
+Logon time:           0
+Logoff time:          Mon, 18 Jan 2038 20:14:07 GMT
+Kickoff time:         Mon, 18 Jan 2038 20:14:07 GMT
+Password last set:    Sat, 14 Dec 2002 14:37:03 GMT
+Password can change:  Sat, 14 Dec 2002 14:37:03 GMT
+Password must change: Mon, 18 Jan 2038 20:14:07 GMT
+

+ The pdbedit tool allows migration of authentication (account) + databases from one backend to another. For example: To migrate accounts from an + old smbpasswd database to a tdbsam + backend: +

  1. + Set the passdb backend = tdbsam, smbpasswd. +

  2. + Execute: +

    +root# pdbedit -i smbpassed -e tdbsam
    +

    +

  3. + Now remove the smbpasswd from the passdb backend + configuration in smb.conf. +

Password Backends

+Samba offers the greatest flexibility in backend account database design of any SMB/CIFS server +technology available today. The flexibility is immediately obvious as one begins to explore this +capability. +

+It is possible to specify not only multiple different password backends, but even multiple +backends of the same type. For example, to use two different tdbsam databases: +

+

passdb backend = tdbsam:/etc/samba/passdb.tdb, tdbsam:/etc/samba/old-passdb.tdb

+

Plain Text

+ 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 + SMB specific data is stored at all. Instead all operations are conducted via the way + that the Samba host OS will access its /etc/passwd database. + eg: On Linux systems that is done via PAM. +

smbpasswd - Encrypted Password Database

+ 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 large sites. What is needed is an indexed approach + such as is used in databases. +

  • + The second problem is that administrators who desire 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. +

  • + 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 Identifier (RID). +

+ As a result of these deficiencies, 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 Samba CVS trees). +

+ Samba provides an enhanced set of passdb backends that overcome the deficiencies + of the smbpasswd plain text database. These are tdbsam, ldapsam, and xmlsam. + Of these ldapsam will be of most interest to large corporate or enterprise sites. +

tdbsam

Samba can store user and machine account data in a "TDB" (Trivial Database). + Using this backend doesn't require any additional configuration. This backend is + recommended for new installations that do not require LDAP. +

+ As a general guide the Samba-Team does NOT recommend using the tdbsam backend for sites + that have 250 or more users. Additionally, tdbsam is not capable of scaling for use + in sites that require PDB/BDC implementations that requires replication of the account + database. Clearly, for reason of scalability, the use of ldapsam should be encouraged. +

ldapsam

+ There are a few points to stress that the ldapsam does not provide. The LDAP + support referred to in the this documentation does not include: +

  • A means of retrieving user account information from + an Windows 200x Active Directory server.

  • 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/). More + information about the configuration of these packages may be found at "LDAP, + System Administration; Gerald Carter, O'Reilly; Chapter 6: Replacing NIS". + Refer to + http://safari.oreilly.com/?XmlId=1-56592-491-6 for those who might wish to know + more about configuration and administration of an OpenLDAP server. +

Note

+ This section is outdated for Samba-3 schema. Samba-3 introduces a new schema + that has not been documented at the time of this publication. +

+ 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. +

+ 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. +

Supported LDAP Servers

+ The LDAP ldapsam code has been developed and tested using the OpenLDAP 2.0 and 2.1 server and + client libraries. The same code should work with Netscape's Directory Server and client SDK. + However, there are bound to be compile errors and bugs. These should not be hard to fix. + Please submit fixes via Bug reporting facility. +

Schema and Relationship to the RFC 2307 posixAccount

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

+

+objectclass ( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' SUP top AUXILIARY
+    DESC 'Samba 3.0 Auxiliary SAM Account'
+    MUST ( uid $ sambaSID )
+    MAY  ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $
+          sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $
+          sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $
+          displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $
+          sambaProfilePath $ description $ sambaUserWorkstations $
+          sambaPrimaryGroupSID $ sambaDomainName ))
+

+

+ The samba.schema file has been formatted for OpenLDAP 2.0/2.1. + 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. +

+ Just as the smbpasswd file is meant to store information which supplements a + user's /etc/passwd entry, so is the sambaSamAccount object + meant to supplement the UNIX user account information. A sambaSamAccount 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. +

+ In order to store all user account information (UNIX and Samba) in the directory, + it is necessary to use the sambaSamAccount 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. +

OpenLDAP configuration

+ To include support for the sambaSamAccount object in an OpenLDAP directory + server, first copy the samba.schema file to slapd's configuration directory. + The samba.schema file can be found in the directory examples/LDAP + in the samba source distribution. +

+

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

+

+ Next, include the samba.schema file in slapd.conf. + The sambaSamAccount 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. +

+

+## /etc/openldap/slapd.conf
+
+## schema files (core.schema is required by default)
+include	           /etc/openldap/schema/core.schema
+
+## needed for sambaSamAccount
+include            /etc/openldap/schema/cosine.schema
+include            /etc/openldap/schema/inetorgperson.schema
+include            /etc/openldap/schema/samba.schema
+include            /etc/openldap/schema/nis.schema
+....
+

+

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

+

+# Indices to maintain
+## required by OpenLDAP
+index objectclass             eq
+
+index cn                      pres,sub,eq
+index sn                      pres,sub,eq
+## required to support pdb_getsampwnam
+index uid                     pres,sub,eq
+## required to support pdb_getsambapwrid()
+index displayName             pres,sub,eq
+
+## uncomment these if you are storing posixAccount and
+## posixGroup entries in the directory as well
+##index uidNumber               eq
+##index gidNumber               eq
+##index memberUid               eq
+
+index   sambaSID              eq
+index   sambaPrimaryGroupSID  eq
+index   sambaDomainName       eq
+index   default               sub
+

+

+ Create the new index by executing: +

+

+root# ./sbin/slapindex -f slapd.conf
+

+

+ Remember to restart slapd after making these changes: +

+

+root# /etc/init.d/slapd restart
+

+

Initialise the LDAP database

+ Before you can add accounts to the LDAP database you must create the account containers + that they will be stored in. The following LDIF file should be modified to match your + needs (ie: Your DNS entries, etc.). +

+

+# Organization for Samba Base
+dn: dc=quenya,dc=org
+objectclass: dcObject
+objectclass: organization
+dc: quenya
+o: Quenya Org Network
+description: The Samba-3 Network LDAP Example
+
+# Organizational Role for Directory Management
+dn: cn=Manager,dc=quenya,dc=org
+objectclass: organizationalRole
+cn: Manager
+description: Directory Manager
+
+# Setting up container for users
+dn: ou=People,dc=quenya,dc=org
+objectclass: top
+objectclass: organizationalUnit
+ou: People
+
+# Setting up admin handle for People OU
+dn: cn=admin,ou=People,dc=quenya,dc=org
+cn: admin
+objectclass: top
+objectclass: organizationalRole
+objectclass: simpleSecurityObject
+userPassword: {SSHA}c3ZM9tBaBo9autm1dL3waDS21+JSfQVz
+

+

+ The userPassword shown above should be generated using slappasswd. +

+ The following command will then load the contents of the LDIF file into the LDAP + database. +

+

+$ slapadd -v -l initldap.dif
+

+

+ Do not forget to secure your LDAP server with an adequate access control list, + as well as an admin password. +

Note

+ Before Samba can access the LDAP server you need to store the LDAP admin password + into the Samba-3 secrets.tdb database by: +

+root# smbpasswd -w secret
+

+

Configuring Samba

+ The following parameters are available in smb.conf only if your + version of samba was built with LDAP support. Samba automatically builds with LDAP support if the + LDAP libraries are found. +

LDAP related smb.conf options: + passdb backend = ldapsam:url, + ldap ssl, + ldap admin dn, + ldap suffix, + ldap filter, + ldap machine suffix, + ldap user suffix, + ldap delete dn, + ldap passwd sync, + ldap trust ids. +

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

+

Example 11.2. Configuration with LDAP

[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
# change, this password will need to be reset.
ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org"
# Define the SSL option when connecting to the directory
# ('off', 'start tls', or 'on' (default))
ldap ssl = start tls
# syntax: passdb backend = ldapsam:ldap://server-name[:port]
passdb backend = ldapsam:ldap://funball.samba.org
# smbpasswd -x delete the entire dn-entry
ldap delete dn = no
# the machine and user suffix added to the base suffix
# wrote WITHOUT quotes. NULL suffixes by default
ldap user suffix = ou=People
ldap machine suffix = ou=Systems
# Trust unix account information in LDAP
# (see the smb.conf manpage for details)
ldap trust ids = Yes
# 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=sambaSamAccount))"

+

Accounts and Groups management

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

+ Machines accounts are managed with the sambaSamAccount objectclass, just + like users accounts. However, it's up to you to store those accounts + in a different tree of your LDAP namespace: you should use + "ou=Groups,dc=quenya,dc=org" to store groups and + "ou=People,dc=quenya,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 makes use of the posixGroup objectclass. + For now, there is no NT-like group system management (global and local + groups). +

Security and sambaSamAccount

+ There are two important points to remember when discussing the security + of sambaSamAccount 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 + Account Information Database section of this chapter. +

+ 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 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=quenya,dc=org" write
+     by * none
+

+

LDAP special attributes for sambaSamAccounts

+ The sambaSamAccount objectclass is composed of the following attributes: +

+

Table 11.1. Attributes in the sambaSamAccount objectclass (LDAP)

sambaLMPasswordthe LANMAN password 16-byte hash stored as a character +representation of a hexadecimal string.
sambaNTPasswordthe NT password hash 16-byte stored as a character + representation of a hexadecimal string.
sambaPwdLastSetThe integer time in seconds since 1970 when the + sambaLMPassword and sambaNTPassword attributes were last set. +
sambaAcctFlagsstring of 11 characters surrounded by square brackets [] + representing account flags such as U (user), W(workstation), X(no password expiration), + I(Domain trust account), H(Home dir required), S(Server trust account), + and D(disabled).
sambaLogonTimeInteger value currently unused
sambaLogoffTimeInteger value currently unused
sambaKickoffTimeInteger value currently unused
sambaPwdCanChangeInteger value currently unused
sambaPwdMustChangeInteger value currently unused
sambaHomeDrivespecifies the drive letter to which to map the + UNC path specified by sambaHomePath. 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.
sambaLogonScriptThe sambaLogonScript 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 man page for more information.
sambaProfilePathspecifies 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 man page for more information.
sambaHomePathThe sambaHomePath property specifies the path of +the home directory for the user. The string can be null. If sambaHomeDrive is set and specifies +a drive letter, sambaHomePath 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 man page for more information. +
sambaUserWorkstationscharacter string value currently unused. +
sambaSIDThe security identifier(SID) of the user. The windows equivalent of unix uid's.
sambaPrimaryGroupSIDthe relative identifier (RID) of the primary group + of the user.
sambaDomainNamedomain the user is part of.

+

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

  • sambaHomePath

  • sambaLogonScript

  • sambaProfilePath

  • sambaHomeDrive

+ These attributes are only stored with the sambaSamAccount 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 if the value is + something other than the default (e.g. \\MOBY\becky). +

Example LDIF Entries for a sambaSamAccount

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

+

+	dn: uid=guest2, ou=people,dc=quenya,dc=org
+	sambaNTPassword: 878D8014606CDA29677A44EFA1353FC7
+	sambaPwdMustChange: 2147483647
+	sambaPrimaryGroupSID: S-1-5-21-2447931902-1787058256-3961074038-513
+	sambaNTPassword: 552902031BEDE9EFAAD3B435B51404EE
+	sambaPwdLastSet: 1010179124
+	sambaLogonTime: 0
+	objectClass: sambaSamAccount
+	uid: guest2
+	sambaKickoffTime: 2147483647
+	sambaAcctFlags: [UX         ]
+	sambaLogoffTime: 2147483647
+	sambaSID: S-1-5-21-2447931902-1787058256-3961074038-5006
+	sambaPwdCanChange: 0
+	

+

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

+

+	dn: uid=gcarter, ou=people,dc=quenya,dc=org
+	sambaLogonTime: 0
+	displayName: Gerald Carter
+	sambaLMPassword: 552902031BEDE9EFAAD3B435B51404EE
+	sambaPrimaryGroupSID: S-1-5-21-2447931902-1787058256-3961074038-1201
+	objectClass: posixAccount
+	objectClass: sambaSamAccount
+	sambaAcctFlags: [UX         ]
+	userPassword: {crypt}BpM2ej8Rkzogo
+	uid: gcarter
+	uidNumber: 9000
+	cn: Gerald Carter
+	loginShell: /bin/bash
+	logoffTime: 2147483647
+	gidNumber: 100
+	sambaKickoffTime: 2147483647
+	sambaPwdLastSet: 1010179230
+	sambaSID: S-1-5-21-2447931902-1787058256-3961074038-5004
+	homeDirectory: /home/tashtego/gcarter
+	sambaPwdCanChange: 0
+	sambaPwdMustChange: 2147483647
+	sambaNTPassword: 878D8014606CDA29677A44EFA1353FC7
+

+

Password synchronisation

+ Since version 3.0 samba can update the non-samba (LDAP) password stored with an account. When + using pam_ldap, this allows changing both unix and windows passwords at once. +

The ldap passwd sync options can have the following values:

yes

When the user changes his password, update + ntPassword, lmPassword + and the password fields.

no

Only update ntPassword and lmPassword.

only

Only update the LDAP password and let the LDAP server worry about the other fields. This option is only available on some LDAP servers. [3]

More information can be found in the smb.conf manpage. +

MySQL

+ Every so often someone will come along with a great new idea. Storing of user accounts in an + SQL backend is one of them. Those who want to do this are in the best position to know what the + specific benefits are to them. This may sound like a cop-out, but in truth we can not attempt + to document every nitty little detail why certain things of marginal utility to the bulk of + Samba users might make sense to the rest. In any case, the following instructions should help + the determined SQL user to implement a working system. +

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 : + +

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

+

Configuring

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

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

passdb backend = [other-plugins] mysql: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 through the smb.conf file in the [global] section. +

+

Table 11.2. Basic smb.conf options for MySQL passdb backend

FieldContents
mysql hosthost name, defaults to 'localhost'
mysql password 
mysql userdefaults to 'samba'
mysql databasedefaults to 'samba'
mysql portdefaults to 3306
tableName of the table containing users

+

Warning

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

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

+

Table 11.3. MySQL field names for MySQL passdb backend

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

+

+ 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. +

Using plaintext passwords or encrypted password

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

+ 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. +

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

Getting non-column data from the table

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

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

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

See the MySQL documentation for more language constructs.

XML

This module requires libxml2 to be installed.

The usage of pdb_xml is pretty straightforward. To export data, use: +

+ $ pdbedit -e xml:filename +

+ (where filename is the name of the file to put the data in) +

+ To import data, use: + $ pdbedit -i xml:filename +

Common Errors

Users can not logon

I've installed samba, but now I can't log on with my unix account!

Make sure your user has been added to the current samba passdb backend. Read the section Account Management Tools for details.

Users being added to wrong backend database

+ A few complaints have been received from users that just moved to Samba-3. The following + smb.conf file entries were causing problems, new accounts were being added to the old + smbpasswd file, not to the tdbsam passdb.tdb file: +

+

[global]
...
passdb backend = smbpasswd, tdbsam
...

+

+ Samba will add new accounts to the first entry in the passdb backend + parameter entry. If you want to update to the tdbsam, then change the entry to: +

+

[globals]
...
passdb backend = tdbsam, smbpasswd
...

+

auth methods does not work

+ If you explicitly set an auth methods parameter, guest must be specified as the first + entry on the line. Eg: auth methods = guest sam. +

+ This is the exact opposite of the requirement for the passdb backend + option, where it must be the LAST parameter on the line. +



[3] Only when the LDAP server supports LDAP_EXOP_X_MODIFY_PASSWD

diff --git a/docs/htmldocs/pdbedit.8.html b/docs/htmldocs/pdbedit.8.html index 57b69487c9..f38aeccc18 100644 --- a/docs/htmldocs/pdbedit.8.html +++ b/docs/htmldocs/pdbedit.8.html @@ -123,7 +123,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

-l|--logfile=logbasename

File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. diff --git a/docs/htmldocs/printing.html b/docs/htmldocs/printing.html new file mode 100644 index 0000000000..2b0abb56e6 --- /dev/null +++ b/docs/htmldocs/printing.html @@ -0,0 +1,2156 @@ +Chapter 18. Classical Printing Support

Chapter 18. Classical Printing Support

Kurt Pfeifle

Danka Deutschland GmbH

Gerald (Jerry) Carter

Samba Team

May 31, 2003

Table of Contents

Features and Benefits
Technical Introduction
What happens if you send a Job from a Client
Printing Related Configuration Parameters
Parameters Recommended for Use
A simple Configuration to Print
Verification of "Settings in Use" with testparm
A little Experiment to warn you
Extended Sample Configuration to Print
Detailed Explanation of the Example's Settings
The [global] Section
The [printers] Section
Any [my_printer_name] Section
Print Commands
Default Print Commands for various UNIX Print Subsystems
Setting up your own Print Commands
Innovations in Samba Printing since 2.2
Client Drivers on Samba Server for Point'n'Print
The [printer$] Section is removed from Samba 3
Creating the [print$] Share
Parameters in the [print$] Section
Subdirectory Structure in [print$]
Installing Drivers into [print$]
Setting Drivers for existing Printers with a Client GUI
Setting Drivers for existing Printers with +rpcclient
Client Driver Install Procedure
The first Client Driver Installation
IMPORTANT! Setting Device Modes on new Printers
Further Client Driver Install Procedures
Always make first Client Connection as root or "printer admin"
Other Gotchas
Setting Default Print Options for the Client Drivers
Supporting large Numbers of Printers
Adding new Printers with the Windows NT APW
Weird Error Message Cannot connect under a +different Name
Be careful when assembling Driver Files
Samba and Printer Ports
Avoiding the most common Misconfigurations of the Client Driver
The Imprints Toolset
What is Imprints?
Creating Printer Driver Packages
The Imprints Server
The Installation Client
Add Network Printers at Logon without User Interaction
The addprinter command
Migration of "Classical" printing to Samba
Publishing Printer Information in Active Directory or LDAP
Common Errors
I give my root password but I don't get access
My printjobs get spooled into the spooling directory, but then get lost

Features and Benefits

+Printing is often a mission-critical service for the users. Samba can +provide this service reliably and seamlessly for a client network +consisting of Windows workstations. +

+A Samba print service may be run on a Standalone or a Domain +member server, side by side with file serving functions, or on a +dedicated print server. It can be made as tight or as loosely secured +as needs dictate. Configurations may be simple or complex. Available +authentication schemes are essentially the same as described for file +services in previous chapters. Overall, Samba's printing support is +now able to replace an NT or Windows 2000 print server full-square, +with additional benefits in many cases. Clients may download and +install drivers and printers through their familiar "Point'n'Print" +mechanism. Printer installations executed by "Logon Scripts" are no +problem. Administrators can upload and manage drivers to be used by +clients through the familiar "Add Printer Wizard". As an additional +benefit, driver and printer management may be run from the command line +or through scripts, making it more efficient in case of large numbers +of printers. If a central accounting of print jobs (tracking every +single page and supplying the raw data for all sorts of statistical +reports) is required, this is best supported by CUPS as the print +subsystem underneath the Samba hood. +

+This chapter deals with the foundations of Samba printing, as they +implemented by the more traditional UNIX (BSD- and System V-style) +printing systems. Many things apply to CUPS, the newer Common UNIX +Printing System, too; so if you use CUPS, you might be tempted to jump +to the next chapter -- but you will certainly miss a few things if you +do so. Better to read this chapter too. +

Note

+Most of the given examples have been verified on Windows XP +Professional clients. Where this document describes the responses to +commands given, bear in mind that Windows 2000 clients are very +similar, but may differ in details. Windows NT is somewhat different +again. +

Technical Introduction

+Samba's printing support always relies on the installed print +subsystem of the UNIX OS it runs on. Samba is a "middleman". It takes +printfiles from Windows (or other SMB) clients and passes them to the +real printing system for further processing. Therefore it needs to +"talk" to two sides: to the Windows print clients and to the UNIX +printing system. Hence we must differentiate between the various +client OS types each of which behave differently, as well as the +various UNIX print subsystems, which themselves have different +features and are accessed differently. This part of the Samba HOWTO +Collection deals with the "traditional" way of UNIX printing first; +the next chapter covers in great detail the more modern +Common UNIX Printing System +(CUPS). + +

Important

CUPS users, be warned: don't just jump on to the next +chapter. You might miss important information contained only +here!

+

What happens if you send a Job from a Client

+To successfully print a job from a Windows client via a Samba +print server to a UNIX printer, there are 6 (potentially 7) +stages: +

  1. Windows opens a connection to the printer share

  2. Samba must authenticate the user

  3. Windows sends a copy of the printfile over the network +into Samba's spooling area

  4. Windows closes the connection again

  5. Samba invokes the print command to hand the file over +to the UNIX print subsystem's spooling area

  6. The UNIX print subsystem processes the print +job

  7. The printfile may need to be explicitly deleted +from the Samba spooling area.

Printing Related Configuration Parameters

+There are a number of configuration parameters in + controlling Samba's printing +behaviour. Please also refer to the man page for smb.conf to +acquire an overview about these. As with other parameters, there are +Global Level (tagged with a "G" in the listings) and +Service Level ("S") parameters. +

Service Level Parameters

These may go into the +[global] section of smb.conf. +In this case they define the default +behaviour of all individual or service level shares (provided those +don't have a different setting defined for the same parameter, thus +overriding the global default).

Global Parameters

These may not go into individual +shares. If they go in by error, the "testparm" utility can discover +this (if you run it) and tell you so.

Parameters Recommended for Use

The following smb.conf parameters directly +related to printing are used in Samba. See also the +smb.conf man page for detailed explanations: +

Global level parameters: addprinter command, +deleteprinter command, +disable spoolss, +enumports command, +load printers, +lpq cache time, +os2 driver map, +printcap name, printcap, +show add printer wizard, +total print jobs, +use client driver. +

Service level parameters: hosts allow, +hosts deny, +lppause command, +lpq command, +lpresume command, +lprm command, +max print jobs, +min print space, +print command, +printable, print ok , +printer name, printer, +printer admin, +printing = [cups|bsd|lprng...], +queuepause command, +queueresume command, +total print jobs. +

+Samba's printing support implements the Microsoft Remote Procedure +Calls (MS-RPC) methods for printing. These are used by Windows NT (and +later) print servers. The old "LanMan" protocol is still supported as +a fallback resort, and for older clients to use. More details will +follow further beneath. +

A simple Configuration to Print

+Here is a very simple example configuration for print related settings +in the file. If you compare it with your own system's , you probably find some +additional parameters included there (as pre-configured by your OS +vendor). Further below is a discussion and explanation of the +parameters. Note, that this example doesn't use many parameters. +However, in many environments these are enough to provide a valid +smb.conf file which enables all clients to print. +

Example 18.1. Simple configuration with BSD printing

[global]
printing = bsd
load printers = yes
[printers]
path = /var/spool/samba
printable = yes
public = yes
writable = no

+This is only an example configuration. Samba assigns default values to all +configuration parameters. On the whole the defaults are conservative and +sensible. When a parameter is specified in the smb.conf file this overwrites +the default value. The testparm utility when run as root +is capable of reporting all setting, both default as well as smb.conf file +settings. Testparm gives warnings for all mis-configured +settings. The complete output is easily 340 lines and more, so you may want +to pipe it through a pager program. +

+The syntax for the configuration file is easy to grasp. You should +know that is not very picky about its +syntax. It has been explained elsewhere in this document. A short +reminder: It even tolerates some spelling errors (like "browsable" +instead of "browseable"). Most spelling is case-insensitive. Also, you +can use "Yes|No" or "True|False" for boolean settings. Lists of names +may be separated by commas, spaces or tabs. +

Verification of "Settings in Use" with testparm

+To see all (or at least most) printing related settings in Samba, +including the implicitly used ones, try the command outlined below +(hit "ENTER" twice!). It greps for all occurrences of "lp", "print", +"spool", "driver", "ports" and "[" in testparm's output and gives you +a nice overview about the running smbd's print configuration. (Note +that this command does not show individually created printer shares, +or the spooling paths in each case). Here is the output of my Samba +setup, with exactly the same settings in +as shown above: +

+root# testparm -v | egrep "(lp|print|spool|driver|ports|\[)"
+ Load smb config files from /etc/samba/smb.conf.simpleprinting
+ Processing section "[homes]"
+ Processing section "[printers]"
+ 
+ [global]
+        smb ports = 445 139
+        lpq cache time = 10
+        total print jobs = 0
+        load printers = Yes
+        printcap name = /etc/printcap
+        disable spoolss = No
+        enumports command =
+        addprinter command = 
+        deleteprinter command = 
+        show add printer wizard = Yes
+        os2 driver map =
+        printer admin =
+        min print space = 0
+        max print jobs = 1000
+        printable = No
+        printing = bsd
+        print command = lpr -r -P'%p' %s
+        lpq command = lpq -P'%p'
+        lprm command = lprm -P'%p' %j
+        lppause command =
+        lpresume command =
+        printer name =
+        use client driver = No
+
+ [homes]
+
+ [printers]
+        path = /var/spool/samba
+        printable = Yes
+
+

+You can easily verify which settings were implicitly added by Samba's +default behaviour. Don't forget about this point: it may +be important in your future dealings with Samba. +

Note

testparm in samba 3 behaves differently from 2.2.x: used +without the "-v" switch it only shows you the settings actually +written into ! To see the complete +configuration used, add the "-v" parameter to testparm.

A little Experiment to warn you

+Should you need to troubleshoot at any stage, please always come back +to this point first and verify if "testparm" shows the parameters you +expect! To give you an example from personal experience as a warning, +try to just "comment out" the load printers" +parameter. If your 2.2.x system behaves like mine, you'll see this: +

+root# grep "load printers" /etc/samba/smb.conf
+ #      load printers = Yes
+ # This setting is commented ooouuuuut!!
+ 
+root# testparm -v /etc/samba/smb.conf | egrep "(load printers)"
+        load printers = Yes
+
+

+Despite my imagination that the commenting out of this setting should +prevent Samba from publishing my printers, it still did! Oh Boy -- it +cost me quite some time to find out the reason. But I am not fooled +any more... at least not by this ;-) +

+root# grep -A1 "load printers" /etc/samba/smb.conf
+        load printers = No
+        # This setting is what I mean!!
+ #      load printers = Yes
+        # This setting is commented ooouuuuut!!
+
+root# testparm -v smb.conf.simpleprinting | egrep "(load printers)"
+        load printers = No
+
+

+Only when setting the parameter explicitly to +"load printers = No" +would Samba recognize my intentions. So my strong advice is: +

  • Never rely on "commented out" parameters!

  • Always set it up explicitly as you intend it to +behave.

  • Use testparm to uncover hidden +settings which might not reflect your intentions.

+You can have a working Samba print configuration with this +minimal : +

+root# cat /etc/samba/smb.conf-minimal
+        [printers]
+
+

+This example should show you that you can use testparm to test any +filename for fitness as a Samba configuration. Actually, we want to +encourage you not to change your + on a working system (unless you know +exactly what you are doing)! Don't rely on an assumption that changes +will only take effect after you re-start smbd! This is not the +case. Samba re-reads its every 60 +seconds and on each new client connection. You might have to face +changes for your production clients that you didn't intend to apply at +this time! You will now note a few more interesting things. Let's now +ask testparm what the Samba print configuration +would be, if you used this minimalistic file as your real +: +

+root# testparm -v smb.conf-minimal | egrep "(print|lpq|spool|driver|ports|[)"
+ Processing section "[printers]"
+ WARNING: [printers] service MUST be printable!
+ No path in service printers - using /tmp
+
+        lpq cache time = 10
+        total print jobs = 0
+        load printers = Yes
+        printcap name = /etc/printcap
+        disable spoolss = No
+        enumports command =
+        addprinter command =
+        deleteprinter command =
+        show add printer wizard = Yes
+        os2 driver map =
+        printer admin =
+        min print space = 0
+        max print jobs = 1000
+        printable = No
+        printing = bsd
+        print command = lpr -r -P%p %s
+        lpq command = lpq -P%p
+        printer name =
+        use client driver = No
+ [printers]
+        printable = Yes
+
+

+testparm issued 2 warnings: +

  • because we didn't specify the +[printers] section as printable, +and

  • because we didn't tell it which spool directory to +use.

+However, this was not fatal, and samba will default to values that +will work here. Please, don't rely on this and don't use this +example! This was only meant to make you careful to design and specify +your setup to be what you really want it to be. The outcome on your +system may vary for some parameters, since you may have a Samba built +with a different compile-time configuration. +Warning: don't put a comment sign at +the end of a valid line. It +will cause the parameter to be ignored (just as if you had put the +comment sign at the front). At first I regarded this as a bug in my +Samba version(s). But the man page states: “Internal whitespace +in a parameter value is retained verbatim.” This means that a +line consisting of, for example, +

# This defines LPRng as the printing system"
printing = lprng

+will regard the whole of the string after the "=" +sign as the value you want to define. And this is an invalid value +that will be ignored, and a default value used instead.] +

Extended Sample Configuration to Print

+ In the extended BSD configuration example we show a more verbose example configuration for print related + settings in BSD-printing style environment . Below is a discussion +and explanation of the various parameters. We chose to use BSD-style +printing here, because we guess it is still the most commonly used +system on legacy Linux installations (new installs now predominantly +have CUPS, which is discussed entirely in the next chapter of this +document). Note, that this example explicitly names many parameters +which don't need to be specified because they are set by default. You +might be able to do with a leaner smb.conf file.

Example 18.2. Extended configuration with BSD printing

[global]
printing = bsd
load printers = yes
show add printer wizard = yes
printcap name = /etc/printcap
printer admin = @ntadmin, root
total print jobs = 100
lpq cache time = 20
use client driver = no
[printers]
comment = All Printers
printable = yes
path = /var/spool/samba
browseable = no
guest ok = yes
public = yes
read only = yes
writable = no
[my_printer_name]
comment = Printer with Restricted Access
path = /var/spool/samba_my_printer
printer admin = kurt
browseable = yes
printable = yes
writeable = no
hosts allow = 0.0.0.0
hosts deny = turbo_xp, 10.160.50.23, 10.160.51.60
guest ok = no

+This also is only an example configuration. You +may not find all the settings in your own + (as pre-configured by your OS +vendor). Many configuration parameters, if not explicitly set to a +specific value, are used and set by Samba implicitly to its own +default, because these have been compiled in. To see all settings, let +root use the testparm +utility. testparm also gives warnings if you have +mis-configured certain things.. +

Detailed Explanation of the Example's Settings

+Following is a discussion of the settings from above shown example. +

The [global] Section

+The [global] section is one of 4 special +sections (along with [[homes], +[printers] and +[print$]...) It contains all parameters which +apply to the server as a whole. It is the place for parameters which +have only a "global" meaning. It may also contain service level +parameters which then define default settings for all other +sections and shares. This way you can simplify the configuration and +avoid setting the same value repeatedly. (Within each individual +section or share you may however override these globally set "share +level" settings and specify other values). +

printing = bsd

this causes Samba to use default print commands +applicable for the BSD (a.k.a. RFC 1179 style or LPR/LPD) printing +system. In general, the "printing" parameter informs Samba about the +print subsystem it should expect. Samba supports CUPS, LPD, LPRNG, +SYSV, HPUX, AIX, QNX and PLP. Each of these systems defaults to a +different print command (and other queue control +commands).

Caution

The printing parameter is +normally a service level parameter. Since it is included here in the +[global] section, it will take effect for all +printer shares that are not defined differently. Samba 3 no longer +supports the SOFTQ printing system.

load printers = yes

this tells Samba to create automatically all +available printer shares. "Available" printer shares are discovered by +scanning the printcap file. All created printer shares are also loaded +for browsing. If you use this parameter, you do not need to specify +separate shares for each printer. Each automatically created printer +share will clone the configuration options found in the +[printers] section. (A load printers += no setting will allow you to specify each UNIX printer +you want to share separately, leaving out some you don't want to be +publicly visible and available).

show add printer wizard = yes

this setting is normally +enabled by default (even if the parameter is not written into the +). It makes the Add Printer Wizard icon +show up in the Printers folder of the Samba host's +share listing (as shown in Network Neighbourhood or +by the net view command). To disable it, you need to +explicitly set it to no (commenting it out +will not suffice!). The Add Printer Wizard lets you upload printer +drivers to the [print$] share and associate it +with a printer (if the respective queue exists there before the +action), or exchange a printer's driver against any other previously +uploaded driver.

total print jobs = 100

this setting sets the upper limit to 100 print jobs +being active on the Samba server at any one time. Should a client +submit a job which exceeds this number, a “no more space +available on server” type of error message will be returned by +Samba to the client. A setting of "0" (the default) means there is +no limit at all! +

printcap name = /etc/printcap

this tells Samba where to look for a list of +available printer names. (If you use CUPS, make sure that a printcap +file is written: this is controlled by the "Printcap" directive of +cupsd.conf). +

printer admin = @ntadmin

members of the ntadmin group should be able to add +drivers and set printer properties ("ntadmin" is only an example name, +it needs to be a valid UNIX group name); root is implicitly always a +printer admin. The "@" sign precedes group names in +. A printer admin can do anything to +printers via the remote administration interfaces offered by MS-RPC +(see below). Note that the printer admin +parameter is normally a share level parameter, so you may associate +different groups to different printer shares in larger installations, +if you use the printer admin parameter on the +share levels). +

lpq cache time = 20

this controls the cache time for the results of the +lpq command. It prevents the lpq command being called too often and +reduces load on a heavily used print server. +

use client driver = no

if set to yes, this setting only +takes effect for Win NT/2k/XP clients (and not for Win 95/98/ME). Its +default value is No (or False). +It must not be enabled on print shares +(with a yes or true setting) which +have valid drivers installed on the Samba server! For more detailed +explanations see the man page of smb.conf. +

The [printers] Section

+This is the second special section. If a section with this name +appears in the smb.conf, users are able to +connect to any printer specified in the Samba host's printcap file, +because Samba on startup then creates a printer share for every +printername it finds in the printcap file. You could regard this +section as a general convenience shortcut to share all printers with +minimal configuration. It is also a container for settings which +should apply as default to all printers. (For more details see the +smb.conf man page.) Settings inside this +container must be share level parameters. +

comment = All printers

the comment is shown next to +the share if a client queries the server, either via Network +Neighbourhood or with the net view command to list +available shares. +

printable = yes

please note well, that the +[printers] service must be +declared as printable. If you specify otherwise, smbd will refuse to +load at startup. This parameter allows +connected clients to open, write to and submit spool files into the +directory specified with the path parameter for +this service. It is used by Samba to differentiate printer shares from +file shares.

path = /var/spool/samba

this must point to a directory used by Samba to spool +incoming print files. It must not be the same as the spool +directory specified in the configuration of your UNIX print +subsystem! The path would typically point to a directory +which is world writeable, with the "sticky" bit set to it. +

browseable = no

this is always set to no if +printable = yes. It makes the +[printer] share itself invisible in the +list of available shares in a net view command or +in the Explorer browse list. (Note that you will of course see the +individual printers). +

guest ok = yes

+if set to yes, then no password is required to +connect to the printers service. Access will be granted with the +privileges of the guest account. On many systems the +guest account will map to a user named "nobody". This user is in the UNIX +passwd file with an empty password, but with no valid UNIX login. +(Note: on some systems the guest account might not have the +privilege to be able to print. Test this by logging in as your +guest user using su - guest and run a system print +command like +

lpr -P printername /etc/motd

public = yes

this is a synonym for guest ok = yes. Since we have guest ok = yes, +it really doesn't need to be here! (This leads to the interesting +question: “What, if I by accident have to contradictory settings +for the same share?” The answer is: the last one encountered by +Samba wins. The "winner" is shown by testparm. Testparm doesn't +complain about different settings of the same parameter for the same +share! You can test this by setting up multiple lines for the "guest +account" parameter with different usernames, and then run testparm to +see which one is actually used by Samba.) +

read only = yes

this normally (for other types of shares) prevents +users creating or modifying files in the service's directory. However, +in a "printable" service, it is always allowed to +write to the directory (if user privileges allow the connection), but +only via print spooling operations. "Normal" write operations are not +allowed.

writeable = no

+synonym for read only = yes +

Any [my_printer_name] Section

+If a section appears in the , which is +tagged as printable = yes, Samba presents it as +a printer share to its clients. Note, that Win95/98/ME clients may +have problems with connecting or loading printer drivers if the share +name has more than 8 characters! Also be very careful if you give a +printer the same name as an existing user or file share name: upon a +client's connection request to a certain sharename, Samba always tries +to find file shares with that name first; if it finds one, it will +connect to this and will never ultimately connect to a printer with +the same name! +

comment = Printer with Restricted Access

the comment says it all. +

path = /var/spool/samba_my_printer

here we set the spooling area for this printer to +another directory than the default. It is not a requirement to set it +differently, but the option is available. +

printer admin = kurt

the printer admin definition is different for this +explicitly defined printer share from the general +[printers] share. It is not a requirement; we +did it to show that it is possible if you want it. +

browseable = yes

we also made this printer browseable (so that the +clients may conveniently find it when browsing the Network +Neighbourhood). +

printable = yes

see explanation in last subsection. +

writeable = no

see explanation in last subsection. +

hosts allow = 10.160.50.,10.160.51.

here we exercise a certain degree of access control +by using the hosts allow and hosts deny parameters. Note, that +this is not by any means a safe bet. It is not a way to secure your +printers. This line accepts all clients from a certain subnet in a +first evaluation of access control +

hosts deny = turbo_xp,10.160.50.23,10.160.51.60

all listed hosts are not allowed here (even if they +belong to the "allowed subnets"). As you can see, you could name IP +addresses as well as NetBIOS hostnames +here. +

guest ok = no

this printer is not open for the guest account! +

Print Commands

+In each section defining a printer (or in the +[printers] section), a print +command parameter may be defined. It sets a command to +process the files which have been placed into the Samba print spool +directory for that printer. (That spool directory was, if you +remember, set up with the path +parameter). Typically, this command will submit the spool file to the +Samba host's print subsystem, using the suitable system print +command. But there is no requirement that this needs to be the +case. For debugging purposes or some other reason you may want to do +something completely different than "print" the file. An example is a +command that just copies the print file to a temporary location for +further investigation when you need to debug printing. If you craft +your own print commands (or even develop print command shell scripts), +make sure you pay attention to the need to remove the files from the +Samba spool directory. Otherwise your hard disk may soon suffer from +shortage of free space. +

Default Print Commands for various UNIX Print Subsystems

+You learned earlier on, that Samba in most cases uses its built-in +settings for many parameters if it can not find an explicitly stated +one in its configuration file. The same is true for the +print command. The default print command varies +depending on the printing parameter +setting. In the commands listed below, you will notice some parameters +of the form %X where X is +p, s, J etc. These letters stand for +"printername", "spoolfile" and "job ID" respectively. They are +explained in more detail further below. Here is an overview (excluding +the special case of CUPS, which is discussed in the next chapter): +

If this setting is active......this is used in lieu of an explicit command:
printing = bsd|aix|lprng|plpprint command is lpr -r -P%p %s
printing = sysv|hpuxprint command is lp -c -P%p %s; rm %s
printing = qnxprint command is lp -r -P%p -s %s
printing = bsd|aix|lprng|plplpq command is lpq -P%p
printing = sysv|hpuxlpq command is lpstat -o%p
printing = qnxlpq command is lpq -P%p
printing = bsd|aix|lprng|plplprm command is lprm -P%p %j
printing = sysv|hpuxlprm command is cancel %p-%j
printing = qnxlprm command is cancel %p-%j
printing = bsd|aix|lprng|plplppause command is lp -i %p-%j -H hold
printing = sysv|hpuxlppause command (...is empty)
printing = qnxlppause command (...is empty)
printing = bsd|aix|lprng|plplpresume command is lp -i %p-%j -H resume
printing = sysv|hpuxlpresume command (...is empty)
printing = qnxlpresume command (...is empty)

+We excluded the special CUPS case here, because it is discussed in the +next chapter. Just a short summary. For printing = +CUPS: If SAMBA is compiled against libcups, it uses the +CUPS API to submit jobs, etc. (It is a good idea also to set +printcap = cups in case your +cupsd.conf is set to write its autogenerated +printcap file to an unusual place). Otherwise Samba maps to the System +V printing commands with the -oraw option for printing, i.e. it uses +lp -c -d%p -oraw; rm %s With printing = +cups , and if SAMBA is compiled against libcups, any +manually set print command will be ignored! +

+Having listed the above mappings here, you should note that there used +to be a bug in recent 2.2.x versions which +prevented the mapping from taking effect. It lead to the +"bsd|aix|lprng|plp" settings taking effect for all other systems, for +the most important commands (the print command, the +lpq command and the lprm +command). The lppause command and the +lpresume command remained empty. Of course, these +commands worked on bsd|aix|lprng|plp but they didn't work on +sysv|hpux|qnx systems. To work around this bug, you need to +explicitly set the commands. Use testparm -v to +check which command takes effect. Then check that this command is +adequate and actually works for your installed print subsystem. It is +always a good idea to explicitly set up your configuration files the +way you want them to work and not rely on any built-in defaults. +

Setting up your own Print Commands

+After a print job has finished spooling to a service, the +print command will be used by Samba via a +system() call to process the spool file. Usually +the command specified will submit the spool file to the host's +printing subsystem. But there is no requirement at all that this must +be the case. The print subsystem will probably not remove the spool +file on its own. So whatever command you specify on your own you +should ensure that the spool file is deleted after it has been +processed. +

+There is no difficulty with using your own customized print commands +with the traditional printing systems. However, if you don't wish to +"roll your own", you should be well informed about the default +built-in commands that Samba uses for each printing subsystem (see the +table above). In all the commands listed in the last paragraphs you +see parameters of the form %X These are +macros, or shortcuts, used as place holders for +the names of real objects. At the time of running a command with such +a placeholder, Samba will insert the appropriate value +automatically. Print commands can handle all Samba macro +substitutions. In regard to printing, the following ones do have +special relevance: +

  • %s, %f - the path to the spool +file name

  • %p - the appropriate printer +name

  • %J - the job name as +transmitted by the client.

  • %c - the number of printed +pages of the spooled job (if known).

  • %z - the size of the spooled +print job (in bytes)

+The print command MUST contain at least one occurrence of +%s or %f. -- The +%p is optional. If no printer name is supplied, +the %p will be silently removed from the print +command. In this case the job is sent to the default printer. +

+If specified in the [global] section, the print +command given will be used for any printable service that does not +have its own print command specified. If there is neither a specified +print command for a printable service nor a global print command, +spool files will be created but not processed! And (most importantly): +print files will not be removed, so they will start filling your Samba +hard disk. +

+Note that printing may fail on some UNIXes from the "nobody" +account. If this happens, create an alternative guest account and +supply it with the privilege to print. Set up this guest account in +the [global] section with the guest +account parameter. +

+You can form quite complex print commands. You need to realize that +print commands are just passed to a UNIX shell. The shell is able to +expand the included environment variables as usual. (The syntax to +include a UNIX environment variable $variable +in or in the Samba print command is +%$variable.) To give you a working +print command example, the following will log a +print job to /tmp/print.log, print the file, then +remove it. Note that ';' is the usual separator for commands in shell +scripts: +

print command = echo Printing %s >> /tmp/print.log; lpr -P %p %s; rm %s

+You may have to vary your own command considerably from this example +depending on how you normally print files on your system. The default +for the print command parameter varies depending on the setting of +the printing parameter. Another example is: +

print command = /usr/local/samba/bin/myprintscript %p %s

Innovations in Samba Printing since 2.2

+Before version 2.2.0, Samba's print server support for Windows clients +was limited to the level of LanMan printing +calls. This is the same protocol level as Windows 9x PCs offer when +they share printers. Beginning with the 2.2.0 release, Samba started +to support the native Windows NT printing mechanisms. These are +implemented via MS-RPC (RPC = Remote +Procedure Calls ). MS-RPCs use the +SPOOLSS named pipe for all printing. +

+The additional functionality provided by the new SPOOLSS support includes: +

  • Support for downloading printer driver files to Windows +95/98/NT/2000 clients upon demand (Point'n'Print); +

  • Uploading of printer drivers via the Windows NT +Add Printer Wizard (APW) or the +Imprints tool set. +

  • Support for the native MS-RPC printing calls such as + StartDocPrinter, EnumJobs(), etc... (See the MSDN documentation for more information on the Win32 printing API);

  • Support for NT Access Control +Lists (ACL) on printer objects;

  • Improved support for printer queue manipulation +through the use of internal databases for spooled job information +(implemented by various *.tdb +files).

+One other benefit of an update is this: Samba 3 is able to publish +all its printers in Active Directory (or LDAP)! +

+One slight difference is here: it is possible on a Windows NT print +server to have printers listed in the Printers folder which are +not shared. Samba does not make this +distinction. By definition, the only printers of which Samba is aware +are those which are specified as shares in +. The reason is that Windows NT/200x/XP Professional +clients do not normally need to use the standard SMB printer share; +rather they can print directly to any printer on another Windows NT +host using MS-RPC. This of course assumes that the printing client has +the necessary privileges on the remote host serving the printer. The +default permissions assigned by Windows NT to a printer gives the +"Print" permissions to the well-known Everyone +group. (The older clients of type Win9x can only print to "shared" +printers). +

Client Drivers on Samba Server for Point'n'Print

+There is still confusion about what all this means: Is it or +is it not a requirement for printer drivers to be installed on a Samba +host in order to support printing from Windows clients? The +answer to this is: No, it is not a +requirement. Windows NT/2000 clients can, of +course, also run their APW to install drivers +locally (which then connect to a Samba served +print queue). This is the same method as used by Windows 9x +clients. (However, a bug existed in Samba 2.2.0 +which made Windows NT/2000 clients require that the Samba server +possess a valid driver for the printer. This was fixed in Samba +2.2.1). +

+But it is a new option to install the printer +drivers into the [print$] share of the Samba +server, and a big convenience too. Then all +clients (including 95/98/ME) get the driver installed when they first +connect to this printer share. The uploading or +depositing of the driver into this +[print$] share, and the following binding of +this driver to an existing Samba printer share can be achieved by +different means: +

  • running the APW on an +NT/200x/XP Professional client (this doesn't work from 95/98/ME +clients);

  • using the Imprints +toolset;

  • using the smbclient and +rpcclient commandline tools;

  • using cupsaddsmb(only works for +the CUPS printing system, not for LPR/LPD, LPRng +etc.).

+Please take additional note of the following fact: Samba +does not use these uploaded drivers in any way to process spooled +files. Drivers are utilized entirely by the clients, who +download and install them via the "Point'n'Print" mechanism supported +by Samba. The clients use these drivers to generate print files in the +format the printer (or the UNIX print system) requires. Print files +received by Samba are handed over to the UNIX printing system, which +is responsible for all further processing, if needed. +

The [printer$] Section is removed from Samba 3

+[print$] vs. [printer$] +.  +Versions of Samba prior to 2.2 made it possible to use a share +named [printer$]. This name was taken from the +same named service created by Windows 9x clients when a printer was +shared by them. Windows 9x printer servers always have a +[printer$] service which provides read-only +access (with no password required) in order to support printer driver +downloads. However, Samba's initial implementation allowed for a +parameter named printer driver location to be +used on a per share basis. This specified the location of the driver +files associated with that printer. Another parameter named +printer driver provided a means of defining the +printer driver name to be sent to the client. These parameters, +including the printer driver file parameter, +are now removed and can not be used in installations of samba-3. +Now the share name [print$] is used for the +location of downloadable printer drivers. It is taken from the +[print$] service created by Windows NT PCs when +a printer is shared by them. Windows NT print servers always have a +[print$] service which provides read-write +access (in the context of its ACLs) in order to support printer driver +down- and uploads. Don't fear -- this does not mean Windows 9x +clients are thrown aside now. They can use Samba's +[print$] share support just fine. +

Creating the [print$] Share

+In order to support the up- and downloading of printer driver files, +you must first configure a file share named +[print$]. The "public" name of this share is +hard coded in Samba's internals (because it is hard coded in the MS +Windows clients too). It cannot be renamed since Windows clients are +programmed to search for a service of exactly this name if they want +to retrieve printer driver files. +

+You should modify the server's file to +add the global parameters and create the +[print$] file share (of course, some of the +parameter values, such as 'path' are arbitrary and should be replaced +with appropriate values for your site): +

Example 18.3. [print\$] example

[global]
# members of the ntadmin group should be able to add drivers and set
# printer properties. root is implicitly always a 'printer admin'.
printer admin = @ntadmin
...
[printers]
...
[print$]
comment = Printer Driver Download Area
path = /etc/samba/drivers
browseable = yes
guest ok = yes
read only = yes
write list = @ntadmin, root

+Of course, you also need to ensure that the directory named by the +path parameter exists on the UNIX file system. +

Parameters in the [print$] Section

+[print$] is a special section in +. It contains settings relevant to +potential printer driver download and local installation by clients. +

comment = Printer Driver + Download Area

the comment appears next to the share name if it is +listed in a share list (usually Windows clients won't see it often but +it will also appear up in a smbclient -L sambaserver + output).

path = /etc/samba/printers

this is the path to the location of the Windows +driver file deposit from the UNIX point of +view.

browseable = no

this makes the [print$] share +"invisible" in Network Neighbourhood to clients. However, you can +still "mount" it from any client using the net use +g:\\sambaserver\print$ command in a "DOS box" or the +"Connect network drive" menu from Windows +Explorer.

guest ok = yes

this gives read only access to this share for all +guest users. Access may be used to download and install printer +drivers on clients. The requirement for guest ok = +yes depends upon how your site is configured. If users +will be guaranteed to have an account on the Samba host, then this is +a non-issue.

Note

+The non-issue is this: if all your Windows NT users are guaranteed to +be authenticated by the Samba server (for example if Samba +authenticates via an NT domain server and the NT user has already been +validated by the Domain Controller in order to logon to the Windows NT +session), then guest access is not necessary. Of course, in a +workgroup environment where you just want to be able to print without +worrying about silly accounts and security, then configure the share +for guest access. You'll probably want to add map to guest = Bad User in the +[global] section +as well. Make sure you understand what this parameter does before +using it. +

read only = yes

as we don't want everybody to upload driver files (or +even change driver settings) we tagged this share as not +writeable.

write list = @ntadmin,root

since the [print$] was made +read only by the previous setting, we need to create a "write list" +also. UNIX groups (denoted with a leading "@" character) and users +listed here are allowed write access (as an exception to the general +public's "read-only" access), which they need to update files on the +share. Normally you will want to only name administrative level user +accounts in this setting. Check the file system permissions to make +sure these accounts can copy files to the share. If this is a non-root +account, then the account should also be mentioned in the global +printer admin parameter. See the + man page for more information on +configuring file shares.

Subdirectory Structure in [print$]

+In order for a Windows NT print server to support the downloading of +driver files by multiple client architectures, you must create several +subdirectories within the [print$] service +(i.e. the UNIX directory named by the path +parameter). These correspond to each of the supported client +architectures. Samba follows this model as well. Just like the name of +the [print$] share itself, the subdirectories +*must* be exactly the names listed below (you may leave out the +subdirectories of architectures you don't want to support). +

+Therefore, create a directory tree below the +[print$] share for each architecture you wish +to support. +

+[print$]--+--
+          |--W32X86           # serves drivers to "Windows NT x86"
+          |--WIN40            # serves drivers to "Windows 95/98"
+          |--W32ALPHA         # serves drivers to "Windows NT Alpha_AXP"
+          |--W32MIPS          # serves drivers to "Windows NT R4000"
+          |--W32PPC           # serves drivers to "Windows NT PowerPC"
+

Required permissions

+In order to add a new driver to your Samba host, one of two conditions +must hold true: +

  • The account used to connect to the Samba host must +have a UID of 0 (i.e. a root account)

  • The account used to connect to the Samba host must be +named in the printer adminlist.

+Of course, the connected account must still possess access to add +files to the subdirectories beneath +[print$]. Remember that all file shares are set +to 'read only' by default. +

+Once you have created the required [print$] +service and associated subdirectories, go to a Windows NT 4.0/2k/XP +client workstation. Open Network Neighbourhood or +My Network Places and browse for the Samba host. +Once you have located the server, navigate to its Printers and +Faxes folder. You should see an initial listing of printers +that matches the printer shares defined on your Samba host. +

Installing Drivers into [print$]

+You have successfully created the [print$] +share in ? And Samba has re-read its +configuration? Good. But you are not yet ready to take off. The +driver files need to be present in this share, +too! So far it is still an empty share. Unfortunately, it is not enough +to just copy the driver files over. They need to be set +up too. And that is a bit tricky, to say the least. We +will now discuss two alternative ways to install the drivers into +[print$]: +

  • using the Samba commandline utility +rpcclient with its various subcommands (here: +adddriver and setdriver) from +any UNIX workstation;

  • running a GUI (Printer +Properties and Add Printer Wizard) +from any Windows NT/2k/XP client workstation.

+The latter option is probably the easier one (even if the only +entrance to this realm seems a little bit weird at first). +

Setting Drivers for existing Printers with a Client GUI

+The initial listing of printers in the Samba host's +Printers folder accessed from a client's Explorer +will have no real printer driver assigned to them. By default +this driver name is set to a NULL +string. This must be changed now. The local Add Printer +Wizard, run from NT/2000/XP clients, will help us in this +task. +

+However, the job to set a valid driver for the printer is not a +straightforward one: You must attempt to view the printer properties +for the printer to which you want the driver assigned. Open the +Windows Explorer, open Network Neighbourhood, browse to the Samba +host, open Samba's Printers folder, right-click the printer icon and +select Properties.... You are now trying to view printer and driver +properties for a queue which has this default NULL driver +assigned. This will result in an error message (this is normal here): +

Device settings cannot be displayed. The driver +for the specified printer is not installed, only spooler properties +will be displayed. Do you want to install the driver +now?

+Important:Don't click Yes! Instead, +click No in the error dialog. +Only now you will be presented with the printer properties window. From here, +the way to assign a driver to a printer is open to us. You have now the choice +either: +

  • select a driver from the pop-up list of installed +drivers. Initially this list will be empty. +Or

  • use the New Driver... button to +install a new printer driver (which will in fact start up the +APW).

+Once the APW is started, the procedure is exactly the same as the one +you are familiar with in Windows (we assume here that you are +familiar with the printer driver installations procedure on Windows +NT). Make sure your connection is in fact setup as a user with +printer admin privileges (if in doubt, use +smbstatus to check for this). If you wish to +install printer drivers for client operating systems other than +Windows NT x86, you will need to use the +Sharing tab of the printer properties dialog. +

+Assuming you have connected with an administrative (or root) account +(as named by the printer admin parameter), +you will also be able to modify other printer properties such as ACLs +and default device settings using this dialog. For the default device +settings, please consider the advice given further below. +

Setting Drivers for existing Printers with +rpcclient

+The second way to install printer drivers into +[print$] and set them up in a valid way can be +done from the UNIX command line. This involves four distinct steps: +

  1. gathering the info about the required driver files +and collecting the files together;

  2. deposit the driver files into the +[print$] share's correct subdirectories +(possibly by using smbclient);

  3. running the rpcclient +commandline utility once with the adddriver +subcommand,

  4. running rpcclient a second +time with the setdriver +subcommand.

+We will provide detailed hints for each of these steps in the next few +paragraphs. +

Identifying the Driver Files

+To find out about the driver files, you have two options: you could +investigate the driver CD which comes with your printer. Study the +*.inf file on the CD, if it is contained. This +may not be the possible, since the *.inf file might be +missing. Unfortunately, many vendors have now started to use their own +installation programs. These installations packages are often some +sort of Windows platform archive format, plus, the files may get +re-named during the installation process. This makes it extremely +difficult to identify the driver files you need. +

+Then you only have the second option: install the driver first on a +Windows client *locally* and investigate which file names and paths it +uses after they are installed. (Note, that you need to repeat this +procedure for every client platform you want to support. We are going +to show it here for the W32X86 platform only, a +name used by Microsoft for all WinNT/2k/XP clients...) +

+A good method to recognize the driver files this is to print the test +page from the driver's Properties Dialog +(General tab). Then look at the list of driver +files named on the printout. You'll need to recognize what Windows +(and Samba) are calling the Driver File , the +Data File, the Config File, +the Help File and (optionally) the +Dependent Driver Files (this may vary slightly +for Windows NT). You need to remember all names (or better take a +note) for the next steps. +

+Another method to quickly test the driver filenames and related paths +is provided by the rpcclient utility. Run it with +enumdrivers or with the +getdriver subcommand, each in the +3 level. In the following example, +TURBO_XP is the name of the Windows PC (in this +case it was a Windows XP Professional laptop, BTW). I had installed +the driver locally to TURBO_XP while kde-bitshop is +the name of the Linux host from which I am working. We could run an +interactive rpcclient session; +then we'd get an rpcclient /> prompt and would +type the subcommands at this prompt. This is left as a good exercise +to the reader. For now we use rpcclient with the +-c parameter to execute a single subcommand +line and exit again. This is the method you would use if you want to +create scripts to automate the procedure for a large number of +printers and drivers. Note the different quotes used to overcome the +different spaces in between words: +

+root# rpcclient -U'Danka%xxxx' -c \
+	'getdriver "Heidelberg Digimaster 9110 (PS)" 3' TURBO_XP
+cmd = getdriver "Heidelberg Digimaster 9110 (PS)" 3
+
+[Windows NT x86]
+Printer Driver Info 3:
+  Version: [2]
+  Driver Name: [Heidelberg Digimaster 9110 (PS)]
+  Architecture: [Windows NT x86]
+  Driver Path: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\HDNIS01_de.DLL]
+  Datafile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.ppd]
+  Configfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\HDNIS01U_de.DLL]
+  Helpfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\HDNIS01U_de.HLP]
+  
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.DLL]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.INI]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1KMMin.DLL]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.dat]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.cat]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.def]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.hre]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.vnd]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de.hlp]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\Hddm91c1_de_reg.HLP]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\HDNIS01Aux.dll]
+  Dependentfiles: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\HDNIS01_de.NTF]
+  
+  Monitorname: []
+  Defaultdatatype: []
+

+You may notice, that this driver has quite a big number of +Dependentfiles (I know worse cases however). Also, +strangely, the Driver File is here tagged as +Driver Path.... oh, well. Here we don't have yet +support for the so-called WIN40 architecture +installed. This name is used by Microsoft for the Win95/98/ME platforms. +If we want to support these, we need to install the Win95/98/ME driver +files in addition to those for W32X86 +(i.e. the WinNT72000/XP clients) onto a Windows PC. This PC +can also host the Win9x drivers, even if itself runs on Windows NT, +2000 or XP. +

+Since the [print$] share is usually accessible +through the Network Neighbourhood, you can also use the UNC notation +from Windows Explorer to poke at it. The Win9x driver files will end +up in subdirectory "0" of the "WIN40" directory. The full path to +access them will be +\\WINDOWSHOST\print$\WIN40\0\. +

Note

more recent drivers on Windows 2000 and Windows XP are +installed into the "3" subdirectory instead of the "2". The version 2 +of drivers, as used in Windows NT, were running in Kernel Mode. +Windows 2000 changed this. While it still can use the Kernel Mode +drivers (if this is enabled by the Admin), its native mode for printer +drivers is User Mode execution. This requires drivers designed for +this. These type of drivers install into the "3" subdirectory. +

Collecting the Driver Files from a Windows Host's +[print$] Share

+Now we need to collect all the driver files we identified. in our +previous step. Where do we get them from? Well, why not retrieve them +from the very PC and the same [print$] share +which we investigated in our last step to identify the files? We can +use smbclient to do this. We will use the paths and +names which were leaked to us by getdriver. The +listing is edited to include linebreaks for readability: +

+root# smbclient //TURBO_XP/print\$ -U'Danka%xxxx'	\ 
+	-c 'cd W32X86/2;mget HD*_de.*             \
+	hd*ppd Hd*_de.* Hddm*dll HDN*Aux.DLL'
+added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
+Got a positive name query response from 10.160.50.8 ( 10.160.50.8 )
+Domain=[DEVELOPMENT] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
+Get file Hddm91c1_de.ABD? n
+Get file Hddm91c1_de.def? y
+getting file \W32X86\2\Hddm91c1_de.def of size 428 as Hddm91c1_de.def
+Get file Hddm91c1_de.DLL? y
+getting file \W32X86\2\Hddm91c1_de.DLL of size 876544 as Hddm91c1_de.DLL
+[...]
+
+

+After this command is complete, the files are in our current local +directory. You probably have noticed that this time we passed several +commands to the -c parameter, separated by semi-colons. This +effects that all commands are executed in sequence on the remote +Windows server before smbclient exits again. +

+Don't forget to repeat the procedure for the WIN40 +architecture should you need to support Win95/98/XP clients. Remember, the +files for these architectures are in the WIN40/0/ subdir. Once we are +complete, we can run smbclient ... put to store +the collected files on the Samba server's +[print$] share. +

Depositing the Driver Files into [print$]

+So, now we are going to put the driver files into the +[print$] share. Remember, the UNIX path to this +share has been defined previously in your +. You also have created subdirectories +for the different Windows client types you want to support. Supposing +your [print$] share maps to the UNIX path +/etc/samba/drivers/, your driver files should now +go here: +

  • for all Windows NT, 2000 and XP clients into +/etc/samba/drivers/W32X86/ but +*not*(yet) into the "2" subdir!

  • for all Windows 95, 98 and ME clients into +/etc/samba/drivers/WIN40/ -- but *not* +(yet) into the "0" subdir!

+We again use smbclient to transfer the driver files across the +network. We specify the same files and paths as were leaked to us by +running getdriver against the original +Windows install. However, now we are going to +store the files into a Samba/UNIX print server's +[print$] share... +

+		root# smbclient //SAMBA-CUPS/print\$ -U'root%xxxx' -c \
+ 'cd W32X86; put HDNIS01_de.DLL; \
+  put Hddm91c1_de.ppd; put HDNIS01U_de.DLL;        \
+  put HDNIS01U_de.HLP; put Hddm91c1_de.DLL;        \
+  put Hddm91c1_de.INI; put Hddm91c1KMMin.DLL;      \
+  put Hddm91c1_de.dat; put Hddm91c1_de.dat;        \
+  put Hddm91c1_de.def; put Hddm91c1_de.hre;        \
+  put Hddm91c1_de.vnd; put Hddm91c1_de.hlp;        \
+  put Hddm91c1_de_reg.HLP; put HDNIS01Aux.dll;     \
+  put HDNIS01_de.NTF'
+added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
+Got a positive name query response from 10.160.51.162 ( 10.160.51.162 )
+Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a]
+putting file HDNIS01_de.DLL as \W32X86\HDNIS01_de.DLL
+putting file Hddm91c1_de.ppd as \W32X86\Hddm91c1_de.ppd
+putting file HDNIS01U_de.DLL as \W32X86\HDNIS01U_de.DLL
+putting file HDNIS01U_de.HLP as \W32X86\HDNIS01U_de.HLP
+putting file Hddm91c1_de.DLL as \W32X86\Hddm91c1_de.DLL
+putting file Hddm91c1_de.INI as \W32X86\Hddm91c1_de.INI
+putting file Hddm91c1KMMin.DLL as \W32X86\Hddm91c1KMMin.DLL
+putting file Hddm91c1_de.dat as \W32X86\Hddm91c1_de.dat
+putting file Hddm91c1_de.dat as \W32X86\Hddm91c1_de.dat
+putting file Hddm91c1_de.def as \W32X86\Hddm91c1_de.def
+putting file Hddm91c1_de.hre as \W32X86\Hddm91c1_de.hre
+putting file Hddm91c1_de.vnd as \W32X86\Hddm91c1_de.vnd
+putting file Hddm91c1_de.hlp as \W32X86\Hddm91c1_de.hlp
+putting file Hddm91c1_de_reg.HLP as \W32X86\Hddm91c1_de_reg.HLP
+putting file HDNIS01Aux.dll as \W32X86\HDNIS01Aux.dll
+putting file HDNIS01_de.NTF as \W32X86\HDNIS01_de.NTF
+

+Phewww -- that was a lot of typing! Most drivers are a lot smaller -- +many only having 3 generic PostScript driver files plus 1 PPD. Note, +that while we did retrieve the files from the "2" subdirectory of the +"W32X86" directory from the Windows box, we don't +put them (for now) in this same subdirectory of the Samba box! This +re-location will automatically be done by the +adddriver command which we will run shortly (and +don't forget to also put the files for the Win95/98/ME architecture +into the WIN40/ subdirectory should you need +them). +

Check if the Driver Files are there (with smbclient)

+For now we verify that our files are there. This can be done with +smbclient too (but of course you can log in via SSH +also and do this through a standard UNIX shell access too): +

+root# smbclient //SAMBA-CUPS/print\$ -U 'root%xxxx' \
+	-c 'cd W32X86; pwd; dir; cd 2; pwd; dir'
+ added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
+Got a positive name query response from 10.160.51.162 ( 10.160.51.162 )
+Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a]
+
+Current directory is \\SAMBA-CUPS\print$\W32X86\
+.                                   D        0  Sun May  4 03:56:35 2003
+..                                  D        0  Thu Apr 10 23:47:40 2003
+2                                   D        0  Sun May  4 03:56:18 2003
+HDNIS01Aux.dll                      A    15356  Sun May  4 03:58:59 2003
+Hddm91c1KMMin.DLL                   A    46966  Sun May  4 03:58:59 2003
+HDNIS01_de.DLL                      A   434400  Sun May  4 03:58:59 2003
+HDNIS01_de.NTF                      A   790404  Sun May  4 03:56:35 2003
+Hddm91c1_de.DLL                     A   876544  Sun May  4 03:58:59 2003
+Hddm91c1_de.INI                     A      101  Sun May  4 03:58:59 2003
+Hddm91c1_de.dat                     A     5044  Sun May  4 03:58:59 2003
+Hddm91c1_de.def                     A      428  Sun May  4 03:58:59 2003
+Hddm91c1_de.hlp                     A    37699  Sun May  4 03:58:59 2003
+Hddm91c1_de.hre                     A   323584  Sun May  4 03:58:59 2003
+Hddm91c1_de.ppd                     A    26373  Sun May  4 03:58:59 2003
+Hddm91c1_de.vnd                     A    45056  Sun May  4 03:58:59 2003
+HDNIS01U_de.DLL                     A   165888  Sun May  4 03:58:59 2003
+HDNIS01U_de.HLP                     A    19770  Sun May  4 03:58:59 2003
+Hddm91c1_de_reg.HLP                 A   228417  Sun May  4 03:58:59 2003
+              40976 blocks of size 262144. 709 blocks available
+
+Current directory is \\SAMBA-CUPS\print$\W32X86\2\
+.                                   D        0  Sun May  4 03:56:18 2003
+..                                  D        0  Sun May  4 03:56:35 2003
+ADOBEPS5.DLL                        A   434400  Sat May  3 23:18:45 2003
+laserjet4.ppd                       A     9639  Thu Apr 24 01:05:32 2003
+ADOBEPSU.DLL                        A   109568  Sat May  3 23:18:45 2003
+ADOBEPSU.HLP                        A    18082  Sat May  3 23:18:45 2003
+PDFcreator2.PPD                     A    15746  Sun Apr 20 22:24:07 2003
+              40976 blocks of size 262144. 709 blocks available
+

+Notice that there are already driver files present in the +2 subdir (probably from a previous +installation). Once the files for the new driver are there too, you +are still a few steps away from being able to use them on the +clients. The only thing you could do *now* is to retrieve them from a +client just like you retrieve ordinary files from a file share, by +opening print$ in Windows Explorer. But that wouldn't install them per +Point'n'Print. The reason is: Samba doesn't know yet that these files +are something special, namely printer driver +files and it doesn't know yet to which print queue(s) these +driver files belong. +

Running rpcclient with +adddriver

+So, next you must tell Samba about the special category of the files +you just uploaded into the [print$] share. This +is done by the adddriver command. It will +prompt Samba to register the driver files into its internal TDB +database files. The following command and its output has been edited, +again, for readability: +

+		root# rpcclient -Uroot%xxxx -c 'adddriver "Windows NT x86" \
+"dm9110:HDNIS01_de.DLL: \
+Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP:   \
+ NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI,          \
+ Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,   \
+ Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \
+ HDNIS01Aux.dll,HDNIS01_de.NTF,                     \
+ Hddm91c1_de_reg.HLP' SAMBA-CUPS
+
+cmd = adddriver "Windows NT x86" \
+"dm9110:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL:    \
+ HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI, \
+ Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,          \
+ Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL,        \
+ HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP"
+
+Printer Driver dm9110 successfully installed.
+
+

+After this step the driver should be recognized by Samba on the print +server. You need to be very careful when typing the command. Don't +exchange the order of the fields. Some changes would lead to a +NT_STATUS_UNSUCCESSFUL error +message. These become obvious. Other changes might install the driver +files successfully, but render the driver unworkable. So take care! +Hints about the syntax of the adddriver command are in the man +page. The CUPS printing chapter of this HOWTO collection provides a +more detailed description, if you should need it. +

Check how Driver Files have been moved after +adddriver finished

+One indication for Samba's recognition of the files as driver files is +the successfully installed message. +Another one is the fact, that our files have been moved by the +adddriver command into the 2 +subdirectory. You can check this again with +smbclient: +

+root# smbclient //SAMBA-CUPS/print\$ -Uroot%xx -c 'cd W32X86;dir;pwd;cd 2;dir;pwd'
+ added interface ip=10.160.51.162 bcast=10.160.51.255 nmask=255.255.252.0
+ Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a]
+
+  Current directory is \\SAMBA-CUPS\print$\W32X86\
+  .                                   D        0  Sun May  4 04:32:48 2003
+  ..                                  D        0  Thu Apr 10 23:47:40 2003
+  2                                   D        0  Sun May  4 04:32:48 2003
+                40976 blocks of size 262144. 731 blocks available 
+
+  Current directory is \\SAMBA-CUPS\print$\W32X86\2\
+  .                                   D        0  Sun May  4 04:32:48 2003
+  ..                                  D        0  Sun May  4 04:32:48 2003
+  DigiMaster.PPD                      A   148336  Thu Apr 24 01:07:00 2003
+  ADOBEPS5.DLL                        A   434400  Sat May  3 23:18:45 2003
+  laserjet4.ppd                       A     9639  Thu Apr 24 01:05:32 2003
+  ADOBEPSU.DLL                        A   109568  Sat May  3 23:18:45 2003
+  ADOBEPSU.HLP                        A    18082  Sat May  3 23:18:45 2003
+  PDFcreator2.PPD                     A    15746  Sun Apr 20 22:24:07 2003
+  HDNIS01Aux.dll                      A    15356  Sun May  4 04:32:18 2003
+  Hddm91c1KMMin.DLL                   A    46966  Sun May  4 04:32:18 2003
+  HDNIS01_de.DLL                      A   434400  Sun May  4 04:32:18 2003
+  HDNIS01_de.NTF                      A   790404  Sun May  4 04:32:18 2003
+  Hddm91c1_de.DLL                     A   876544  Sun May  4 04:32:18 2003
+  Hddm91c1_de.INI                     A      101  Sun May  4 04:32:18 2003
+  Hddm91c1_de.dat                     A     5044  Sun May  4 04:32:18 2003
+  Hddm91c1_de.def                     A      428  Sun May  4 04:32:18 2003
+  Hddm91c1_de.hlp                     A    37699  Sun May  4 04:32:18 2003
+  Hddm91c1_de.hre                     A   323584  Sun May  4 04:32:18 2003
+  Hddm91c1_de.ppd                     A    26373  Sun May  4 04:32:18 2003
+  Hddm91c1_de.vnd                     A    45056  Sun May  4 04:32:18 2003
+  HDNIS01U_de.DLL                     A   165888  Sun May  4 04:32:18 2003
+  HDNIS01U_de.HLP                     A    19770  Sun May  4 04:32:18 2003
+  Hddm91c1_de_reg.HLP                 A   228417  Sun May  4 04:32:18 2003
+                40976 blocks of size 262144. 731 blocks available
+
+

+Another verification is that the timestamp of the printing TDB files +is now updated (and possibly their filesize has increased). +

Check if the Driver is recognized by Samba

+Now the driver should be registered with Samba. We can easily verify +this, and will do so in a moment. However, this driver is +not yet associated with a particular +printer. We may check the driver status of the +files by at least three methods: +

  • from any Windows client browse Network Neighbourhood, +find the Samba host and open the Samba Printers and +Faxes folder. Select any printer icon, right-click and +select the printer Properties. Click on the +Advanced tab. Here is a field indicating the +driver for that printer. A drop down menu allows you to change that +driver (be careful to not do this unwittingly.). You can use this +list to view all drivers know to Samba. Your new one should be amongst +them. (Each type of client will only see his own architecture's +list. If you don't have every driver installed for each platform, the +list will differ if you look at it from Windows95/98/ME or +WindowsNT/2000/XP.)

  • from a Windows 2000 or XP client (not WinNT) browse +Network Neighbourhood, search for the Samba +server and open the server's Printers folder, +right-click the white background (with no printer highlighted). Select +Server Properties. On the +Drivers tab you will see the new driver listed +now. This view enables you to also inspect the list of files belonging +to that driver (this doesn't work on Windows NT, but only on +Windows 2000 and Windows XP. WinNT doesn't provide the "Drivers" +tab).. An alternative, much quicker method for Windows +2000/XP to start this dialog is by typing into a DOS box (you must of +course adapt the name to your Samba server instead of SAMBA-CUPS): +

    rundll32 printui.dll,PrintUIEntry /s /t2 /n\\SAMBA-CUPS

  • from a UNIX prompt run this command (or a variant +thereof), where SAMBA-CUPS is the name of the Samba +host and "xxxx" represents the actual Samba password assigned to root: +

    rpcclient -U'root%xxxx' -c 'enumdrivers' SAMBA-CUPS

    +You will see a listing of all drivers Samba knows about. Your new one +should be amongst them. But it is only listed under the [Windows NT +x86] heading, not under [Windows 4.0], +since we didn't install that part. Or did *you*? -- You will see a listing of +all drivers Samba knows about. Your new one should be amongst them. In our +example it is named dm9110. Note that the 3rd column +shows the other installed drivers twice, for each supported architecture one +time. Our new driver only shows up for +Windows NT 4.0 or 2000. To +have it present for Windows 95, 98 and ME you'll +have to repeat the whole procedure with the WIN40 architecture and subdirectory. +

A side note: you are not bound to specific driver names

+You can name the driver as you like. If you repeat the +adddriver step, with the same files as before, but +with a different driver name, it will work the same: +

+root# rpcclient -Uroot%xxxx                                        \
+  -c 'adddriver "Windows NT x86"                     \
+  "myphantasydrivername:HDNIS01_de.DLL:              \
+  Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP:   \
+  NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI,          \
+  Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,   \
+  Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \
+  HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP' SAMBA-CUPS
+  
+
+ cmd = adddriver "Windows NT x86" 
+                 "myphantasydrivername:HDNIS01_de.DLL:Hddm91c1_de.ppd:HDNIS01U_de.DLL:\
+                  HDNIS01U_de.HLP:NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI,           \
+                  Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,                    \
+                  Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL,                  \
+                  HDNIS01Aux.dll,HDNIS01_de.NTF,Hddm91c1_de_reg.HLP"
+
+ Printer Driver myphantasydrivername successfully installed.
+
+

+You will also be able to bind that driver to any print queue (however, +you are responsible yourself that you associate drivers to queues +which make sense to the target printer). Note, that you can't run the +rpcclient adddriver command +repeatedly. Each run "consumes" the files you had put into the +[print$] share by moving them into the +respective subdirectories. So you must precede an +smbclient ... put command before each +rpcclient ... adddriver" command. +

Running rpcclient with +setdriver

+Samba still needs to know which printer's driver +this is. It needs to create a mapping of the driver to a printer, and +store this info in its "memory", the TDB files. The rpcclient +setdriver command achieves exactly this: +

+root# rpcclient -U'root%xxxx' -c 'setdriver dm9110 myphantasydrivername' SAMBA-CUPS
+ cmd = setdriver dm9110 myphantasydrivername
+ Successfully set dm9110 to driver myphantasydrivername.
+

+Ahhhhh -- no, I didn't want to do that. Repeat, this time with the +name I intended: +

+root# rpcclient -U'root%xxxx' -c 'setdriver dm9110 dm9110' SAMBA-CUPS
+ cmd = setdriver dm9110 dm9110
+ Successfully set dm9110 to driver dm9110.
+

+The syntax of the command is rpcclient +-U'root%sambapassword' -c 'setdriver +"printername" +"drivername' +SAMBA-Hostname . -- +Now we have done *most* of the work. But not yet all.... +

Note

+the setdriver command will only succeed if the printer is +known to +Samba already. A bug in 2.2.x prevented Samba from recognizing freshly +installed printers. You had to restart Samba, or at least send a HUP +signal to all running smbd processes to work around this: +kill -HUP `pidof smbd`.

Client Driver Install Procedure

+A famous philosopher said once: “The Proof of the Pudding lies +in the Eating”. The proof for our setup lies in the printing. +So let's install the printer driver onto the client PCs. This is not +as straightforward as it may seem. Read on. +

The first Client Driver Installation

+Especially important is the installation onto the first client PC (for +each architectural platform separately). Once this is done correctly, +all further clients are easy to setup and shouldn't need further +attention. What follows is a description for the recommended first +procedure. You work now from a client workstation. First you should +guarantee that your connection is not unwittingly mapped to +bad user "nobody". In a DOS box type: +

net use \\SAMBA-SERVER\print$ /user:root

+Replace root, if needed, by another valid +printer admin user as given in the definition. +Should you already be connected as a different user, you'll get an error +message. There is no easy way to get rid of that connection, because +Windows doesn't seem to know a concept of "logging off" from a share +connection (don't confuse this with logging off from the local +workstation; that is a different matter). You can try to close +all Windows file explorer and Internet Explorer +windows. As a last resort, you may have to reboot. Make sure there is +no automatic re-connection set up. It may be easier to go to a +different workstation and try from there. After you have made sure you +are connected as a printer admin user (you can check this with the +smbstatus command on Samba) do this from the +Windows workstation: +

  • Open Network +Neighbourhood

  • Browse to Samba server

  • Open its Printers and +Faxes folder

  • Highlight and right-click the printer

  • Select Connect... (for WinNT4/2K +it is possibly Install...)

+A new printer (named printername on +samba-server) should now have appeared in your +local Printer folder (check Start -- +Settings -- Control Panel +-- Printers and Faxes). +

+Most likely you are now tempted to try and print a test page. After +all, you now can open the printer properties and on the "General" tab, +there is a button offering to do just that. But chances are that you +get an error message saying Unable to print Test +Page. The reason might be that there is not yet a +valid Device Mode set for the driver, or that the "Printer Driver +Data" set is still incomplete. +

+You must now make sure that a valid "Device Mode" is set for the +driver. Don't fear -- we will explain now what that means. +

IMPORTANT! Setting Device Modes on new Printers

+In order for a printer to be truly usable by a Windows NT/2K/XP +client, it must possess: +

  • a valid Device Mode generated by +the driver for the printer (defining things like paper size, +orientation and duplex settings), and

  • a complete set of +Printer Driver Data generated by the +driver.

+If either one of these is incomplete, the clients can produce less +than optimal output at best. In the worst cases, unreadable garbage or +nothing at all comes from the printer or they produce a harvest of +error messages when attempting to print. Samba stores the named values +and all printing related info in its internal TDB database files +(ntprinters.tdb, +ntdrivers.tdb, printing.tdb +and ntforms.tdb). +

+What do these two words stand for? Basically, the Device Mode and the +set of Printer Driver Data is a collection of settings for all print +queue properties, initialized in a sensible way. Device Modes and +Printer Driver Data should initially be set on the print server (that is +here: the Samba host) to healthy values so that the clients can start +to use them immediately. How do we set these initial healthy values? +This can be achieved by accessing the drivers remotely from an NT (or +2k/XP) client, as is discussed in the next paragraphs. +

+Be aware, that a valid Device Mode can only be initiated by a +printer admin, or root (the reason should be +obvious). Device Modes can only correctly be set by executing the +printer driver program itself. Since Samba can not execute this Win32 +platform driver code, it sets this field initially to NULL (which is +not a valid setting for clients to use). Fortunately, most drivers +generate themselves the Printer Driver Data that is needed, when they +are uploaded to the [print$] share with the +help of the APW or rpcclient. +

+The generation and setting of a first valid Device Mode however +requires some "tickling" from a client, to set it on the Samba +server. The easiest means of doing so is to simply change the page +orientation on the server's printer. This "executes" enough of the +printer driver program on the client for the desired effect to happen, +and feeds back the new Device Mode to our Samba server. You can use the +native Windows NT/2K/XP printer properties page from a Window client +for this: +

  • Browse the Network Neighbourhood

  • Find the Samba server

  • Open the Samba server's Printers and + Faxes folder

  • Highlight the shared printer in question

  • Right-click the printer (you may already be here, if you +followed the last section's description)

  • At the bottom of the context menu select +Properties.... (if the menu still offers the +Connect... entry +further above, you need to click that one first to achieve the driver +installation as shown in the last section)

  • Go to the Advanced tab; click on +Printing Defaults...

  • Change the "Portrait" page setting to "Landscape" (and +back)

  • (Oh, and make sure to apply +changes between swapping the page orientation to cause the change to +actually take effect...).

  • While you're at it, you may optionally also want to +set the desired printing defaults here, which then apply to all future +client driver installations on the remaining from now +on.

+This procedure has executed the printer driver program on the client +platform and fed back the correct Device Mode to Samba, which now +stored it in its TDB files. Once the driver is installed on the +client, you can follow the analogous steps by accessing the +local Printers folder too if you are +a Samba printer admin user. From now on printing should work as expected. +

+Samba also includes a service level parameter name default +devmode for generating a default Device Mode for a +printer. Some drivers will function well with Samba's default set of +properties. Others may crash the client's spooler service. So use this +parameter with caution. It is always better to have the client +generate a valid device mode for the printer and store it on the +server for you. +

Further Client Driver Install Procedures

+Every further driver may be done by any user, along the lines +described above: Browse network, open printers folder on Samba server, +right-click printer and choose Connect.... Once +this completes (should be not more than a few seconds, but could also take +a minute, depending on network conditions), you should find the new printer in +your client workstation local Printers and +Faxes folder. +

+You can also open your local Printers and Faxes folder by +using this command on Windows 2000 and Windows XP Professional workstations: +

rundll32 shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder +

+or this command on Windows NT 4.0 workstations: +

+rundll32 shell32.dll,Control_RunDLL MAIN.CPL @2 +

+You can enter the commands either inside a DOS box window +or in the Run command... field from the +Start menu. +

Always make first Client Connection as root or "printer admin"

+After you installed the driver on the Samba server (in its +[print$] share, you should always make sure +that your first client installation completes correctly. Make it a habit for +yourself to build that the very first connection from a client as +printer admin. This is to make sure that: +

  • a first valid Device Mode is +really initialized (see above for more explanation details), and +that

  • the default print settings of your printer for all +further client installations are as you want them

+Do this by changing the orientation to landscape, click +Apply, and then change it back again. Then modify +the other settings (for example, you don't want the default media size +set to Letter, when you are all using +A4, right? You may want to set the printer for +duplex as the default; etc.). +

+To connect as root to a Samba printer, try this command from a Windows +2K/XP DOS box command prompt: +

+C:\> runas /netonly /user:root "rundll32 printui.dll,PrintUIEntry /p /t3 /n 
+	\\SAMBA-SERVER\printername"
+

+

+You will be prompted for root's Samba-password; type it, wait a few +seconds, click on Printing Defaults... and +proceed to set the job options as should be used as defaults by all +clients. Alternatively, instead of root you can name one other member +of the printer admin from the setting. +

+Now all the other users downloading and installing the driver +the same way (called Point'n'Print) will +have the same defaults set for them. If you miss this step you'll +get a lot of helpdesk calls from your users. But maybe you like to +talk to people.... ;-) +

Other Gotchas

+Your driver is installed. It is ready for +Point'n'Print installation by the clients +now. You may have tried to download and use it +onto your first client machine now. But wait... let's make you +acquainted first with a few tips and tricks you may find useful. For +example, suppose you didn't manage to "set the defaults" on the +printer, as advised in the preceding paragraphs? And your users +complain about various issues (such as “We need to set the paper +size for each job from Letter to A4 and it won't store it!”) +

Setting Default Print Options for the Client Drivers

+The last sentence might be viewed with mixed feelings by some users and +admins. They have struggled for hours and hours and couldn't arrive at +a point were their settings seemed to be saved. It is not their +fault. The confusing thing is this: in the multi-tabbed dialog that pops +up when you right-click the printer name and select +Properties..., you can arrive at two identically +looking dialogs, each claiming that they help you to set printer options, +in three different ways. Here is the definite answer to the "Samba +Default Driver Setting FAQ": +

I can't set and save default print options +for all users on Win2K/XP! Why not?”  +How are you doing it? I bet the wrong way.... (it is not very +easy to find out, though). There are 3 different ways to bring you to +a dialog that seems to set everything. All three +dialogs look the same. Only one of them +does what you intend. +Important: you need to be Administrator or Print +Administrator to do this for all users. Here is how I reproduce it in +on XP Professional: + +

  1. The first "wrong" way: + +

    1. Open the Printers +folder.

    2. Right-click on the printer +(remoteprinter on cupshost) and +select in context menu Printing +Preferences...

    3. Look at this dialog closely and remember what it looks +like.

    +

  2. The second "wrong" way: + +

    1. Open the Printers +folder.

    2. Right-click on the printer (remoteprinter on +cupshost) and select in the context menu +Properties

    3. Click on the General +tab

    4. Click on the button Printing +Preferences...

    5. A new dialog opens. Keep this dialog open and go back +to the parent dialog.

    +

  3. The third, the "correct" way: (should you do +this from the beginning, just carry out steps 1. and 2. from second +"way" above) + +

    1. Click on the Advanced +tab. (Hmmm... if everything is "Grayed Out", then you are not logged +in as a user with enough privileges).

    2. Click on the Printing +Defaults... button.

    3. On any of the two new tabs, click on the +Advanced... button.

    4. A new dialog opens. Compare this one to the other, +identical looking one from "B.5" or A.3".

    +

+ +Do you see any difference in the two settings dialogs? I don't +either. However, only the last one, which you arrived at with steps +C.1.-6. will permanently save any settings which will then become the +defaults for new users. If you want all clients to have the same +defaults, you need to conduct these steps as administrator +(printer admin in ) +before a client downloads the driver (the clients +can later set their own per-user defaults by +following the procedures A. +or B. above...). (This is new: Windows 2000 and +Windows XP allow per-user default settings and +the ones the administrator gives them, before they set up their own). +The "parents" of the identically looking dialogs have a slight +difference in their window names: one is called +Default Print Values for Printer Foo on Server +Bar" (which is the one you need) and the other is +called "Print Settings for Printer Foo on Server +Bar". The last one is the one you arrive at when you +right-click on the printer and select Print +Settings.... This is the one what you were +taught to use back in the days of Windows NT! So it is only natural to +try the same way with Win2k or WinXP. You wouldn't dream +that there is now a different "clicking path" to arrive at an +identically looking, but functionally different dialog to set defaults +for all users! +

Tip

Try (on Win2000 and WinXP) to run this command (as a user +with the right privileges): +

+rundll32 printui.dll,PrintUIEntry /p /t3 /n\\SAMBA-SERVER\printersharename +

+to see the tab with the Printing Defaults... +button (the one you need). Also run this command: +

+rundll32 printui.dll,PrintUIEntry /p /t0 /n\\SAMBA-SERVER\printersharename +

+to see the tab with the Printing Preferences... +button (the one which doesn't set system-wide defaults). You can +start the commands from inside a DOS box" or from the Start +-- Run... menu. +

Supporting large Numbers of Printers

+One issue that has arisen during the recent development phase of Samba +is the need to support driver downloads for 100's of printers. Using +Windows NT APW here is somewhat awkward (to say the least). If you +don't want to acquire RSS pains from such the printer installation +clicking orgy alone, you need to think about a non-interactive script. +

+If more than one printer is using the same driver, the +rpcclient setdriver command can be used to set the +driver associated with an installed queue. If the driver is uploaded +to [print$] once and registered with the +printing TDBs, it can be used by multiple print queues. In this case +you just need to repeat the setprinter subcommand +of rpcclient for every queue (without the need to +conduct the adddriver again and again). The +following is an example of how this could be accomplished: +

+root# rpcclient SAMBA-CUPS -U root%secret -c 'enumdrivers'
+ cmd = enumdrivers
+ 
+ [Windows NT x86]
+ Printer Driver Info 1:
+   Driver Name: [infotec  IS 2075 PCL 6]
+ 
+ Printer Driver Info 1:
+   Driver Name: [DANKA InfoStream]
+ 
+ Printer Driver Info 1:
+   Driver Name: [Heidelberg Digimaster 9110 (PS)]
+ 
+ Printer Driver Info 1:
+   Driver Name: [dm9110]
+
+ Printer Driver Info 1:
+   Driver Name: [myphantasydrivername]
+
+ [....]
+

+ +

+root# rpcclient SAMBA-CUPS -U root%secret -c 'enumprinters'
+ cmd = enumprinters
+   flags:[0x800000]
+   name:[\\SAMBA-CUPS\dm9110]
+   description:[\\SAMBA-CUPS\dm9110,,110ppm HiVolume DANKA Stuttgart]
+   comment:[110 ppm HiVolume DANKA Stuttgart]
+ [....]
+

+ +

+root# rpcclient SAMBA-CUPS -U root%secret -c \
+  'setdriver dm9110 "Heidelberg Digimaster 9110 (PS)"'
+ cmd = setdriver dm9110 Heidelberg Digimaster 9110 (PPD)
+ Successfully set dm9110 to driver Heidelberg Digimaster 9110 (PS).
+

+ +

+root# rpcclient SAMBA-CUPS -U root%secret -c 'enumprinters'
+ cmd = enumprinters
+   flags:[0x800000]
+   name:[\\SAMBA-CUPS\dm9110]
+   description:[\\SAMBA-CUPS\dm9110,Heidelberg Digimaster 9110 (PS),\
+     110ppm HiVolume DANKA Stuttgart]
+   comment:[110ppm HiVolume DANKA Stuttgart]
+ [....]
+

+ +

+root# rpcclient SAMBA-CUPS -U root%secret -c 'setdriver dm9110 myphantasydrivername'
+ cmd = setdriver dm9110 myphantasydrivername
+ Successfully set dm9110 to myphantasydrivername.
+

+ +

+root# rpcclient SAMBA-CUPS -U root%secret -c 'enumprinters'
+ cmd = enumprinters
+   flags:[0x800000]
+   name:[\\SAMBA-CUPS\dm9110]
+   description:[\\SAMBA-CUPS\dm9110,myphantasydrivername,\
+     110ppm HiVolume DANKA Stuttgart]
+   comment:[110ppm HiVolume DANKA Stuttgart]
+ [....]
+

+It may be not easy to recognize: but the first call to +enumprinters showed the "dm9110" printer with an +empty string where the driver should have been listed (between the 2 +commas in the "description" field). After the +setdriver command succeeded, all is well. (The +CUPS Printing chapter has more info about the installation of printer +drivers with the help of rpcclient). +

Adding new Printers with the Windows NT APW

+By default, Samba exhibits all printer shares defined in +smb.conf in the +Printers... folder. Also located in this folder +is the Windows NT Add Printer Wizard icon. The APW will be shown only +if: +

  • ...the connected user is able to successfully execute +an OpenPrinterEx(\\server) with administrative +privileges (i.e. root or printer admin). +

    Tip

    Try this from a Windows 2K/XP DOS box command prompt: +

    +runas /netonly /user:root rundll32 printui.dll,PrintUIEntry /p /t0 /n \\SAMBA-SERVER\printersharename +

    +and click on Printing Preferences... +

  • ... contains the setting +show add printer wizard = yes (the +default).

+The APW can do various things: +

  • upload a new driver to the Samba +[print$] share;

  • associate an uploaded driver with an existing (but +still "driverless") print queue;

  • exchange the currently used driver for an existing +print queue with one that has been uploaded before;

  • add an entirely new printer to the Samba host (only in +conjunction with a working add printer command; +a corresponding delete printer command for +removing entries from the Printers... folder +may be provided too)

+The last one (add a new printer) requires more effort than the +previous ones. In order to use the APW to successfully add a printer +to a Samba server, the add printer command must +have a defined value. The program hook must successfully add the +printer to the UNIX print system (i.e. to +/etc/printcap, +/etc/cups/printers.conf or other appropriate +files) and to if necessary. +

+When using the APW from a client, if the named printer share does not +exist, smbd will execute the add printer +command and reparse to the +to attempt to locate the new printer share. If the share is still not +defined, an error of Access Denied is +returned to the client. Note that the add printer command is executed under the context of the connected +user, not necessarily a root account. A map to guest = bad user may have connected you unwittingly under the wrong +privilege; you should check it by using the +smbstatus command. +

Weird Error Message Cannot connect under a +different Name

+Once you are connected with the wrong credentials, there is no means +to reverse the situation other than to close all Explorer windows, and +perhaps reboot. +

  • The net use \\SAMBA-SERVER\sharename +/user:root gives you an error message: Multiple +connections to a server or a shared resource by the same user +utilizing the several user names are not allowed. Disconnect all +previous connections to the server, resp. the shared resource, and try +again.

  • Every attempt to "connect a network drive" to +\\SAMBASERVER\\print$ to z: is countered by the +pertinacious message. This network folder is currently +connected under different credentials (username and password). +Disconnect first any existing connection to this network share in +order to connect again under a different username and +password.

+So you close all connections. You try again. You get the same +message. You check from the Samba side, using +smbstatus. Yes, there are some more +connections. You kill them all. The client still gives you the same +error message. You watch the smbd.log file on a very high debug level +and try re-connect. Same error message, but not a single line in the +log. You start to wonder if there was a connection attempt at all. You +run ethereal and tcpdump while you try to connect. Result: not a +single byte goes on the wire. Windows still gives the error +message. You close all Explorer Windows and start it again. You try to +connect - and this times it works! Windows seems to cache connection +info somewhere and doesn't keep it up to date (if you are unlucky you +might need to reboot to get rid of the error message). +

Be careful when assembling Driver Files

+You need to be very careful when you take notes about the files and +belonging to a particular driver. Don't confuse the files for driver +version "0" (for Win95/98/ME, going into +[print$]/WIN/0/), driver version "2" (Kernel Mode +driver for WinNT, going into [print$]/W32X86/2/ +may be used on Win2K/XP too), and driver version +"3" (non-Kernel Mode driver going into +[print$]/W32X86/3/ can not +be used on WinNT). Very often these different driver versions contain +files carrying the same name; but still the files are very different! +Also, if you look at them from the Windows Explorer (they reside in +%WINDOWS%\system32\spool\drivers\W32X86\) you +will probably see names in capital letters, while an "enumdrivers" +command from Samba would show mixed or lower case letters. So it is +easy to confuse them. If you install them manually using +rpcclient and subcommands, you may even succeed +without an error message. Only later, when you try install on a +client, you will encounter error messages like This +server has no appropriate driver for the printer. +

+Here is an example. You are invited to look very closely at the +various files, compare their names and their spelling, and discover +the differences in the composition of the version-2 and -3 sets +Note: the version-0 set contained 40 (!) +Dependentfiles, so I left it out for space +reasons: +

+root# rpcclient -U 'Administrator%secret' -c 'enumdrivers 3' 10.160.50.8 
+
+ Printer Driver Info 3:
+         Version: [3]
+         Driver Name: [Canon iR8500 PS3]
+         Architecture: [Windows NT x86]
+         Driver Path: [\\10.160.50.8\print$\W32X86\3\cns3g.dll]
+         Datafile: [\\10.160.50.8\print$\W32X86\3\iR8500sg.xpd]
+         Configfile: [\\10.160.50.8\print$\W32X86\3\cns3gui.dll]
+         Helpfile: [\\10.160.50.8\print$\W32X86\3\cns3g.hlp]
+ 
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\aucplmNT.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\ucs32p.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\tnl32.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\aussdrv.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cnspdc.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\aussapi.dat]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cns3407.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\CnS3G.cnt]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\NBAPI.DLL]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\NBIPC.DLL]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cpcview.exe]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cpcdspl.exe]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cpcedit.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cpcqm.exe]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cpcspl.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cfine32.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cpcr407.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\Cpcqm407.hlp]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cpcqm407.cnt]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\3\cns3ggr.dll]
+ 
+         Monitorname: []
+         Defaultdatatype: []
+
+ Printer Driver Info 3:
+         Version: [2]
+         Driver Name: [Canon iR5000-6000 PS3]
+         Architecture: [Windows NT x86]
+         Driver Path: [\\10.160.50.8\print$\W32X86\2\cns3g.dll]
+         Datafile: [\\10.160.50.8\print$\W32X86\2\IR5000sg.xpd]
+         Configfile: [\\10.160.50.8\print$\W32X86\2\cns3gui.dll]
+         Helpfile: [\\10.160.50.8\print$\W32X86\2\cns3g.hlp]
+ 
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\AUCPLMNT.DLL]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\aussdrv.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\cnspdc.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\aussapi.dat]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\cns3407.dll]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\CnS3G.cnt]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\NBAPI.DLL]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\NBIPC.DLL]
+         Dependentfiles: [\\10.160.50.8\print$\W32X86\2\cns3gum.dll]
+ 
+         Monitorname: [CPCA Language Monitor2]
+         Defaultdatatype: []
+
+

+If we write the "version 2" files and the "version 3" files +into different text files and compare the result, we see this +picture: +

+root# sdiff 2-files 3-files
+
+
+ cns3g.dll                     cns3g.dll
+ iR8500sg.xpd                  iR8500sg.xpd
+ cns3gui.dll                   cns3gui.dll
+ cns3g.hlp                     cns3g.hlp
+ AUCPLMNT.DLL                | aucplmNT.dll
+                             > ucs32p.dll
+                             > tnl32.dll
+ aussdrv.dll                   aussdrv.dll
+ cnspdc.dll                    cnspdc.dll
+ aussapi.dat                   aussapi.dat
+ cns3407.dll                   cns3407.dll
+ CnS3G.cnt                     CnS3G.cnt
+ NBAPI.DLL                     NBAPI.DLL
+ NBIPC.DLL                     NBIPC.DLL
+ cns3gum.dll                 | cpcview.exe
+                             > cpcdspl.exe 
+                             > cpcqm.exe
+                             > cpcspl.dll
+                             > cfine32.dll
+                             > cpcr407.dll
+                             > Cpcqm407.hlp
+                             > cpcqm407.cnt
+                             > cns3ggr.dll
+
+

+Don't be fooled though! Driver files for each version with identical +names may be different in their content, as you can see from this size +comparison: +

+root# for i in cns3g.hlp cns3gui.dll cns3g.dll; do                  \
+           smbclient //10.160.50.8/print\$ -U 'Administrator%xxxx' \
+           -c "cd W32X86/3; dir $i; cd .. ; cd 2; dir $i";      \
+		   done
+
+  CNS3G.HLP               A   122981  Thu May 30 02:31:00 2002
+  CNS3G.HLP               A    99948  Thu May 30 02:31:00 2002
+
+  CNS3GUI.DLL             A  1805824  Thu May 30 02:31:00 2002
+  CNS3GUI.DLL             A  1785344  Thu May 30 02:31:00 2002
+
+  CNS3G.DLL               A  1145088  Thu May 30 02:31:00 2002
+  CNS3G.DLL               A    15872  Thu May 30 02:31:00 2002
+
+

+In my example were even more differences than shown here. Conclusion: +you must be very careful to select the correct driver files for each +driver version. Don't rely on the names alone. Don't interchange files +belonging to different driver versions. +

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 concept of ports associated with a printer. By +default, only one printer port, named "Samba Printer Port", exists on +a system. Samba does not really need such a "port" in order to print; +it rather is a requirement of Windows clients. They insist on being +told about an available port when they request this info, otherwise +they throw an error message at you. So Samba fakes the port +information to keep the Windows clients happy. +

+Note that Samba does not support the concept of "Printer Pooling" +internally either. Printer Pooling assigns a logical printer to +multiple ports as a form of load balancing or fail over. +

+If you require that multiple ports be defined for some reason or +another (“My users and my Boss should not know that they are +working with Samba”), possesses a +enumports command which can be used to define +an external program that generates a listing of ports on a system. +

Avoiding the most common Misconfigurations of the Client Driver

+So - printing works, but there are still problems. Most jobs print +well, some don't print at all. Some jobs have problems with fonts, +which don't look good at all. Some jobs print fast, and some are +dead-slow. We can't cover it all; but we want to encourage you to read +the little paragraph about "Avoiding the wrong PostScript Driver +Settings" in the CUPS Printing part of this document. +

The Imprints Toolset

+The Imprints tool set provides a UNIX equivalent of the +Windows NT Add Printer Wizard. For complete information, please +refer to the Imprints web site +at http://imprints.sourceforge.net/ +as well as the documentation included with the imprints source +distribution. This section will only provide a brief introduction +to the features of Imprints. +

Attention! Maintainer required.  +Unfortunately, the Imprints toolset is no longer maintained. As of +December, 2000, the project is in need of a new maintainer. The most +important skill to have is decent perl coding and an interest in +MS-RPC based printing using Samba. If you wish to volunteer, please +coordinate your efforts on the samba-technical mailing list. The +toolset is still in usable form; but only for a series of older +printer models, where there are prepared packages to use. Packages for +more up to date print devices are needed if Imprints should have a +future.

What is Imprints?

+Imprints is a collection of tools for supporting these goals: +

  • Providing a central repository information regarding +Windows NT and 95/98 printer driver packages

  • Providing the tools necessary for creating the +Imprints printer driver packages.

  • Providing an installation client which will obtain +printer drivers from a central internet (or intranet) Imprints Server +repository and install them on remote Samba and Windows NT4 print +servers.

Creating Printer Driver Packages

+The process of creating printer driver packages is beyond the scope of +this document (refer to Imprints.txt also included with the Samba +distribution for more information). In short, an Imprints driver +package is a gzipped tarball containing the driver files, related INF +files, and a control file needed by the installation client. +

The Imprints Server

+The Imprints server is really a database server that may be queried +via standard HTTP mechanisms. Each printer entry in the database has +an associated URL for the actual downloading of the package. Each +package is digitally signed via GnuPG which can be used to verify that +package downloaded is actually the one referred in the Imprints +database. It is strongly recommended that this security check +not be disabled. +

The Installation Client

+More information regarding the Imprints installation client is +available in the Imprints-Client-HOWTO.ps file +included with the imprints source package. +

+The Imprints installation client comes in two forms. +

  • a set of command line Perl scripts

  • a GTK+ based graphical interface to the command line Perl +scripts

+The installation client (in both forms) provides a means of querying +the Imprints database server for a matching list of known printer +model names as well as a means to download and install the drivers on +remote Samba and Windows NT print servers. +

+The basic installation process is in four steps and perl code is +wrapped around smbclient and rpcclient +

  • + foreach (supported architecture for a given driver) +

    1. rpcclient: Get the appropriate upload directory on the remote server

    2. smbclient: Upload the driver files

    3. rpcclient: Issues an AddPrinterDriver() MS-RPC

    +

  • rpcclient: Issue an AddPrinterEx() MS-RPC to actually create the printer

+One of the problems encountered when implementing the Imprints tool +set was the name space issues between various supported client +architectures. For example, Windows NT includes a driver named "Apple +LaserWriter II NTX v51.8" and Windows 95 calls its version of this +driver "Apple LaserWriter II NTX" +

+The problem is how to know what client drivers have been uploaded for +a printer. An astute reader will remember that the Windows NT Printer +Properties dialog only includes space for one printer driver name. A +quick look in the Windows NT 4.0 system registry at +

+ HKLM\System\CurrentControlSet\Control\Print\Environment +

+will reveal that Windows NT always uses the NT driver name. This is +ok as Windows NT always requires that at least the Windows NT version +of the printer driver is present. However, Samba does not have the +requirement internally. Therefore, how can you use the NT driver name +if is has not already been installed? +

+The way of sidestepping this limitation is to require that all +Imprints printer driver packages include both the Intel Windows NT and +95/98 printer drivers and that NT driver is installed first. +

Add Network Printers at Logon without User Interaction

+The following MS Knowledge Base article may be of some help if you +need to handle Windows 2000 clients: How to Add Printers +with No User Interaction in Windows 2000. ( http://support.microsoft.com/default.aspx?scid=kb;en-us;189105 +). It also applies to Windows XP Professional clients. +

+The ideas sketched out below are inspired by this article. It +describes a commandline method which can be applied to install +network and local printers and their drivers. This is most useful +if integrated in Logon Scripts. You can see what options are +available by typing in a command prompt ("DOS box") this: +

rundll32 printui.dll,PrintUIEntry /?

+A window pops up which shows you all of the commandline switches +available. An extensive list of examples is also provided. This is +only for Win 2k/XP. It doesn't work on WinNT. WinNT has probably some +other tools in the respective Resource Kit. Here is a suggestion about +what a client logon script might contain, with a short explanation of +what the lines actually do (it works if 2k/XP Windows clients access +printers via Samba, but works for Windows-based print servers too): +

+rundll32 printui.dll,PrintUIEntry /dn /n "\\sambacupsserver\infotec2105-IPDS" /q
+rundll32 printui.dll,PrintUIEntry /in /n "\\sambacupsserver\infotec2105-PS"
+rundll32 printui.dll,PrintUIEntry /y /n "\\sambacupsserver\infotec2105-PS"
+

+Here is a list of the used commandline parameters: +

/dn

deletes a network printer

/q

quiet modus

/n

names a printer

/in

adds a network printer connection

/y

sets printer as default printer

  • Line 1 deletes a possibly existing previous network +printer infotec2105-IPDS (which had used native +Windows drivers with LPRng that were removed from the server which was +converted to CUPS). The /q at the end eliminates +"Confirm" or error dialog boxes popping up. They should not be +presented to the user logging on.

  • Line 2 adds the new printer +infotec2105-PS (which actually is same physical +device but is now run by the new CUPS printing system and associated +with the CUPS/Adobe PS drivers). The printer and its driver +must have been added to Samba prior to the user +logging in (e.g. by a procedure as discussed earlier in this chapter, +or by running cupsaddsmb). The driver is now +auto-downloaded to the client PC where the user is about to log +in.

  • Line 3 sets the default printer to this new network +printer (there might be several other printers installed with this +same method and some may be local as well -- so we decide for a +default printer). The default printer selection may of course be +different for different users.

+Note that the second line only works if the printer +infotec2105-PS has an already working print queue +on "sambacupsserver", and if the printer drivers have successfully been +uploaded (via APW , +smbclient/rpcclient or +cupsaddsmb) into the +[print$] driver repository of Samba. Also, some +Samba versions prior to version 3.0 required a re-start of smbd after +the printer install and the driver upload, otherwise the script (or +any other client driver download) would fail. +

+Since there no easy way to test for the existence of an installed +network printer from the logon script, the suggestion is: don't bother +checking and just allow the deinstallation/reinstallation to occur +every time a user logs in; it's really quick anyway (1 to 2 seconds). +

+The additional benefits for this are: +

  • It puts in place any printer default setup changes +automatically at every user logon.

  • It allows for "roaming" users' login into the domain from +different workstations.

+Since network printers are installed per user this much simplifies the +process of keeping the installation up-to-date. The extra few seconds +at logon time will not really be noticeable. Printers can be centrally +added, changed, and deleted at will on the server with no user +intervention required on the clients (you just need to keep the logon +scripts up to date). +

The addprinter command

+The addprinter command can be configured to be a +shell script or program executed by Samba. It is triggered by running +the APW from a client against the Samba print server. The APW asks the +user to fill in several fields (such as printer name, driver to be +used, comment, port monitor, etc.). These parameters are passed on to +Samba by the APW. If the addprinter command is designed in a way that +it can create a new printer (through writing correct printcap entries +on legacy systems, or execute the lpadmin command +on more modern systems) and create the associated share in +, then the APW will in effect really +create a new printer on Samba and the UNIX print subsystem! +

Migration of "Classical" printing to Samba

+The basic "NT-style" printer driver management has not changed +considerably in 3.0 over the 2.2.x releases (apart from many small +improvements). Here migration should be quite easy, especially if you +followed previous advice to stop using deprecated parameters in your +setup. For migrations from an existing 2.0.x setup, or if you +continued "Win9x-style" printing in your Samba 2.2 installations, it +is more of an effort. Please read the appropriate release notes and +the HOWTO Collection for 2.2. You can follow several paths. Here are +possible scenarios for migration: +

  • You need to study and apply the new Windows NT printer +and driver support. Previously used parameters printer +driver file, printer driver and +printer driver location are no longer +supported.

  • If you want to take advantage of WinNT printer driver +support you also need to migrate the Win9x/ME drivers to the new +setup.

  • An existing printers.def file + (the one specified in the now removed parameter printer driver file) will work no longer with samba 3. In +3.0, smbd attempts to locate a Win9x/ME driver files for the printer +in [print$] and additional settings in the TDB +and only there; if it fails it will not (as 2.2.x +used to do) drop down to using a printers.def +(and all associated parameters). The make_printerdef tool is removed +and there is no backwards compatibility for this.

  • You need to install a Windows 9x driver into the +[print$] share for a printer on your Samba +host. The driver files will be stored in the "WIN40/0" subdirectory of +[print$], and some other settings and info go +into the printing-related TDBs.

  • If you want to migrate an existing +printers.def file into the new setup, the current +only solution is to use the Windows NT APW to install the NT drivers +and the 9x drivers. This can be scripted using smbclient and +rpcclient. See the Imprints installation client at: +

    + http://imprints.sourceforge.net/ +

    +for an example. See also the discussion of rpcclient usage in the +"CUPS Printing" section.

Publishing Printer Information in Active Directory or LDAP

+We will publish an update to this section shortly. +

Common Errors

I give my root password but I don't get access

+Don't confuse the root password which is valid for the UNIX system +(and in most cases stored in the form of a one-way hash in a file +named /etc/shadow) with the password used to +authenticate against Samba!. Samba doesn't know the UNIX password; for +root to access Samba resources via Samba-type access, a Samba account +for root must be created first. This is often done with the +smbpasswd command. +

My printjobs get spooled into the spooling directory, but then get lost

+Don't use the existing UNIX print system spool directory for the Samba +spool directory. It may seem convenient and a saving of space, but it +only leads to problems. The two must be separate. +

diff --git a/docs/htmldocs/problems.html b/docs/htmldocs/problems.html new file mode 100644 index 0000000000..24ddc7c02c --- /dev/null +++ b/docs/htmldocs/problems.html @@ -0,0 +1,138 @@ +Chapter 34. Analysing and solving samba problems

Chapter 34. Analysing and solving samba problems

Gerald (Jerry) Carter

Samba Team

Jelmer R. Vernooij

The Samba Team

David Bannon

Samba Team

8 Apr 2003

+There are many sources of information available in the form +of mailing lists, RFC's and documentation. The docs that come +with the samba distribution contain very good explanations of +general SMB topics such as browsing.

Diagnostics tools

With SMB networking, it is often not immediately clear what +the cause is of a certain problem. Samba itself provides rather +useful information, but in some cases you might have to fall back +to using a sniffer. A sniffer is a program that +listens on your LAN, analyses the data sent on it and displays it +on the screen.

Debugging with Samba itself

+One of the best diagnostic tools for debugging problems is Samba itself. +You can use the -d option for both smbd and nmbd to specify what +debug level at which to run. See the man pages on smbd, nmbd and +smb.conf for more information on debugging options. The debug +level can range from 1 (the default) to 10 (100 for debugging passwords). +

+Another helpful method of debugging is to compile samba using the +gcc -g flag. This will include debug +information in the binaries and allow you to attach gdb to the +running smbd / nmbd process. In order to attach gdb to an smbd +process for an NT workstation, first get the workstation to make the +connection. Pressing ctrl-alt-delete and going down to the domain box +is sufficient (at least, on the first time you join the domain) to +generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation +maintains an open connection, and therefore there will be an smbd +process running (assuming that you haven't set a really short smbd +idle timeout) So, in between pressing ctrl alt delete, and actually +typing in your password, you can attach gdb and continue. +

+Some useful samba commands worth investigating: +

+$ testparm | more
+$ smbclient -L //{netbios name of server}
+

Tcpdump

Tcpdump was the first +unix sniffer with SMB support. It is a command-line utility and +nowadays, it's SMB support is somewhat less then that of ethereal +and tethereal.

Ethereal

+Ethereal is a graphical +sniffer, available for both unix (Gtk) and Windows. Ethereal's +SMB support is very good.

For details on the use of ethereal, read the well-written +ethereal User Guide.

+Listen for data on ports 137, 138, 139 and 445. E.g. +use the filter port 137 or port 138 or port 139 or port 445.

A console version of ethereal is available as well and is called +tethereal.

The Windows Network Monitor

+For tracing things on the Microsoft Windows NT, Network Monitor +(aka. netmon) is available on the Microsoft Developer Network CD's, +the Windows NT Server install CD and the SMS CD's. The version of +netmon that ships with SMS allows for dumping packets between any two +computers (i.e. placing the network interface in promiscuous mode). +The version on the NT Server install CD will only allow monitoring +of network traffic directed to the local NT box and broadcasts on the +local subnet. Be aware that Ethereal can read and write netmon +formatted files. +

Installing 'Network Monitor' on an NT Workstation

+Installing netmon on an NT workstation requires a couple +of steps. The following are for installing Netmon V4.00.349, which comes +with Microsoft Windows NT Server 4.0, on Microsoft Windows NT +Workstation 4.0. The process should be similar for other versions of +Windows NT / Netmon. You will need both the Microsoft Windows +NT Server 4.0 Install CD and the Workstation 4.0 Install CD. +

+Initially you will need to install Network Monitor Tools and Agent +on the NT Server. To do this +

  • Goto Start - Settings - Control Panel - + Network - Services - Add

  • Select the Network Monitor Tools and Agent and + click on OK.

  • Click OK on the Network Control Panel. +

  • Insert the Windows NT Server 4.0 install CD + when prompted.

+At this point the Netmon files should exist in +%SYSTEMROOT%\System32\netmon\*.*. +Two subdirectories exist as well, parsers\ +which contains the necessary DLL's for parsing the netmon packet +dump, and captures\. +

+In order to install the Netmon tools on an NT Workstation, you will +first need to install the 'Network Monitor Agent' from the Workstation +install CD. +

  • Goto Start - Settings - Control Panel - + Network - Services - Add

  • Select the Network Monitor Agent and click + on OK.

  • Click OK on the Network Control Panel. +

  • Insert the Windows NT Workstation 4.0 install + CD when prompted.

+Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.* +to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set +permissions as you deem appropriate for your site. You will need +administrative rights on the NT box to run netmon. +

Installing 'Network Monitor' on an 9x Workstation

+To install Netmon on a Windows 9x box install the network monitor agent +from the Windows 9x CD (\admin\nettools\netmon). There is a readme +file located with the netmon driver files on the CD if you need +information on how to do this. Copy the files from a working +Netmon installation. +

Useful URLs

Getting help from the mailing lists

+There are a number of Samba related mailing lists. Go to http://samba.org, click on your nearest mirror +and then click on Support and then click on +Samba related mailing lists. +

+For questions relating to Samba TNG go to +http://www.samba-tng.org/ +It has been requested that you don't post questions about Samba-TNG to the +main stream Samba lists.

+If you post a message to one of the lists please observe the following guide lines : +

  • Always remember that the developers are volunteers, they are +not paid and they never guarantee to produce a particular feature at +a particular time. Any time lines are 'best guess' and nothing more. +

  • Always mention what version of samba you are using and what +operating system its running under. You should probably list the +relevant sections of your smb.conf file, at least the options +in [global] that affect PDC support.

  • In addition to the version, if you obtained Samba via +CVS mention the date when you last checked it out.

  • Try and make your question clear and brief, lots of long, +convoluted questions get deleted before they are completely read ! +Don't post html encoded messages (if you can select colour or font +size its html).

  • If you run one of those nifty 'I'm on holidays' things when +you are away, make sure its configured to not answer mailing lists. +

  • Don't cross post. Work out which is the best list to post to +and see what happens, i.e. don't post to both samba-ntdom and samba-technical. +Many people active on the lists subscribe to more +than one list and get annoyed to see the same message two or more times. +Often someone will see a message and thinking it would be better dealt +with on another, will forward it on for you.

  • You might include partial +log files written at a debug level set to as much as 20. +Please don't send the entire log but enough to give the context of the +error messages.

  • (Possibly) If you have a complete netmon trace ( from the opening of +the pipe to the error ) you can send the *.CAP file as well.

  • Please think carefully before attaching a document to an email. +Consider pasting the relevant parts into the body of the message. The samba +mailing lists go to a huge number of people, do they all need a copy of your +smb.conf in their attach directory?

How to get off the mailing lists

To have your name removed from a samba mailing list, go to the +same place you went to to get on it. Go to http://lists.samba.org, +click on your nearest mirror and then click on Support and +then click on Samba related mailing lists. +

+Please don't post messages to the list asking to be removed, you will just +be referred to the above address (unless that process failed in some way...) +

diff --git a/docs/htmldocs/rpcclient.1.html b/docs/htmldocs/rpcclient.1.html index e9f1afb0ed..73caf547a2 100644 --- a/docs/htmldocs/rpcclient.1.html +++ b/docs/htmldocs/rpcclient.1.html @@ -1,392 +1,105 @@ - - - %globalentities; - ]> - - - - rpcclient - 1 - - - - - rpcclient - tool for executing client side - MS-RPC functions - - - - - rpcclient - -A authfile - -c <command string> - -d debuglevel - -h - -l logfile - -N - -s <smb config file> - -U username[%password] - -W workgroup - -N - -I destinationIP - server - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - rpcclient is a utility initially developed +rpcclient

Name

rpcclient — tool for executing client side + MS-RPC functions

Synopsis

rpcclient [-A authfile] [-c <command string>] [-d debuglevel] [-h] [-l logfile] [-N] [-s <smb config file>] [-U username[%password]] [-W workgroup] [-N] [-I destinationIP] {server}

DESCRIPTION

This tool is part of the Samba(7) suite.

rpcclient is a utility initially developed to test MS-RPC functionality in Samba itself. It has undergone several stages of development and stability. Many system administrators have now written scripts around it to manage Windows NT clients from - their UNIX workstation. - - - - - OPTIONS - - - - server - NetBIOS name of Server to which to connect. + their UNIX workstation.

OPTIONS

server

NetBIOS name of Server to which to connect. The server can be any SMB/CIFS server. The name is - resolved using the name resolve ordername resolve order line from smb.conf - 5. - - - - - -c|--command='command string' - execute semicolon separated commands (listed - below)) - - - - - -I IP-address - IP address is the address of the server to connect to. - It should be specified in standard "a.b.c.d" notation. - - Normally the client would attempt to locate a named + resolved using the name resolve order line from smb.conf(5).

-c|--command='command string'

execute semicolon separated commands (listed + below))

-I IP-address

IP address is the address of the server to connect to. + It should be specified in standard "a.b.c.d" notation.

Normally the client would attempt to locate a named SMB/CIFS server by looking it up via the NetBIOS name resolution - mechanism described above in the name resolve order + mechanism described above in the name resolve order parameter above. Using this parameter will force the client to assume that the server is on the machine with the specified IP address and the NetBIOS name component of the resource being - connected to will be ignored. - - There is no default for this parameter. If not supplied, + connected to will be ignored.

There is no default for this parameter. If not supplied, it will be determined automatically by the client as described - above. - - - - - --V -Prints the version number for -smbd. - - - --s <configuration file> -The file specified contains the + above.

-V

Prints the version number for +smbd.

-s <configuration file>

The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - --d|--debug=debuglevel - -debuglevel is an integer +compile time.

-d|--debug=debuglevel

debuglevel is an integer from 0 to 10. The default value if this parameter is -not specified is zero. - -The higher this value, the more detail will be +not specified is zero.

The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of -information about operations carried out. - -Levels above 1 will generate considerable +information about operations carried out.

Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log -data, most of which is extremely cryptic. - -Note that specifying this parameter here will -override the log levellog level parameter -in the smb.conf file. - - - - --l|--logfile=logbasename -File name for log/debug files. The extension -".client" will be appended. The log file is +data, most of which is extremely cryptic.

Note that specifying this parameter here will +override the log level parameter +in the smb.conf file.

-l|--logfile=logbasename

File name for log/debug files. The extension +".client" will be appended. The log file is never removed by the client. - - - - - - --N -If specified, this parameter suppresses the normal +

-N

If specified, this parameter suppresses the normal password prompt from the client to the user. This is useful when -accessing a service that does not require a password. - -Unless a password is specified on the command line or +accessing a service that does not require a password.

Unless a password is specified on the command line or this parameter is specified, the client will request a -password. - - - --k - +password.

-k

Try to authenticate with kerberos. Only useful in an Active Directory environment. - - - - - --A|--authfile=filename -This option allows +

-A|--authfile=filename

This option allows you to specify a file from which to read the username and password used in the connection. The format of the file is - - - +

 username = <value>
 password = <value>
 domain   = <value>
-
-
-Make certain that the permissions on the file restrict 
-access from unwanted users. 
-
-
-
--U|--user=username[%password]
-Sets the SMB username or username and password. 
-
-If %password is not specified, the user will be prompted. The
-client will first check the USER environment variable, then the
-LOGNAME variable and if either exists, the
+

Make certain that the permissions on the file restrict +access from unwanted users.

-U|--user=username[%password]

Sets the SMB username or username and password.

If %password is not specified, the user will be prompted. The +client will first check the USER environment variable, then the +LOGNAME variable and if either exists, the string is uppercased. If these environmental variables are not -found, the username GUEST is used. - -A third option is to use a credentials file which +found, the username GUEST is used.

A third option is to use a credentials file which contains the plaintext of the username and password. This option is mainly provided for scripts where the admin does not wish to pass the credentials on the command line or via environment variables. If this method is used, make certain that the permissions on the file restrict access from unwanted users. See the --A for more details. - -Be cautious about including passwords in scripts. Also, on +-A for more details.

Be cautious about including passwords in scripts. Also, on many systems the command line of a running process may be seen -via the ps command. To be safe always allow -rpcclient to prompt for a password and type -it in directly. - - - - - - --n <primary NetBIOS name> -This option allows you to override +via the ps command. To be safe always allow +rpcclient to prompt for a password and type +it in directly.

-n <primary NetBIOS name>

This option allows you to override the NetBIOS name that Samba uses for itself. This is identical -to setting the netbios namenetbios name parameter in the smb.conf file. +to setting the netbios name parameter in the smb.conf file. However, a command line setting will take precedence over settings in -smb.conf. - - - --i <scope> -This specifies a NetBIOS scope that -nmblookup will use to communicate with when +smb.conf.

-i <scope>

This specifies a NetBIOS scope that +nmblookup will use to communicate with when generating NetBIOS names. For details on the use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes are -very rarely used, only set this parameter +very rarely used, only set this parameter if you are the system administrator in charge of all the -NetBIOS systems you communicate with. - - - --W|--workgroup=domain -Set the SMB domain of the username. This +NetBIOS systems you communicate with.

-W|--workgroup=domain

Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local -SAM (as opposed to the Domain SAM). - - - --O socket options -TCP socket options to set on the client +SAM (as opposed to the Domain SAM).

-O socket options

TCP socket options to set on the client socket. See the socket options parameter in -the smb.conf manual page for the list of valid -options. - - - - - --h|--help -Print a summary of command line options. - - - - - - - - COMMANDS - - - LSARPC - - - lsaqueryQuery info policy - - lookupsidsResolve a list +the smb.conf manual page for the list of valid +options.

-h|--help

Print a summary of command line options. +

COMMANDS

LSARPC

lsaquery

Query info policy

lookupsids

Resolve a list of SIDs to usernames. - - - lookupnamesResolve a list +

lookupnames

Resolve a list of usernames to SIDs. - - - enumtrustsEnumerate trusted domains - - enumprivsEnumerate privileges - - getdispnameGet the privilege name - - lsaenumsidEnumerate the LSA SIDS - - lsaenumprivsaccountEnumerate the privileges of an SID - - lsaenumacctrightsEnumerate the rights of an SID - - lsaenumacctwithrightEnumerate accounts with a right - - lsaaddacctrightsAdd rights to an account - - lsaremoveacctrightsRemove rights from an account - - lsalookupprivvalueGet a privilege value given its name - - lsaquerysecobjQuery LSA security object - - - - - - LSARPC-DS - - - dsroledominfoGet Primary Domain Information - - - - - DFS - - dfsexistQuery DFS support - dfsaddAdd a DFS share - dfsremoveRemove a DFS share - dfsgetinfoQuery DFS share info - dfsenumEnumerate dfs shares - - - - - - REG - - shutdownRemote Shutdown - abortshutdownAbort Shutdown - - - - - - SRVSVC - - - srvinfoServer query info - - netshareenumEnumerate shares - - netfileenumEnumerate open files - - netremotetodFetch remote time of day - - - - - - - SAMR - - - queryuserQuery user info - querygroupQuery group info - queryusergroupsQuery user groups - querygroupmemQuery group membership - queryaliasmemQuery alias membership - querydispinfoQuery display info - querydominfoQuery domain info - enumdomusersEnumerate domain users - enumdomgroupsEnumerate domain groups - enumalsgroupsEnumerate alias groups - createdomuserCreate domain user - samlookupnamesLook up names - samlookupridsLook up names - deletedomuserDelete domain user - samquerysecobjQuery SAMR security object - getdompwinfoRetrieve domain password info - lookupdomainLook up domain - - - - - - SPOOLSS - - - adddriver <arch> <config> - +

enumtrusts

Enumerate trusted domains

enumprivs

Enumerate privileges

getdispname

Get the privilege name

lsaenumsid

Enumerate the LSA SIDS

lsaenumprivsaccount

Enumerate the privileges of an SID

lsaenumacctrights

Enumerate the rights of an SID

lsaenumacctwithright

Enumerate accounts with a right

lsaaddacctrights

Add rights to an account

lsaremoveacctrights

Remove rights from an account

lsalookupprivvalue

Get a privilege value given its name

lsaquerysecobj

Query LSA security object

LSARPC-DS

dsroledominfo

Get Primary Domain Information

DFS

dfsexist

Query DFS support

dfsadd

Add a DFS share

dfsremove

Remove a DFS share

dfsgetinfo

Query DFS share info

dfsenum

Enumerate dfs shares

REG

shutdown

Remote Shutdown

abortshutdown

Abort Shutdown

SRVSVC

srvinfo

Server query info

netshareenum

Enumerate shares

netfileenum

Enumerate open files

netremotetod

Fetch remote time of day

SAMR

queryuser

Query user info

querygroup

Query group info

queryusergroups

Query user groups

querygroupmem

Query group membership

queryaliasmem

Query alias membership

querydispinfo

Query display info

querydominfo

Query domain info

enumdomusers

Enumerate domain users

enumdomgroups

Enumerate domain groups

enumalsgroups

Enumerate alias groups

createdomuser

Create domain user

samlookupnames

Look up names

samlookuprids

Look up names

deletedomuser

Delete domain user

samquerysecobj

Query SAMR security object

getdompwinfo

Retrieve domain password info

lookupdomain

Look up domain

SPOOLSS

adddriver <arch> <config>

Execute an AddPrinterDriver() RPC to install the printer driver information on the server. Note that the driver files should already exist in the directory returned by - getdriverdir. Possible values for - arch are the same as those for - the getdriverdir command. - The config parameter is defined as - follows: - - + getdriverdir. Possible values for + arch are the same as those for + the getdriverdir command. + The config parameter is defined as + follows:

 Long Printer Name:\
 Driver File Name:\
 Data File Name:\
@@ -395,239 +108,88 @@ Help File Name:\
 Language Monitor Name:\
 Default Data Type:\
 Comma Separated list of Files
-
-
-		Any empty fields should be enter as the string "NULL". 
-		
-		Samba does not need to support the concept of Print Monitors
+

Any empty fields should be enter as the string "NULL".

Samba does not need to support the concept of Print Monitors since these only apply to local printers whose driver can make use of a bi-directional link for communication. This field should be "NULL". On a remote NT print server, the Print Monitor for a driver must already be installed prior to adding the driver or - else the RPC will fail. - - addprinter <printername> - <sharename> <drivername> <port> - + else the RPC will fail.

addprinter <printername> + <sharename> <drivername> <port>

Add a printer on the remote server. This printer will be automatically shared. Be aware that the printer driver - must already be installed on the server (see adddriver) - and the portmust be a valid port name (see - enumports. - - - - deldriverDelete the + must already be installed on the server (see adddriver) + and the portmust be a valid port name (see + enumports.

deldriver

Delete the specified printer driver for all architectures. This does not delete the actual driver files from the server, only the entry from the server's list of drivers. - - - enumdataEnumerate all +

enumdata

Enumerate all printer setting data stored on the server. On Windows NT clients, these values are stored in the registry, while Samba servers store them in the printers TDB. This command corresponds to the MS Platform SDK GetPrinterData() function (* This - command is currently unimplemented). - - enumdataexEnumerate printer data for a key - - enumjobs <printer> - List the jobs and status of a given printer. + command is currently unimplemented).

enumdataex

Enumerate printer data for a key

enumjobs <printer>

List the jobs and status of a given printer. This command corresponds to the MS Platform SDK EnumJobs() - function - - enumkeyEnumerate - printer keys - - enumports [level] - + function

enumkey

Enumerate + printer keys

enumports [level]

Executes an EnumPorts() call using the specified info level. Currently only info levels 1 and 2 are supported. - - - - - enumdrivers [level] - +

enumdrivers [level]

Execute an EnumPrinterDrivers() call. This lists the various installed printer drivers for all architectures. Refer to the MS Platform SDK documentation for more details of the various flags and calling - options. Currently supported info levels are 1, 2, and 3. - - - - enumprinters [level] - Execute an EnumPrinters() call. This lists the various installed + options. Currently supported info levels are 1, 2, and 3.

enumprinters [level]

Execute an EnumPrinters() call. This lists the various installed and share printers. Refer to the MS Platform SDK documentation for more details of the various flags and calling options. Currently - supported info levels are 1, 2 and 5. - - - - - getdata <printername> <valuename;> - Retrieve the data for a given printer setting. See - the enumdata command for more information. + supported info levels are 1, 2 and 5.

getdata <printername> <valuename;>

Retrieve the data for a given printer setting. See + the enumdata command for more information. This command corresponds to the GetPrinterData() MS Platform - SDK function. - - getdataexGet + SDK function.

getdataex

Get printer driver data with - keyname - - - getdriver <printername> - + keyname

getdriver <printername>

Retrieve the printer driver information (such as driver file, config file, dependent files, etc...) for the given printer. This command corresponds to the GetPrinterDriver() MS Platform SDK function. Currently info level 1, 2, and 3 are supported. - - - - getdriverdir <arch> - +

getdriverdir <arch>

Execute a GetPrinterDriverDirectory() RPC to retrieve the SMB share name and subdirectory for storing printer driver files for a given architecture. Possible - values for arch are "Windows 4.0" + values for arch are "Windows 4.0" (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows - Alpha_AXP", and "Windows NT R4000". - - - - getprinter <printername> - Retrieve the current printer information. This command + Alpha_AXP", and "Windows NT R4000".

getprinter <printername>

Retrieve the current printer information. This command corresponds to the GetPrinter() MS Platform SDK function. - - - getprintprocdirGet +

getprintprocdir

Get print processor - directory - - openprinter <printername> - Execute an OpenPrinterEx() and ClosePrinter() RPC - against a given printer. - - setdriver <printername> - <drivername> - Execute a SetPrinter() command to update the printer driver + directory

openprinter <printername>

Execute an OpenPrinterEx() and ClosePrinter() RPC + against a given printer.

setdriver <printername> + <drivername>

Execute a SetPrinter() command to update the printer driver associated with an installed printer. The printer driver must - already be correctly installed on the print server. - - See also the enumprinters and - enumdrivers commands for obtaining a list of - of installed printers and drivers. - - addformAdd form - setformSet form - getformGet form - deleteformDelete form - enumformsEnumerate form - setprinterSet printer comment - setprinterdataSet REG_SZ printer data - rffpcnexRffpcnex test - - - - - - - - NETLOGON - - - - logonctrl2 - Logon Control 2 - - - logonctrl - Logon Control - - - samsync - Sam Synchronisation - - - samdeltas - Query Sam Deltas - - - samlogon - Sam Logon - - - - - - - GENERAL COMMANDS - - - debuglevelSet the current - debug level used to log information. - - help (?)Print a listing of all + already be correctly installed on the print server.

See also the enumprinters and + enumdrivers commands for obtaining a list of + of installed printers and drivers.

addform

Add form

setform

Set form

getform

Get form

deleteform

Delete form

enumforms

Enumerate form

setprinter

Set printer comment

setprinterdata

Set REG_SZ printer data

rffpcnex

Rffpcnex test

NETLOGON

logonctrl2

Logon Control 2

logonctrl

Logon Control

samsync

Sam Synchronisation

samdeltas

Query Sam Deltas

samlogon

Sam Logon

GENERAL COMMANDS

debuglevel

Set the current + debug level used to log information.

help (?)

Print a listing of all known commands or extended help on a particular command. - - - quit (exit)Exit rpcclient - . - - - - - - - BUGS - - rpcclient is designed as a developer testing tool +

quit (exit)

Exit rpcclient + .

BUGS

rpcclient is designed as a developer testing tool and may not be robust in certain areas (such as command line parsing). It has been known to generate a core dump upon failures when invalid - parameters where passed to the interpreter. - - From Luke Leighton's original rpcclient man page: - - WARNING! The MSRPC over SMB code has + parameters where passed to the interpreter.

From Luke Leighton's original rpcclient man page:

WARNING! The MSRPC over SMB code has been developed from examining Network traces. No documentation is available from the original creators (Microsoft) on how MSRPC over SMB works, or how the individual MSRPC services work. Microsoft's implementation of these services has been demonstrated (and reported) - to be... a bit flaky in places. - - The development of Samba's implementation is also a bit rough, + to be... a bit flaky in places.

The development of Samba's implementation is also a bit rough, and as more of the services are understood, it can even result in - versions of smbd - 8 and rpcclient - 1 that are incompatible for some commands or services. Additionally, + versions of smbd(8) and rpcclient(1) that are incompatible for some commands or services. Additionally, the developers are sending reports to Microsoft, and problems found or reported to Microsoft are fixed in Service Packs, which may - result in incompatibilities. - - - - - VERSION - - This man page is correct for version 3.0 of the Samba - suite. - - - - AUTHOR - - The original Samba software and related utilities + result in incompatibilities.

VERSION

This man page is correct for version 3.0 of the Samba + suite.

AUTHOR

The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original rpcclient man page was written by Matthew + to the way the Linux kernel is developed.

The original rpcclient man page was written by Matthew Geddes, Luke Kenneth Casson Leighton, and rewritten by Gerald Carter. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was - done by Alexander Bokovoy. - - - + done by Alexander Bokovoy.

diff --git a/docs/htmldocs/samba-bdc.html b/docs/htmldocs/samba-bdc.html new file mode 100644 index 0000000000..c3be7504e2 --- /dev/null +++ b/docs/htmldocs/samba-bdc.html @@ -0,0 +1,260 @@ +Chapter 6. Backup Domain Control

Chapter 6. Backup Domain Control

John H. Terpstra

Samba Team

Volker Lendecke

+Before you continue reading in this section, please make sure that you are comfortable +with configuring a Samba Domain Controller as described in chapter on setting up Samba as a PDC. +

Features And Benefits

+This is one of the most difficult chapters to summarise. It does not matter what we say here +for someone will still draw conclusions and / or approach the Samba-Team with expectations +that are either not yet capable of being delivered, or that can be achieved far more +effectively using a totally different approach. In the event that you should have a persistent +concern that is not addressed in this book then please email +John H Terpstra clearly setting out your requirements +and / or question and we will do our best to provide a solution. +

+Samba-3 is capable of acting as a Backup Domain Controller to another Samba Primary Domain +Controller. A Samba-3 PDC can operate with an LDAP Account backend. The LDAP backend can be +either a common master LDAP server, or a slave server. The use of a slave LDAP server has the +benefit that when the master is down clients may still be able to log onto the network. +This effectively gives samba a high degree of scalability iand is a very sweet (nice) solution +for large organisations. +

+While it is possible to run a Samba-3 BDC with non-LDAP backend, the administrator will +need to figure out precisely what is the best way to replicate (copy / distribute) the +user and machine Accounts backend. +

+The use of a non-LDAP backend SAM database is particularly problematic because Domain member +servers and workstations periodically change the machine trust account password. The new +password is then stored only locally. This means that in the absence of a centrally stored +accounts database (such as that provided with an LDAP based solution) if Samba-3 is running +as a BDC, the BDC instance of the Domain member trust account password will not reach the +PDC (master) copy of the SAM. If the PDC SAM is then replicated to BDCs this results in +overwriting of the SAM that contains the updated (changed) trust account password with resulting +breakage of the domain trust. +

+Considering the number of comments and questions raised concerning how to configure a BDC +lets consider each possible option and look at the pro's and con's for each theoretical solution: +

Backup Domain Backend Account Distribution Options

  • + Solution: Passwd Backend is LDAP based, BDCs use a slave LDAP server +

    + Arguments For: This is a neat and manageable solution. The LDAP based SAM (ldapsam) + is constantly kept up to date. +

    + Arguments Against: Complexity +

  • + Passdb Backend is tdbsam based, BDCs use cron based net rpc vampire to + obtain the Accounts database from the PDC and place them into the Samba SAM. + net rpc vampire is a Samba function of the "net" command. +

    + Arguments For: It would be a nice solution +

    + Arguments Against: It does not work because Samba-3 does not support the required + protocols. This may become a later feature but is not available today. +

  • + Make use of rsync to replicate (pull down) copies of the essential account files +

    + Arguments For: It is a simple solution, easy to set up as a scheduled job +

    + Arguments Against: This will over-write the locally changed machine trust account + passwords. This is a broken and flawed solution. Do NOT do this. +

  • + Operate with an entirely local accounts database (not recommended) +

    + Arguments For: Simple, easy to maintain +

    + Arguments Against: All machine trust accounts and user accounts will be locally + maintained. Domain users will NOT be able to roam from office to office. This is + a broken and flawed solution. Do NOT do this. +

Essential Background Information

+A Domain Controller is a machine that is able to answer logon requests from network +workstations. Microsoft LanManager and IBM LanServer were two early products that +provided this capability. The technology has become known as the LanMan Netlogon service. +

+When MS Windows NT3.10 was first released, it supported an new style of Domain Control +and with it a new form of the network logon service that has extended functionality. +This service became known as the NT NetLogon Service. The nature of this service has +changed with the evolution of MS Windows NT and today provides a very complex array of +services that are implemented over a complex spectrum of technologies. +

MS Windows NT4 Style Domain Control

+Whenever a user logs into a Windows NT4 / 200x / XP Professional Workstation, +the workstation connects to a Domain Controller (authentication server) to validate +the username and password that the user entered are valid. If the information entered +does not validate against the account information that has been stored in the Domain +Control database (the SAM, or Security Account Manager database) then a set of error +codes is returned to the workstation that has made the authentication request. +

+When the username / password pair has been validated, the Domain Controller +(authentication server) will respond with full enumeration of the account information +that has been stored regarding that user in the User and Machine Accounts database +for that Domain. This information contains a complete network access profile for +the user but excludes any information that is particular to the user's desktop profile, +or for that matter it excludes all desktop profiles for groups that the user may +belong to. It does include password time limits, password uniqueness controls, +network access time limits, account validity information, machine names from which the +user may access the network, and much more. All this information was stored in the SAM +in all versions of MS Windows NT (3.10, 3.50, 3.51, 4.0). +

+The account information (user and machine) on Domain Controllers is stored in two files, +one containing the Security information and the other the SAM. These are stored in files +by the same name in the C:\WinNT\System32\config directory. These +are the files that are involved in replication of the SAM database where Backup Domain +Controllers are present on the network. +

+There are two situations in which it is desirable to install Backup Domain Controllers: +

  • + On the local network that the Primary Domain Controller is on, if there are many + workstations and/or where the PDC is generally very busy. In this case the BDCs + will pick up network logon requests and help to add robustness to network services. +

  • + At each remote site, to reduce wide area network traffic and to add stability to + remote network operations. The design of the network, the strategic placement of + Backup Domain Controllers, together with an implementation that localises as much + of network to client interchange as possible will help to minimise wide area network + bandwidth needs (and thus costs). +

+The PDC contains the master copy of the SAM. In the event that an administrator makes a +change to the user account database while physically present on the local network that +has the PDC, the change will likely be made directly to the PDC instance of the master +copy of the SAM. In the event that this update may be performed in a branch office the +change will likely be stored in a delta file on the local BDC. The BDC will then send +a trigger to the PDC to commence the process of SAM synchronisation. The PDC will then +request the delta from the BDC and apply it to the master SAM. The PDC will then contact +all the BDCs in the Domain and trigger them to obtain the update and then apply that to +their own copy of the SAM. +

+Thus the BDC is said to hold a read-only of the SAM from which +it is able to process network logon requests and to authenticate users. The BDC can +continue to provide this service, particularly while, for example, the wide area +network link to the PDC is down. Thus a BDC plays a very important role in both +maintenance of Domain security as well as in network integrity. +

+In the event that the PDC should need to be taken out of service, or if it dies, then +one of the BDCs can be promoted to a PDC. If this happens while the original PDC is on +line then it is automatically demoted to a BDC. This is an important aspect of Domain +Controller management. The tool that is used to affect a promotion or a demotion is the +Server Manager for Domains. +

Example PDC Configuration

+Since version 2.2 Samba officially supports domain logons for all current Windows Clients, +including Windows NT4, 2003 and XP Professional. For samba to be enabled as a PDC some +parameters in the [global]-section of the smb.conf have to be set: +

Example 6.1. Minimal smb.conf for being a PDC

workgroup = MIDEARTH
domain master = yes
domain logons = yes

+Several other things like a [homes] and a +[netlogon] share also need to be set along with +settings for the profile path, the users home drive, etc.. This will not be covered in this +chapter, for more information please refer to the chapter about samba as a PDC. +

Active Directory Domain Control

+As of the release of MS Windows 2000 and Active Directory, this information is now stored +in a directory that can be replicated and for which partial or full administrative control +can be delegated. Samba-3 is NOT able to be a Domain Controller within an Active Directory +tree, and it can not be an Active Directory server. This means that Samba-3 also can NOT +act as a Backup Domain Controller to an Active Directory Domain Controller. +

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 by broadcast on the local network. +The PDC also registers the unique NetBIOS name SAMBA<#1b> with the WINS server. +The name type <#1b> name is normally reserved for the Domain Master Browser, a role +that has nothing to do with anything related to authentication, but the Microsoft Domain +implementation requires the domain master browser to be on the same machine as the PDC. +

How does a Workstation find its domain controller?

+An MS Windows NT4 / 200x / XP Professional workstation in the domain SAMBA that wants a +local user to be authenticated has to find the domain controller for SAMBA. It does this +by doing a NetBIOS name query for the group name SAMBA<#1c>. It assumes that each +of the machines it gets back from the queries is a domain controller and can answer logon +requests. To not open security holes both the workstation and the selected domain controller +authenticate each other. After that the workstation sends the user's credentials (name and +password) to the local Domain Controller, for validation. +

Backup Domain Controller Configuration

+Several things have to be done: +

  • + The domain SID has to be the same on the PDC and the BDC. This used to + be stored in the file private/MACHINE.SID. This file is not created + since Samba 2.2.5. Nowadays the domain SID is stored in the file + private/secrets.tdb. Simply copying the secrets.tdb + from the PDC to the BDC does not work, as the BDC would + generate a new SID for itself and override the domain SID with this + new BDC SID.

    + To retrieve the domain SID from the PDC or an existing BDC and store it in the + secrets.tdb, execute: +

    +root# net rpc getsid
    +
  • + The UNIX user database has to be synchronized from the PDC to the + BDC. This means that both the /etc/passwd and /etc/group have to be + replicated from the PDC to the BDC. This can be done manually + whenever changes are made, or the PDC is set up as a NIS master + server and the BDC as a NIS slave server. To set up the BDC as a + mere NIS client would not be enough, as the BDC would not be able to + access its user database in case of a PDC failure. NIS is by no means + the only method to synchronize passwords. An LDAP solution would work + as well. +

  • + The Samba password database has to be replicated from the PDC to the BDC. + As said above, though possible to synchronise the smbpasswd + file with rsync and ssh, this method is broken and flawed, and is + therefore not recommended. A better solution is to set up slave LDAP + servers for each BDC and a master LDAP server for the PDC. +

  • + Any netlogon share has to be replicated from the PDC to the + BDC. This can be done manually whenever login scripts are changed, + or it can be done automatically together with the smbpasswd + synchronization. +

Example Configuration

+Finally, the BDC has to be found by the workstations. This can be done by setting: +

Example 6.2. Minimal setup for being a BDC

workgroup = MIDEARTH
domain master = no
domain logons = yes
idmap backend = ldapsam://slave-ldap.quenya.org

+In the [global]-section of the smb.conf of the BDC. This makes the BDC +only register the name SAMBA<#1c> with the WINS server. This is no +problem as the name SAMBA<#1c> is a NetBIOS group name that is meant to +be registered by more than one machine. The parameter +domain master = no +forces the BDC not to register SAMBA<#1b> which as a unique NetBIOS +name is reserved for the Primary Domain Controller. +

+The idmap backend will redirect the winbindd utility to +use the LDAP database to resolve all UIDs and GIDs for UNIX accounts. +

Note

+Samba-3 has introduced a new ID mapping facility. One of the features of this facility is that it +allows greater flexibility in how user and group IDs are handled in respect of NT Domain User and Group +SIDs. One of the new facilities provides for explicitly ensuring that UNIX / Linux UID and GID values +will be consistent on the PDC, all BDCs and all Domain Member servers. The parameter that controls this +is called idmap backend. Please refer to the man page for smb.conf for more information +regarding it's behaviour. Do NOT set this parameter except where an LDAP backend (ldapsam) is in use. +

Common Errors

+As this is a rather new area for Samba there are not many examples that we may refer to. Keep +watching for updates to this section. +

Machine Accounts keep expiring, what can I do?

+This problem will occur when occur when the passdb (SAM) files are copied from a central +server but the local Backup Domain Controllers. Local machine trust account password updates +are not copied back to the central server. The newer machine account password is then over +written when the SAM is copied from the PDC. The result is that the Domain member machine +on start up will find that it's passwords does not match the one now in the database and +since the startup security check will now fail, this machine will not allow logon attempts +to proceed and the account expiry error will be reported. +

+The solution: use a more robust passdb backend, such as the ldapsam backend, setting up +an slave LDAP server for each BDC, and a master LDAP server for the PDC. +

Can Samba be a Backup Domain Controller to an NT4 PDC?

+With version 2.2, no. The native NT4 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 Samba-3. +

+Can I get the benefits of a BDC with Samba? Yes, but only to a Samba PDC. 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 +service logon requests whenever the PDC is down. +

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 done in the smbpasswd file and +has to be replicated to the BDC. So replicating the smbpasswd file very often is necessary. +

+As the smbpasswd file contains plain text password equivalents, it must not be +sent unencrypted over the wire. The best way to set up smbpasswd replication from +the PDC to the BDC is to use the utility 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. +

+As said a few times before, use of this method is broken and flawed. Machine trust +accounts will go out of sync, resulting in a very broken domain. This method is +not recommended. Try using LDAP instead. +

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). +

diff --git a/docs/htmldocs/samba-pdc.html b/docs/htmldocs/samba-pdc.html new file mode 100644 index 0000000000..aab2d4207c --- /dev/null +++ b/docs/htmldocs/samba-pdc.html @@ -0,0 +1,510 @@ +Chapter 5. Domain Control

Chapter 5. Domain Control

John H. Terpstra

Samba Team

Gerald (Jerry) Carter

Samba Team

David Bannon

Samba Team

The Essence of Learning:  +There are many who approach MS Windows networking with incredible misconceptions. +That's OK, because it gives the rest of us plenty of opportunity to be of assistance. +Those who really want help would be well advised to become familiar with information +that is already available. +

+The reader is advised NOT to tackle this section without having first understood +and mastered some basics. MS Windows networking is not particularly forgiving of +misconfiguration. Users of MS Windows networking are likely to complain +of persistent niggles that may be caused by a broken network configuration. +To a great many people however, MS Windows networking starts with a domain controller +that in some magical way is expected to solve all ills. +

Figure 5.1. An Example Domain

An Example Domain

+From the Samba mailing list one can readily identify many common networking issues. +If you are not clear on the following subjects, then it will do much good to read the +sections of this HOWTO that deal with it. These are the most common causes of MS Windows +networking problems: +

  • Basic TCP/IP configuration

  • NetBIOS name resolution

  • Authentication configuration

  • User and Group configuration

  • Basic File and Directory Permission Control in UNIX/Linux

  • Understanding of how MS Windows clients interoperate in a network + environment

+Do not be put off; on the surface of it MS Windows networking seems so simple that anyone +can do it. In fact, it is not a good idea to set up an MS Windows network with +inadequate training and preparation. But let's get our first indelible principle out of the +way: It is perfectly OK to make mistakes! In the right place and at +the right time, mistakes are the essence of learning. It is very much +not ok to make mistakes that cause loss of productivity and impose an avoidable financial +burden on an organisation. +

+Where is the right place to make mistakes? Only out of harm's way! If you are going to +make mistakes, then please do this on a test network, away from users and in such a way as +to not inflict pain on others. Do your learning on a test network. +

Features and Benefits

+What is the key benefit of Microsoft Domain security? +

+In a word, Single Sign On, or SSO for short. To many, this is the holy +grail of MS Windows NT and beyond networking. SSO allows users in a well designed network +to log onto any workstation that is a member of the domain that their user account is in +(or in a domain that has an appropriate trust relationship with the domain they are visiting) +and they will be able to log onto the network and access resources (shares, files, and printers) +as if they are sitting at their home (personal) workstation. This is a feature of the Domain +security protocols. +

+The benefits of Domain security are available to those sites that deploy a Samba PDC. +A Domain provides a unique network security identifier (SID). Domain user and group security +identifiers are comprised of the network SID plus a relative identifier (RID) that is unique to +the account. User and Group SIDs (the network SID plus the RID) can be used to create Access Control +Lists (ACLs) attached to network resources to provide organizational access control. UNIX systems +know only of local security identifiers. +

Note

+Network clients of an MS Windows Domain security environment must be Domain members to be +able to gain access to the advanced features provided. Domain membership involves more than just +setting the workgroup name to the Domain name. It requires the creation of a Domain trust account +for the workstation (called a machine account). Please refer to the chapter on +setting up samba as a domain member for more information. +

+The following functionalities are new to the Samba-3 release: +

  • + Windows NT4 domain trusts +

  • + Adding users via the User Manager for Domains. This can be done on any MS Windows + client using the Nexus toolkit that is available from Microsoft's web site. + Samba-3 supports the use of the Microsoft Management Console for user management. +

  • + Introduces replaceable and multiple user account (authentication) + back ends. In the case where the back end is placed in an LDAP database, + Samba-3 confers the benefits of a back end that can be distributed, replicated, + and is highly scalable. +

  • + Implements full Unicode support. This simplifies cross locale internationalisation + support. It also opens up the use of protocols that Samba-2.2.x had but could not use due + to the need to fully support Unicode. +

+The following functionalities are NOT provided by Samba-3: +

  • + SAM replication with Windows NT4 Domain Controllers + (i.e. a Samba PDC and a Windows NT BDC or vice versa). This means samba + cannot operate as a BDC when the PDC is Microsoft-based or + replicate account data to Windows-BDC's. +

  • + Acting as a Windows 2000 Domain Controller (i.e. Kerberos and + Active Directory) - In point of fact, Samba-3 DOES have some + Active Directory Domain Control ability that is at this time + purely experimental AND that is certain + to change as it becomes a fully supported feature some time + during the Samba-3 (or later) life cycle. However, Active Directory is + more then just SMB - it's also LDAP, Kerberos, DHCP and other protocols + (with proprietary extensions, of course). +

+Windows 9x / Me / XP Home clients are not true members of a domain for reasons outlined +in this chapter. The protocol for support of Windows 9x / Me style network (domain) logons +is completely different from NT4 / Win2k type domain logons and has been officially supported +for some time. These clients use the old LanMan Network Logon facilities that are supported +in Samba since approximately the Samba-1.9.15 series. +

+Samba-3 has an implementation of group mapping between Windows NT groups +and UNIX groups (this is really quite complicated to explain in a short space). This is +discussed more fully in the chapter on group mapping. +

+Samba-3, like an MS Windows NT4 PDC or a Windows 200x Active Directory, needs to store +user and machine trust account information in a suitable backend data store. +Refer to the section on machine trust accounts. With Samba-3 there can be multiple +back-ends for this. A complete discussion of account database backends can be found in +the chapter on Account Information Databases. +

Basics of Domain Control

+Over the years, public perceptions of what Domain Control really is has taken on an +almost mystical nature. Before we branch into a brief overview of Domain Control, +there are three basic types of domain controllers: +

Domain Controller Types

  • Primary Domain Controller

  • Backup Domain Controller

  • ADS Domain Controller

+The Primary Domain Controller or PDC plays an important role in the MS +Windows NT4. In Windows 200x Domain Control architecture this role is held by domain controllers. +There is folk lore that dictates that because of it's role in the MS Windows +network, the domain controllers should be the most powerful and most capable machine in the network. +As strange as it may seem to say this here, good over all network performance dictates that +the entire infrastructure needs to be balanced. It is advisable to invest more in Stand-Alone +(or Domain Member) servers than in the domain controllers. +

+In the case of MS Windows NT4 style domains, it is the PDC that initiates a new Domain Control database. +This forms a part of the Windows registry called the SAM (Security Account Manager). It plays a key +part in NT4 type domain user authentication and in synchronisation of the domain authentication +database with Backup Domain Controllers. +

+With MS Windows 200x Server based Active Directory domains, one domain controller initiates a potential +hierarchy of domain controllers, each with their own area of delegated control. The master domain +controller has the ability to override any down-stream controller, but a down-line controller has +control only over it's down-line. With Samba-3 this functionality can be implemented using an +LDAP based user and machine account back end. +

+New to Samba-3 is the ability to use a back-end database that holds the same type of data as +the NT4 style SAM (Security Account Manager) database (one of the registry files). +[1] +

+The Backup Domain Controller or BDC plays a key role in servicing network +authentication requests. The BDC is biased to answer logon requests in preference to the PDC. +On a network segment that has a BDC and a PDC the BDC will be most likely to service network +logon requests. The PDC will answer network logon requests when the BDC is too busy (high load). +A BDC can be promoted to a PDC. If the PDC is on line at the time that a BDC is promoted to +PDC, the previous PDC is automatically demoted to a BDC. With Samba-3 this is NOT an automatic +operation; the PDC and BDC must be manually configured and changes need to be made likewise. +

+With MS Windows NT4, it is an install time decision what type of machine the server will be. +It is possible to change the promote a BDC to a PDC and vice versa only, but the only way +to convert a domain controller to a domain member server or a stand-alone server is to +reinstall it. The install time choices offered are: +

  • Primary Domain Controller - The one that seeds the domain SAM

  • Backup Domain Controller - One that obtains a copy of the domain SAM

  • Domain Member Server - One that has NO copy of the domain SAM, rather it obtains authentication from a Domain Controller for all access controls.

  • Stand-Alone Server - One that plays NO part is SAM synchronisation, has it's own authentication database and plays no role in Domain security.

+With MS Windows 2000 the configuration of domain control is done after the server has been +installed. Samba-3 is capable of acting fully as a native member of a Windows 200x server +Active Directory domain. +

+New to Samba-3 is the ability to function fully as an MS Windows NT4 style Domain Controller, +excluding the SAM replication components. However, please be aware that Samba-3 support the +MS Windows 200x domain control protocols also. +

+At this time any appearance that Samba-3 is capable of acting as an +Domain Controller in native ADS mode is limited and experimental in nature. +This functionality should not be used until the Samba-Team offers formal support for it. +At such a time, the documentation will be revised to duly reflect all configuration and +management requirements. Samba can act as a NT4-style DC in a Windows 2000/XP +environment. However, there are certain compromises: + +

  • No machine policy files

  • No Group Policy Objects

  • No synchronously executed AD logon scripts

  • Can't use ANY Active Directory management tools to manage users and machines

  • Registry changes tattoo the main registry, while with AD they do NOT. ie: Leave permanent changes in effect

  • Without AD you can not peprform the function of exporting specific applications to specific users or groups

+

Preparing for Domain Control

+There are two ways that MS Windows machines may interact with each other, with other servers, +and with Domain Controllers: Either as Stand-Alone systems, more commonly +called Workgroup members, or as full participants in a security system, +more commonly called Domain members. +

+It should be noted that Workgroup membership involve no special configuration +other than the machine being configured so that the network configuration has a commonly used name +for it's workgroup entry. It is not uncommon for the name WORKGROUP to be used for this. With this +mode of configuration there are NO machine trust accounts and any concept of membership as such +is limited to the fact that all machines appear in the network neighbourhood to be logically +grouped together. Again, just to be clear: workgroup mode does not involve any security machine +accounts. +

+Domain member machines have a machine account in the Domain accounts database. A special procedure +must be followed on each machine to affect Domain membership. This procedure, which can be done +only by the local machine Administrator account, will create the Domain machine account (if +if does not exist), and then initializes that account. When the client first logs onto the +Domain it triggers a machine password change. +

Note

+When running a Domain all MS Windows NT / 200x / XP Professional clients should be configured +as full Domain Members - IF A SECURE NETWORK IS WANTED. If the machine is NOT made a member of the +Domain, then it will operate like a workgroup (stand-alone) machine. Please refer to +the chapter on domain membership for information regarding HOW to make your MS Windows clients Domain members. +

+The following are necessary for configuring Samba-3 as an MS Windows NT4 style PDC for MS Windows +NT4 / 200x / XP clients. +

  • Configuration of basic TCP/IP and MS Windows Networking

  • Correct designation of the Server Role (security = user)

  • Consistent configuration of Name Resolution (See chapter on Network Browsing and on + Integrating Unix into Windows networks)

  • Domain logons for Windows NT4 / 200x / XP Professional clients

  • Configuration of Roaming Profiles or explicit configuration to force local profile usage

  • Configuration of Network/System Policies

  • Adding and managing domain user accounts

  • Configuring MS Windows client machines to become domain members

+The following provisions are required to serve MS Windows 9x / Me Clients: +

  • Configuration of basic TCP/IP and MS Windows Networking

  • Correct designation of the Server Role (security = user)

  • Network Logon Configuration (Since Windows 9x / XP Home are not technically domain + members, they do not really participate in the security aspects of Domain logons as such)

  • Roaming Profile Configuration

  • Configuration of System Policy handling

  • Installation of the Network driver "Client for MS Windows Networks" and configuration + to log onto the domain

  • Placing Windows 9x / Me clients in user level security - if it is desired to allow + all client share access to be controlled according to domain user / group identities.

  • Adding and managing domain user accounts

Note

+Roaming Profiles and System/Network policies are advanced network administration topics +that are covered in the Profile Management and +Policy Management chapters of this document. However, these are not +necessarily specific to a Samba PDC as much as they are related to Windows NT networking concepts. +

+A Domain Controller is an SMB/CIFS server that: +

  • + Registers and advertises itself as a Domain Controller (through NetBIOS broadcasts + as well as by way of name registrations either by Mailslot Broadcasts over UDP broadcast, + to a WINS server over UDP unicast, or via DNS and Active Directory) +

  • + Provides the NETLOGON service (actually a collection of services that runs over + a number of protocols. These include the LanMan Logon service, the Netlogon service, + the Local Security Account service, and variations of them) +

  • + Provides a share called NETLOGON +

+For Samba to provide these is rather easy to configure. Each Samba Domain Controller must provide +the NETLOGON service which Samba calls the domain logons functionality +(after the name of the parameter in the smb.conf file). Additionally, one (1) server in a Samba-3 +Domain must advertise itself as the domain master browser[2]. This causes the Primary Domain Controller +to claim domain specific NetBIOS name that identifies it as a domain master browser for its given +domain/workgroup. Local master browsers in the same domain/workgroup on broadcast-isolated subnets +then ask for a complete copy of the browse list for the whole wide area network. Browser clients +will then contact their local master browser, and will receive the domain-wide browse list, +instead of just the list for their broadcast-isolated subnet. +

Domain Control - Example Configuration

+The first step in creating a working Samba PDC is to understand the parameters necessary +in smb.conf. An example smb.conf for acting as a PDC can be found in the example +for being a PDC. +

+

Example 5.1. smb.conf for being a PDC

[global]
netbios name = BELERIAND
workgroup = MIDEARTH
passdb backend = ldapsam, guest
os level = 33
preferred master = yes
domain master = yes
local master = yes
security = user
encrypt passwords = yes
domain logons = yes
logon path = \\%N\profiles\%u
logon drive = H:
logon home = \\homeserver\%u\winprofile
logon script = logon.cmd
[netlogon]
path = /var/lib/samba/netlogon
read only = yes
write list = ntadmin
[profiles]
path = /var/lib/samba/profiles
read only = no
create mask = 0600
directory mask = 0700

+

+The basic options shown above are explained as follows: +

passdb backend

+ This contains all the user and group account information. Acceptable values for a PDC + are: smbpasswd, tdbsam, ldapsam. The 'guest' entry provides needed + default accounts.

+ Where is is intended to use backup domain controllers (BDCs) the only logical choice is + to use LDAP so that the passdb backend can be distributed. The tdbsam and smbpasswd files + can not effectively be distributed and therefore should not be used. +

Domain Control Parameters

+ The parameters os level, preferred master, domain master, security, + encrypt passwords, domain logons play a central role in assuring domain + control and network logon support.

+ The os level must be set at or above a value of 32. A domain controller + must be the domain master browser, must be set in user mode security, + must support Microsoft compatible encrypted passwords, and must provide the network logon + service (domain logons). Encrypted passwords must be enabled, for more details on how + to do this, refer to the chapter on account information databases. +

Environment Parameters

+ The parameters logon path, logon home, logon drive, logon script are + environment support settings that help to facilitate client logon operations and that help + to provide automated control facilities to ease network management overheads. Please refer + to the man page information for these parameters. +

NETLOGON Share

+ The NETLOGON share plays a central role in domain logon and domain membership support. + This share is provided on all Microsoft domain controllers. It is used to provide logon + scripts, to store Group Policy files (NTConfig.POL), as well as to locate other common + tools that may be needed for logon processing. This is an essential share on a domain controller. +

PROFILE Share

+ This share is used to store user desktop profiles. Eash user must have a directory at the root + of this share. This directory must be write enabled for the user and must be globally read enabled. + Samba-3 has a VFS module called 'fake_permissions' that may be installed on this share. This will + allow a Samba administrator to make the directory read only to everyone. Of course this is useful + only after the profile has been properly created. +

Note

+The above parameters make for a full set of parameters that may define the server's mode +of operation. The following smb.conf parameters are the essentials alone: +

+

netbios name = BELERIAND
workgroup = MIDEARTH
domain logons = Yes
domain master = Yes
security = User

+

+The additional parameters shown in the longer listing above just makes for +more complete explanation. +

Samba ADS Domain Control

+Samba-3 is not, and can not act as, an Active Directory Server. It can not truly function as +an Active Directory Primary Domain Controller. The protocols for some of the functionality +the Active Directory Domain Controllers has been partially implemented on an experimental +only basis. Please do NOT expect Samba-3 to support these protocols. Do not depend +on any such functionality either now or in the future. The Samba-Team may remove these +experimental features or may change their behaviour. This is mentioned for the benefit of those +who have discovered secret capabilities in samba-3 and who have asked when this functionality will be +completed. The answer is: Maybe or maybe never! +

+To be sure: Samba-3 is designed to provide most of the functionality that Microsoft Windows NT4 style +domain controllers have. Samba-3 does NOT have all the capabilities of Windows NT4, but it does have +a number of features that Windows NT4 domain contollers do not have. In short, Samba-3 is not NT4 and it +is not Windows Server 200x and it is not an Active Directory server. We hope this is plain and simple +enough for all to understand. +

Domain and Network Logon Configuration

+The subject of Network or Domain Logons is discussed here because it forms +an integral part of the essential functionality that is provided by a Domain Controller. +

Domain Network Logon Service

+All Domain Controllers must run the netlogon service (domain logons +in Samba). One Domain Controller must be configured with domain master = Yes +(the Primary Domain Controller); on ALL Backup Domain Controllers domain master = No +must be set. +

Example Configuration

Example 5.2. smb.conf for being a PDC

[global]
domain logons = Yes
domain master = (Yes on PDC, No on BDCs)
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
guest ok = Yes
browseable = No

The Special Case of MS Windows XP Home Edition

Note

+MS Windows XP Home Edition does not have the ability to join any type of Domain +security facility. Unlike, MS Windows 9x / Me, MS Windows XP Home Edition also completely +lacks the ability to log onto a network. +

+To be completely clear: If you want MS Windows XP Home Edition to integrate with your +MS Windows NT4 or Active Directory Domain security understand - IT CAN NOT BE DONE. +Your only choice is to buy the upgrade pack from MS Windows XP Home Edition to +MS Windows XP Professional. +

+Now that this has been said, please do NOT ask the mailing list, or email any of the +Samba-Team members with your questions asking how to make this work. It can't be done. +If it can be done, then to do so would violate your software license agreement with +Microsoft, and we recommend that you do not do that. +

The Special Case of Windows 9x / Me

+A domain and a workgroup are exactly the same in terms of network +browsing. The difference is that a distributable authentication +database is associated with a domain, for secure login access to a +network. Also, different access rights can be granted to users if they +successfully authenticate against a domain logon server. Samba-3 does this +now in the same way that MS Windows NT/2K. +

+The SMB client logging on to a domain has an expectation that every other +server in the domain should accept the same authentication information. +Network browsing functionality of domains and workgroups is identical and +is explained in this documentation under the browsing discussions. +It should be noted, that browsing is totally orthogonal to logon support. +

+Issues related to the single-logon network model are discussed in this +section. Samba supports domain logons, network logon scripts, and user +profiles for MS Windows for workgroups and MS Windows 9X/ME clients +which are the focus of this section. +

+When an SMB client in a domain wishes to logon, it broadcasts requests for a +logon server. The first one to reply gets the job, and validates its +password using whatever mechanism the Samba administrator has installed. +It is possible (but ill advised ) to create a domain where the user +database is not shared between servers, i.e. they are effectively workgroup +servers advertising themselves as participating in a domain. This +demonstrates how authentication is quite different from but closely +involved with domains. +

+Using these features you can make your clients verify their logon via +the Samba server; make clients run a batch file when they logon to +the network and download their preferences, desktop and start menu. +

+MS Windows XP Home edition is NOT able to join a domain and does not permit +the use of domain logons. +

+Before launching into the configuration instructions, it is +worthwhile to look at how a Windows 9x/ME client performs a logon: +

  1. + 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 + 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. +

  2. + The client then connects to that server, logs on (does an SMBsessetupX) and + then connects to the IPC$ share (using an SMBtconX). +

  3. + The client then does a NetWkstaUserLogon request, which retrieves the name + of the user's logon script. +

  4. + The client then connects to the NetLogon share and searches for said script + and if it is found and can be read, is retrieved and executed by the client. + After this, the client disconnects from the NetLogon share. +

  5. + The client then sends a NetUserGetInfo request to the server, to retrieve + the user's home share, which is used to search for profiles. Since the + response to the NetUserGetInfo request does not contain much more than + the user's home share, profiles for Win9X clients MUST reside in the user + home directory. +

  6. + The client then connects to the user's home share and searches for the + user's profile. As it turns out, you can specify the user's home share as + a sharename and path. For example, \\server\fred\.winprofile. + If the profiles are found, they are implemented. +

  7. + The client then disconnects from the user's home share, and reconnects to + the NetLogon share and looks for CONFIG.POL, the policies file. If this is + found, it is read and implemented. +

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

  • + Password encryption is not required for a Windows 9x logon server. But note + that beginning with MS Windows 98 the default setting is that plain-text + password support is disabled. It can be re-enabled with the registry + changes that are documented in the chapter on Policies. +

  • + Windows 9x/ME clients do not require and do not use machine trust accounts. +

+A Samba PDC will act as a Windows 9x logon server; after all, it does provide the +network logon services that MS Windows 9x / Me expect to find. +

Note

+Use of plain-text passwords is strongly discouraged. Where used they are easily detected +using a sniffer tool to examine network traffic. +

Security Mode and Master Browsers

+There are a few comments to make in order to tie up some +loose ends. There has been much debate over the issue of whether +or not it is ok to configure Samba as a Domain Controller in security +modes other than USER. The only security mode +which will not work due to technical reasons is SHARE +mode security. DOMAIN and SERVER +mode security are really just a variation on SMB user level security. +

+Actually, this issue is also closely tied to the debate on whether +or not Samba must be the domain master browser for its workgroup +when operating as a DC. While it may technically be possible +to configure a server as such (after all, browsing and domain logons +are two distinctly different functions), it is not a good idea to do +so. You should remember that the DC must register the DOMAIN<#1b> NetBIOS +name. This is the name used by Windows clients to locate the DC. +Windows clients do not distinguish between the DC and the DMB. +A DMB is a Domain Master Browser - see Domain Master Browser. +For this reason, it is very wise to configure the Samba DC as the DMB. +

+Now back to the issue of configuring a Samba DC to use a mode other +than security = user. If a Samba host is configured to use +another SMB server or DC in order to validate user connection +requests, then it is a fact that some other machine on the network +(the password server) knows more about the user than the Samba host. +99% of the time, this other host is a domain controller. Now +in order to operate in domain mode security, the workgroup parameter +must be set to the name of the Windows NT domain (which already +has a domain controller). If the domain does NOT already have a Domain Controller +then you do not yet have a Domain! +

+Configuring a Samba box as a DC for a domain that already by definition has a +PDC is asking for trouble. Therefore, you should always configure the Samba DC +to be the DMB for its domain and set security = user. +This is the only officially supported mode of operation. +

Common Errors

'$' cannot be included in machine name

+A 'machine account', (typically) stored in /etc/passwd, +takes the form of the machine name with a '$' appended. FreeBSD (and other BSD +systems?) won't create a user with a '$' in their name. +

+The problem is only in the program used to make the entry. Once made, it works perfectly. +Create a user without the '$'. Then use vipw to edit the entry, adding +the '$'. Or create the whole entry with vipw if you like; make sure you use a unique User ID! +

Note

+The UNIX tool vipw is a common tool for directly editting the /etc/passwd file. +

Joining domain fails because of existing machine account

I get told "You already have a connection to the Domain...." +or "Cannot join domain, the credentials supplied conflict with an +existing set.." when creating a machine trust account.

+This happens if you try to create a machine trust account from the +machine itself and already have a connection (e.g. mapped drive) +to a share (or IPC$) on the Samba PDC. The following command +will remove all network drive connections: +

+C:\> net use * /d
+

+Further, if the machine is already a 'member of a workgroup' that +is the same name as the domain you are joining (bad idea) you will +get this message. Change the workgroup name to something else, it +does not matter what, reboot, and try again. +

The system can not log you on (C000019B)....

I joined the domain successfully but after upgrading +to a newer version of the Samba code I get the message, The system +can not log you on (C000019B), Please try again or consult your +system administrator when attempting to logon.” +

+This occurs when the domain SID stored in the secrets.tdb database +is changed. The most common cause of a change in domain SID is when +the domain name and/or the server name (NetBIOS name) is changed. +The only way to correct the problem is to restore the original domain +SID or remove the domain client from the domain and rejoin. The domain +SID may be reset using either the net or rpcclient utilities. +

+The reset or change the domain SID you can use the net command as follows: + +

+root# net getlocalsid 'OLDNAME'
+root# net setlocalsid 'SID'
+

+

+Workstation machine trust accounts work only with the Domain (or network) SID. If this SID changes +then domain members (workstations) will not be able to log onto the domain. The original Domain SID +can be recovered from the secrets.tdb file. The alternative is to visit each workstation to re-join +it to the domain. +

The machine trust account not accessible

+ “When I try to join the domain I get the message The machine account +for this computer either does not exist or is not accessible. What's +wrong?” +

+This problem is caused by the PDC not having a suitable machine trust account. +If you are using the add machine script method to create +accounts then this would indicate that it has not worked. Ensure the domain +admin user system is working. +

+Alternatively if you are creating account entries manually then they +have not been created correctly. Make sure that you have the entry +correct for the machine trust account in smbpasswd file on the Samba PDC. +If you added the account using an editor rather than using the smbpasswd +utility, make sure that the account name is the machine NetBIOS name +with a '$' appended to it ( i.e. computer_name$ ). There must be an entry +in both /etc/passwd and the smbpasswd file. +

+Some people have also reported +that inconsistent subnet masks between the Samba server and the NT +client can cause this problem. Make sure that these are consistent +for both client and server. +

Account disabled

When I attempt to login to a Samba Domain from a NT4/W2K workstation, + I get a message about my account being disabled.

+Enable the user accounts with smbpasswd -e username +, this is normally done as an account is created. +

Domain Controller Unavailable

Until a few minutes after Samba has started, clients get the error "Domain Controller Unavailable"

+ A domain controller has to announce on the network who it is. This usually takes a while. +

Can not log onto domain member workstation after joining domain

After successfully joining the domain user logons fail with one of two messages:

One to the effect that the domain controller can not be found, the other claiming that the + account does not exist in the domain or that the password is incorrect.

This may be due to incompatible settings between + the Windows client and the Samba-3 server for schannel (secure channel) settings + or smb signing settings. Check your samba settings for + client schannel, server schannel, client signing, server signing by executing: + testparm -v | more and looking for the value of these parameters. +

+ Also use the Microsoft Management Console - Local Security Settings. This tool is available from the + Control Panel. The Policy settings are found in the Local Policies / Securty Options area and are prefixed by + Secure Channel: ..., and Digitally sign .... +

+ It is important that these be set consistently with the Samba-3 server settings. +

diff --git a/docs/htmldocs/samba.7.html b/docs/htmldocs/samba.7.html index e5380131e1..222bdee995 100644 --- a/docs/htmldocs/samba.7.html +++ b/docs/htmldocs/samba.7.html @@ -1,371 +1,113 @@ - - - %globalentities; - ]> - - - - samba - 7 - - - - - samba - A Windows SMB/CIFS fileserver for UNIX - - - - Samba - - - - DESCRIPTION - - The Samba software suite is a collection of programs +samba

Name

samba — A Windows SMB/CIFS fileserver for UNIX

Synopsis

Samba

DESCRIPTION

The Samba software suite is a collection of programs that implements the Server Message Block (commonly abbreviated as SMB) protocol for UNIX systems. This protocol is sometimes also referred to as the Common Internet File System (CIFS). For a - more thorough description, see - http://www.ubiqx.org/cifs/. Samba also implements the NetBIOS - protocol in nmbd. - - - - smbd - 8 - The smbd daemon provides the file and print services to + more thorough description, see + http://www.ubiqx.org/cifs/. Samba also implements the NetBIOS + protocol in nmbd.

smbd(8)

The smbd daemon provides the file and print services to SMB clients, such as Windows 95/98, Windows NT, Windows for Workgroups or LanManager. The configuration file - for this daemon is described in smb.conf - 5 - - - - - nmbd - 8 - The nmbd + for this daemon is described in smb.conf(5) +

nmbd(8)

The nmbd daemon provides NetBIOS nameservice and browsing support. The configuration file for this daemon - is described in smb.conf - 5 - - - - - smbclient - 1 - The smbclient + is described in smb.conf(5)

smbclient(1)

The smbclient program implements a simple ftp-like client. This is useful for accessing SMB shares on other compatible servers (such as Windows NT), and can also be used to allow a UNIX box to print to a printer attached to - any SMB server (such as a PC running Windows NT). - - - - - testparm - 1 - The testparm - utility is a simple syntax checker for Samba's smb.conf - 5 configuration file. - - - - - testprns - 1 - The testprns + any SMB server (such as a PC running Windows NT).

testparm(1)

The testparm + utility is a simple syntax checker for Samba's smb.conf(5) configuration file.

testprns(1)

The testprns utility supports testing printer names defined - in your printcap file used - by Samba. - - - - - smbstatus - 1 - The smbstatus + in your printcap file used + by Samba.

smbstatus(1)

The smbstatus tool provides access to information about the - current connections to smbd. - - - - - nmblookup - 1 - The nmblookup + current connections to smbd.

nmblookup(1)

The nmblookup tools allows NetBIOS name queries to be made - from a UNIX host. - - - - - smbgroupedit - 8 - The smbgroupedit + from a UNIX host.

smbgroupedit(8)

The smbgroupedit tool allows for mapping unix groups to NT Builtin, Domain, or Local groups. Also it allows setting - priviledges for that group, such as saAddUser, etc. - - - - - smbpasswd - 8 - The smbpasswd + priviledges for that group, such as saAddUser, etc.

smbpasswd(8)

The smbpasswd command is a tool for changing LanMan and Windows NT - password hashes on Samba and Windows NT servers. - - - - - smbcacls - 1 - The smbcacls command is - a tool to set ACL's on remote CIFS servers. - - - - - smbsh - 1 - The smbsh command is + password hashes on Samba and Windows NT servers.

smbcacls(1)

The smbcacls command is + a tool to set ACL's on remote CIFS servers.

smbsh(1)

The smbsh command is a program that allows you to run a unix shell with - with an overloaded VFS. - - - - smbtree - 1 - The smbtree command - is a text-based network neighborhood tool. - - - - smbtar - 1 - The smbtar can make - backups of data on CIFS/SMB servers. - - - - smbspool - 8 - smbspool is a + with an overloaded VFS.

smbtree(1)

The smbtree command + is a text-based network neighborhood tool.

smbtar(1)

The smbtar can make + backups of data on CIFS/SMB servers.

smbspool(8)

smbspool is a helper utility for printing on printers connected - to CIFS servers. - - - - smbcontrol - 1 - smbcontrol is a utility + to CIFS servers.

smbcontrol(1)

smbcontrol is a utility that can change the behaviour of running samba daemons. - - - - - rpcclient - 1 - rpcclient is a utility +

rpcclient(1)

rpcclient is a utility that can be used to execute RPC commands on remote - CIFS servers. - - - - pdbedit - 8 - The pdbedit command + CIFS servers.

pdbedit(8)

The pdbedit command can be used to maintain the local user database on - a samba server. - - - findsmb - 1 - The findsmb command + a samba server.

findsmb(1)

The findsmb command can be used to find SMB servers on the local network. - - - - net - 8 - The net command +

net(8)

The net command is supposed to work similar to the DOS/Windows - NET.EXE command. - - - - swat - 8 - swat is a web-based - interface to configuring smb.conf. - - - - - winbindd - 8 - winbindd is a daemon + NET.EXE command.

swat(8)

swat is a web-based + interface to configuring smb.conf. +

winbindd(8)

winbindd is a daemon that is used for integrating authentication and - the user database into unix. - - - - wbinfo - 1 - wbinfo is a utility + the user database into unix.

wbinfo(1)

wbinfo is a utility that retrieves and stores information related to winbind. - - - - - editreg - 1 - editreg is a command-line +

editreg(1)

editreg is a command-line utility that can edit windows registry files. - - - - - profiles - 1 - profiles is a command-line +

profiles(1)

profiles is a command-line utility that can be used to replace all occurences of a certain SID with another SID. - - - - - vfstest - 1 - vfstest is a utility - that can be used to test vfs modules. - - - - ntlm_auth - 1 - ntlm_auth is a helper-utility +

vfstest(1)

vfstest is a utility + that can be used to test vfs modules.

ntlm_auth(1)

ntlm_auth is a helper-utility for external programs wanting to do NTLM-authentication. - - - - smbmount - 8, smbumount8, smbmount8 - smbmount,smbmnt and smbmnt are commands that can be used to +

smbmount(8), smbumount(8), smbmount(8)

smbmount,smbmnt and smbmnt are commands that can be used to mount CIFS/SMB shares on Linux. - - - - - smbcquotas - 1 - smbcquotas is a tool that - can set remote QUOTA's on server with NTFS 5. - - - - - - - COMPONENTS - - The Samba suite is made up of several components. Each +

smbcquotas(1)

smbcquotas is a tool that + can set remote QUOTA's on server with NTFS 5.

COMPONENTS

The Samba suite is made up of several components. Each component is described in a separate manual page. It is strongly recommended that you read the documentation that comes with Samba and the manual pages of those components that you use. If the manual pages and documents aren't clear enough then please visit - http://devel.samba.org - for information on how to file a bug report or submit a patch. - - If you require help, visit the Samba webpage at - http://www.samba.org/ and + http://devel.samba.org + for information on how to file a bug report or submit a patch.

If you require help, visit the Samba webpage at + http://www.samba.org/ and explore the many option available to you. - - - - - AVAILABILITY - - The Samba software suite is licensed under the +

AVAILABILITY

The Samba software suite is licensed under the GNU Public License(GPL). A copy of that license should have come with the package in the file COPYING. You are encouraged to distribute copies of the Samba suite, but - please obey the terms of this license. - - The latest version of the Samba suite can be + please obey the terms of this license.

The latest version of the Samba suite can be obtained via anonymous ftp from samba.org in the directory pub/samba/. It is also available on several - mirror sites worldwide. - - You may also find useful information about Samba - on the newsgroup - comp.protocol.smb and the Samba mailing + mirror sites worldwide.

You may also find useful information about Samba + on the newsgroup + comp.protocol.smb and the Samba mailing list. Details on how to join the mailing list are given in - the README file that comes with Samba. - - If you have access to a WWW viewer (such as Mozilla + the README file that comes with Samba.

If you have access to a WWW viewer (such as Mozilla or Konqueror) then you will also find lots of useful information, including back issues of the Samba mailing list, at - http://lists.samba.org. - - - - VERSION - - This man page is correct for version 3.0 of the - Samba suite. - - - - CONTRIBUTIONS - - If you wish to contribute to the Samba project, + http://lists.samba.org.

VERSION

This man page is correct for version 3.0 of the + Samba suite.

CONTRIBUTIONS

If you wish to contribute to the Samba project, then I suggest you join the Samba mailing list at - http://lists.samba.org. - - - If you have patches to submit, visit - http://devel.samba.org/ + http://lists.samba.org. +

If you have patches to submit, visit + http://devel.samba.org/ for information on how to do it properly. We prefer patches - in diff -u format. - - - - CONTRIBUTORS - - Contributors to the project are now too numerous + in diff -u format.

CONTRIBUTORS

Contributors to the project are now too numerous to mention here but all deserve the thanks of all Samba users. To see a full list, look at the - change-log in the source package - for the pre-CVS changes and at - http://cvs.samba.org/ + change-log in the source package + for the pre-CVS changes and at + http://cvs.samba.org/ for the contributors to Samba post-CVS. CVS is the Open Source source code control system used by the Samba Team to develop - Samba. The project would have been unmanageable without it. - - - - AUTHOR - - The original Samba software and related utilities + Samba. The project would have been unmanageable without it.

AUTHOR

The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML - 4.2 for Samba 3.0 was done by Alexander Bokovoy. - - - + 4.2 for Samba 3.0 was done by Alexander Bokovoy.

diff --git a/docs/htmldocs/securing-samba.html b/docs/htmldocs/securing-samba.html new file mode 100644 index 0000000000..492780765e --- /dev/null +++ b/docs/htmldocs/securing-samba.html @@ -0,0 +1,192 @@ +Chapter 15. Securing Samba

Chapter 15. Securing Samba

Andrew Tridgell

Samba Team

John H. Terpstra

Samba Team

May 26, 2003

Introduction

+This note was attached to the Samba 2.2.8 release notes as it contained an +important security fix. The information contained here applies to Samba +installations in general. +

+A new apprentice reported for duty to the Chief Engineer of a boiler house. He said, "Here I am, +if you will show me the boiler I'll start working on it." Then engineer replied, "You're leaning +on it!" +

+Security concerns are just like that: You need to know a little about the subject to appreciate +how obvious most of it really is. The challenge for most of us is to discover that first morsel +of knowledge with which we may unlock the secrets of the masters. +

Features and Benefits

+There are three level at which security principals must be observed in order to render a site +at least moderately secure. These are: the perimeter firewall, the configuration of the host +server that is running Samba, and Samba itself. +

+Samba permits a most flexible approach to network security. As far as possible Samba implements +the latest protocols to permit more secure MS Windows file and print operations. +

+Samba may be secured from connections that originate from outside the local network. This may be +done using host based protection (using samba's implementation of a technology +known as "tcpwrappers", or it may be done be using interface based exclusion +so that smbd will bind only to specifically permitted interfaces. It is also +possible to set specific share or resource based exclusions, eg: on the [IPC$] +auto-share. The [IPC$] share is used for browsing purposes as well as to establish +TCP/IP connections. +

+Another method by which Samba may be secured is by way of setting Access Control Entries in an Access +Control List on the shares themselves. This is discussed in the chapter on File, Directory and Share Access +Control. +

Technical Discussion of Protective Measures and Issues

+The key challenge of security is the fact that protective measures suffice at best +only to close the door on known exploits and breach techniques. Never assume that +because you have followed these few measures that the Samba server is now an impenetrable +fortress! Given the history of information systems so far, it is only a matter of time +before someone will find yet another vulnerability. +

Using host based protection

+ In many installations of Samba the greatest threat comes for outside + your immediate network. By default Samba will accept connections from + any host, which means that if you run an insecure version of Samba on + a host that is directly connected to the Internet you can be + especially vulnerable. +

+ One of the simplest fixes in this case is to use the hosts allow and + hosts deny options in the Samba smb.conf configuration file to only + allow access to your server from a specific range of hosts. An example + might be: +

hosts allow = 127.0.0.1 192.168.2.0/24 192.168.3.0/24
hosts deny = 0.0.0.0/0

+ The above will only allow SMB connections from 'localhost' (your own + computer) and from the two private networks 192.168.2 and + 192.168.3. All other connections will be refused as soon + as the client sends its first packet. The refusal will be marked as a + not listening on called name error. +

User based protection

+ If you want to restrict access to your server to valid users only then the following + method may be of use. In the smb.conf [global] section put: +

valid users = @smbusers, jacko

+ What this does is, it restricts all server access to either the user jacko + or to members of the system group smbusers. +

Using interface protection

+ By default Samba will accept connections on any network interface that + it finds on your system. That means if you have a ISDN line or a PPP + connection to the Internet then Samba will accept connections on those + links. This may not be what you want. +

+ You can change this behaviour using options like the following: +

interfaces = eth* lo
bind interfaces only = yes

+ This tells Samba to only listen for connections on interfaces with a + name starting with 'eth' such as eth0, eth1, plus on the loopback + interface called 'lo'. The name you will need to use depends on what + OS you are using, in the above I used the common name for Ethernet + adapters on Linux. +

+ If you use the above and someone tries to make a SMB connection to + your host over a PPP interface called 'ppp0' then they will get a TCP + connection refused reply. In that case no Samba code is run at all as + the operating system has been told not to pass connections from that + interface to any samba process. +

Using a firewall

+ Many people use a firewall to deny access to services that they don't + want exposed outside their network. This can be a very good idea, + although I would recommend using it in conjunction with the above + methods so that you are protected even if your firewall is not active + for some reason. +

+ If you are setting up a firewall then you need to know what TCP and + UDP ports to allow and block. Samba uses the following: +

UDP/137 - used by nmbd
UDP/138 - used by nmbd
TCP/139 - used by smbd
TCP/445 - used by smbd

+ The last one is important as many older firewall setups may not be + aware of it, given that this port was only added to the protocol in + recent years. +

Using a IPC$ share deny

+ If the above methods are not suitable, then you could also place a + more specific deny on the IPC$ share that is used in the recently + discovered security hole. This allows you to offer access to other + shares while denying access to IPC$ from potentially untrustworthy + hosts. +

+ To do that you could use: +

[ipc$]
hosts allow = 192.168.115.0/24 127.0.0.1
hosts deny = 0.0.0.0/0

+ this would tell Samba that IPC$ connections are not allowed from + anywhere but the two listed places (localhost and a local + subnet). Connections to other shares would still be allowed. As the + IPC$ share is the only share that is always accessible anonymously + this provides some level of protection against attackers that do not + know a username/password for your host. +

+ If you use this method then clients will be given a access denied + reply when they try to access the IPC$ share. That means that those + clients will not be able to browse shares, and may also be unable to + access some other resources. +

+ This is not recommended unless you cannot use one of the other + methods listed above for some reason. +

NTLMv2 Security

+ To configure NTLMv2 authentication the following registry keys are worth knowing about: +

+

+		[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
+		"lmcompatibilitylevel"=dword:00000003
+		

+

+ 0x3 - Send NTLMv2 response only. Clients will use NTLMv2 authentication, + use NTLMv2 session security if the server supports it. Domain + controllers accept LM, NTLM and NTLMv2 authentication. +

+

+		[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0]
+		"NtlmMinClientSec"=dword:00080000
+		

+

+ 0x80000 - NTLMv2 session security. If either NtlmMinClientSec or + NtlmMinServerSec is set to 0x80000, the connection will fail if NTLMv2 + session security is not negotiated. +

Upgrading Samba

+Please check regularly on http://www.samba.org/ for updates and +important announcements. Occasionally security releases are made and +it is highly recommended to upgrade Samba when a security vulnerability +is discovered. Check with your OS vendor for OS specific upgrades. +

Common Errors

+If all of samba and host platform configuration were really as intuitive as one might like then this +section would not be necessary. Security issues are often vexing for a support person to resolve, not +because of the complexity of the problem, but for reason that most administrators who post what turns +out to be a security problem request are totally convinced that the problem is with Samba. +

Smbclient works on localhost, but the network is dead

+ This is a very common problem. Red Hat Linux (as do others) will install a default firewall. + With the default firewall in place only traffic on the loopback adapter (IP address 127.0.0.1) + will be allowed through the firewall. +

+ The solution is either to remove the firewall (stop it) or to modify the firewall script to + allow SMB networking traffic through. See section above in this chapter. +

Why can users access home directories of other users?

+ “ + We are unable to keep individual users from mapping to any other user's + home directory once they have supplied a valid password! They only need + to enter their own password. I have not found *any* method that I can + use to configure samba to enforce that only a user may map their own + home directory. + ” +

+ User xyzzy can map his home directory. Once mapped user xyzzy can also map + *anyone* else's home directory! +

+ This is not a security flaw, it is by design. Samba allows + users to have *exactly* the same access to the UNIX filesystem + as they would if they were logged onto the UNIX box, except + that it only allows such views onto the file system as are + allowed by the defined shares. +

+ This means that if your UNIX home directories are set up + such that one user can happily cd into another users + directory and do an ls, the UNIX security solution is to + change the UNIX file permissions on the users home directories + such that the cd and ls would be denied. +

+ Samba tries very hard not to second guess the UNIX administrators + security policies, and trusts the UNIX admin to set + the policies and permissions he or she desires. +

+ Samba does allow the setup you require when you have set the + only user = yes option on the share, is that you have not set the + valid users list for the share. +

+ Note that only user works in conjunction with the users= list, + so to get the behavior you require, add the line : +

users = %S

+ this is equivalent to: +

valid users = %S

+ to the definition of the [homes] share, as recommended in + the smb.conf man page. +

diff --git a/docs/htmldocs/smb.conf.5.html b/docs/htmldocs/smb.conf.5.html index 4928d41048..926d8fcbb4 100644 --- a/docs/htmldocs/smb.conf.5.html +++ b/docs/htmldocs/smb.conf.5.html @@ -244,8 +244,8 @@ alias|alias|alias|alias... connection is made as the username given in the "guest account =" for the service, irrespective of the supplied password.

COMPLETE LIST OF GLOBAL PARAMETERS

Here is a list of all global parameters. See the section of - each parameter for details. Note that some are synonyms.

COMPLETE LIST OF SERVICE PARAMETERS

Here is a list of all service parameters. See the section on - each parameter for details. Note that some are synonyms.

EXPLANATION OF EACH PARAMETER

abort shutdown script (G)

This parameter only exists in the HEAD cvs branch + each parameter for details. Note that some are synonyms.

COMPLETE LIST OF SERVICE PARAMETERS

Here is a list of all service parameters. See the section on + each parameter for details. Note that some are synonyms.

EXPLANATION OF EACH PARAMETER

abort shutdown script (G)

This parameter only exists in the HEAD cvs branch This a full path name to a script called by smbd(8) that should stop a shutdown procedure issued by the shutdown script.

This command will be run as user.

Default: None.

Example: abort shutdown script = /sbin/shutdown -c

add group script (G)

This is the full pathname to a script that will be run @@ -322,7 +322,7 @@ alias|alias|alias|alias... created for all users accessing files on this server. For sites that use Windows NT account databases as their primary user database creating these users and keeping the user list in sync with the - Windows NT PDC is an onerous task. This option allows smbd to create the required UNIX users + Windows NT PDC is an onerous task. This option allows smbd to create the required UNIX users ON DEMAND when a user accesses the Samba server.

In order to use this option, smbd(8) must NOT be set to security = share and add user script must be set to a full pathname for a script that will create a UNIX @@ -367,7 +367,7 @@ alias|alias|alias|alias... security option is set to server or domain. If it is set to no, then attempts to connect to a resource from - a domain or workgroup other than the one which smbd is running + a domain or workgroup other than the one which smbd is running in will fail, even if that domain is trusted by the remote server doing the authentication.

This is useful if you only want your Samba server to serve resources to users in the domain it is a member of. As @@ -525,6 +525,9 @@ alias|alias|alias|alias... responses, and not the weaker LM or NTLM.

Default : client ntlmv2 auth = no

client use spnego (G)

This variable controls controls whether samba clients will try to use Simple and Protected NEGOciation (as specified by rfc2478) with WindowsXP and Windows2000 servers to agree upon an authentication mechanism. + SPNEGO client support for SMB Signing is currently broken, so + you might want to turn this option off when operating with + Windows 2003 domain controllers in particular.

Default: client use spnego = yes

comment (S)

This is a text field that is seen next to a share when a client does a queries the server, either via the network neighborhood or via net view to list what shares @@ -1049,12 +1052,18 @@ df $1 | tail -1 | awk '{print $2" "$4}' for a share. The default type is NTFS for compatibility with Windows NT but this can be changed to other strings such as Samba or FAT - if required.

Default: fstype = NTFS

Example: fstype = Samba

getwd cache (G)

This is a tuning option. When this is enabled a + if required.

Default: fstype = NTFS

Example: fstype = Samba

get quota command (G)

The get quota command should only be used + whenever there is no operating system API available from the OS that + samba can use.

This parameter should specify the path to a script that + queries the quota information for the specified + user/group for the partition that + the specified directory is on.

Such a script should take 3 arguments:

  • directory

  • type of query

  • uid of user or gid of group

The type of query can be one of :

  • 1 - user quotas

  • 2 - user default quotas (uid = -1)

  • 3 - group quotas

  • 4 - group default quotas (gid = -1)

This script should print its output according to the following format:

  • Line 1 - quota flags (0 = no quotas, 1 = quotas enabled, 2 = quotas enabled and enforced)

  • Line 2 - number of currently used blocks

  • Line 3 - the softlimit number of blocks

  • Line 4 - the hardlimit number of blocks

  • Line 5 - currently used number of inodes

  • Line 6 - the softlimit number of inodes

  • Line 7 - the hardlimit number of inodes

  • Line 8(optional) - the number of bytes in a block(default is 1024)

See also the set quota command parameter. +

Default: get quota command =

Example: get quota command = /usr/local/sbin/query_quota

getwd cache (G)

This is a tuning option. When this is enabled a caching algorithm will be used to reduce the time taken for getwd() calls. This can have a significant impact on performance, especially when the wide links parameter is set to no.

Default: getwd cache = yes

group (S)

Synonym for - force group.

guest account (G)

This is a username which will be used for access + force group.

guest account (G,S)

This is a username which will be used for access to services which are specified as guest ok (see below). Whatever privileges this user has will be available to any client connecting to the guest service. @@ -1062,7 +1071,7 @@ df $1 | tail -1 | awk '{print $2" "$4}' have a valid login. The user account "ftp" is often a good choice for this parameter. If a username is specified in a given service, the specified username overrides this one. -

On some systems the default guest account "nobody" may not +

One some systems the default guest account "nobody" may not be able to print. Use another account in this case. You should test this by trying to log in as your guest user (perhaps by using the su - command) and trying to print using the @@ -1117,12 +1126,14 @@ df $1 | tail -1 | awk '{print $2" "$4}' automounter) maps.

Note

A working NIS client is required on the system for this option to work.

See also nis homedir , domain logons - .

Default: homedir map = <empty string>

Example: homedir map = amd.homedir

host msdfs (G)

If set to yes, + .

Default: homedir map = <empty string>

Example: homedir map = amd.homedir

host msdfs (G)

This boolean parameter is only available + if Samba has been configured and compiled with the + --with-msdfs option. If set to yes, Samba will act as a Dfs server, and allow Dfs-aware clients to browse Dfs trees hosted on the server.

See also the msdfs root share level parameter. For more information on setting up a Dfs tree on Samba, - refer to msdfs_setup.html. + refer to ???.

Default: host msdfs = no

hostname lookups (G)

Specifies whether samba should use (expensive) hostname lookups or use the ip addresses instead. An example place where hostname lookups are currently used is when checking @@ -1169,7 +1180,7 @@ df $1 | tail -1 | awk '{print $2" "$4}' to SID mappings. This avoids the risk of UID / GID inconsistencies across UNIX / Linux systems that are sharing information over protocols other than SMB/CIFS (ie: NFS).

Default: idmap backend = <empty string>

Example: idmap backend = ldapsam://ldapslave.example.com

idmap gid (G)

The idmap gid parameter specifies the range of group ids that are allocated for - the purpose of mapping UNIX groups to NT group SIDs. This range of group ids should have no + the purpose of mapping UNX groups to NT group SIDs. This range of group ids should have no existing local or NIS groups within it as strange conflicts can occur otherwise.

The availability of an idmap gid range is essential for correct operation of all group mapping.

Default: idmap gid = <empty string>

Example: idmap gid = 10000-20000

idmap uid (G)

The idmap uid parameter specifies the range of user ids that are allocated for use in mapping UNIX users to NT user SIDs. This range of ids should have no existing local @@ -1469,8 +1480,8 @@ df $1 | tail -1 | awk '{print $2" "$4}' suggested command would be to add NET TIME \\SERVER /SET /YES, to force every machine to synchronize clocks with the same time server. Another use would be to add NET USE - U: \\SERVER\UTILS for commonly used utilities, or - NET USE Q: \\SERVER\ISO9001_QA for example.

Note that it is particularly important not to allow write + U: \\SERVER\UTILS for commonly used utilities, or

+	NET USE Q: \\SERVER\ISO9001_QA

for example.

Note that it is particularly important not to allow write access to the [netlogon] share, or to grant users write permission on the batch files in a secure environment, as this would allow the batch files to be arbitrarily modified and security to be @@ -1545,8 +1556,8 @@ df $1 | tail -1 | awk '{print $2" "$4}' parameter.

Default: depends on the setting of printing

Example 1: lprm command = /usr/bin/lprm -P%p %j

Example 2: lprm command = /usr/bin/cancel %p-%j

machine password timeout (G)

If a Samba server is a member of a Windows NT Domain (see the security = domain) - parameter) then periodically a running - smbd(8) process will try and change the MACHINE ACCOUNT + parameter) then periodically a running smbd + process will try and change the MACHINE ACCOUNT PASSWORD stored in the TDB called private/secrets.tdb . This parameter specifies how often this password will be changed, in seconds. The default is one week (expressed in @@ -1799,14 +1810,15 @@ df $1 | tail -1 | awk '{print $2" "$4}' the SMB-Dfs protocol.

Only Dfs roots can act as proxy shares. Take a look at the msdfs root and host msdfs - options to find out how to set up a Dfs root share.

Example: msdfs proxy = \\\\otherserver\\someshare

msdfs root (S)

If set to yes, + options to find out how to set up a Dfs root share.

Example: msdfs proxy = \\\\otherserver\\someshare

msdfs root (S)

This boolean parameter is only available if + Samba is configured and compiled with the + --with-msdfs option. If set to yes, Samba treats the share as a Dfs root and allows clients to browse the distributed file system tree rooted at the share directory. Dfs links are specified in the share directory by symbolic links of the form msdfs:serverA\\shareA,serverB\\shareB and so on. For more information on setting up a Dfs tree - on Samba, refer to "Hosting a Microsoft - Distributed File System tree on Samba" document.

See also host msdfs

Default: msdfs root = no

name cache timeout (G)

Specifies the number of seconds it takes before + on Samba, refer to ???.

See also host msdfs

Default: msdfs root = no

name cache timeout (G)

Specifies the number of seconds it takes before entries in samba's hostname resolve cache time out. If the timeout is set to 0. the caching is disabled.

Default: name cache timeout = 660

Example: name cache timeout = 0

name resolve order (G)

This option is used by the programs in the Samba @@ -1837,7 +1849,7 @@ df $1 | tail -1 | awk '{print $2" "$4}' first, followed by a broadcast attempt, followed by a normal system hostname lookup.

When Samba is functioning in ADS security mode (security = ads) it is advised to use following settings for name resolve order:

name resolve order = wins bcast

DC lookups will still be done via DNS, but fallbacks to netbios names will - not inundate your DNS servers with needless querys for DOMAIN<0x1c> lookups.

netbios aliases (G)

This is a list of NetBIOS names that nmbd(8) will + not inundate your DNS servers with needless querys for DOMAIN<0x1c> lookups.

netbios aliases (G)

This is a list of NetBIOS names that nmbd will advertise as additional names by which the Samba server is known. This allows one machine to appear in browse lists under multiple names. If a machine is acting as a browse server or logon server none of these names will be advertised as either browse server or logon @@ -1943,9 +1955,8 @@ df $1 | tail -1 | awk '{print $2" "$4}' names to OS/2 printer driver names. The format is:

<nt driver name> = <os2 driver name>.<device name>

For example, a valid entry using the HP LaserJet 5 printer driver would appear as HP LaserJet 5L = LASERJET.HP LaserJet 5L.

The need for the file is due to the printer driver namespace - problem described in the Samba - Printing HOWTO. For more details on OS/2 clients, please - refer to the OS2-Client-HOWTO containing in the Samba documentation.

Default: os2 driver map = <empty string>

os level (G)

This integer value controls what level Samba + problem described in ???. For more details on OS/2 clients, please + refer to ???.

Default: os2 driver map = <empty string>

os level (G)

This integer value controls what level Samba advertises itself as for browse elections. The value of this parameter determines whether nmbd(8) has a chance of becoming a local master browser for the @@ -1995,12 +2006,8 @@ df $1 | tail -1 | awk '{print $2" "$4}' The MySQL based passdb backend. Takes an identifier as argument. Read the Samba HOWTO Collection for configuration details. -

  • guest - - Very simple backend that only provides one user: the guest user. - Only maps the NT guest user to the guest account. - Required in pretty much all situations.

  • -

    Default: passdb backend = smbpasswd

    Example: passdb backend = tdbsam:/etc/samba/private/passdb.tdb smbpasswd:/etc/samba/smbpasswd guest

    Example: passdb backend = ldapsam:ldaps://ldap.example.com guest

    Example: passdb backend = mysql:my_plugin_args tdbsam:/etc/samba/private/passdb.tdb guest

    passwd chat debug (G)

    This boolean specifies if the passwd chat script +

    Default: passdb backend = smbpasswd

    Example: passdb backend = tdbsam:/etc/samba/private/passdb.tdb smbpasswd:/etc/samba/smbpasswd

    Example: passdb backend = ldapsam:ldaps://ldap.example.com

    Example: passdb backend = mysql:my_plugin_args tdbsam

    passwd chat debug (G)

    This boolean specifies if the passwd chat script parameter is run in debug mode. In this mode the strings passed to and received from the passwd chat are printed in the smbd(8) log with a @@ -2058,19 +2065,14 @@ df $1 | tail -1 | awk '{print $2" "$4}' it.

    Note that if the unix password sync parameter is set to yes then this program is called AS ROOT - before the SMB password in the smbpasswd(5) - file is changed. If this UNIX password change fails, then + before the SMB password in the smbpasswd + file is changed. If this UNIX password change fails, then smbd will fail to change the SMB password also (this is by design).

    If the unix password sync parameter is set this parameter MUST USE ABSOLUTE PATHS for ALL programs called, and must be examined for security implications. Note that by default unix - password sync is set to no.

    Not that this program is only invoked when a password change is - done via the smbd program, not when smbpasswd is used locally as root to - change a password. This means that you cannot run "smbpasswd USERNAME" as - root on the SMB server in order to test this parameter, but should run the - command "smbpasswd -r SMBMACHINE" as a non-root user instead if you want - to test the invocation of this program.

    See also unix + password sync is set to no.

    See also unix password sync.

    Default: passwd program = /bin/passwd

    Example: passwd program = /sbin/npasswd %u

    password level (G)

    Some client/server combinations have difficulty with mixed-case passwords. One offending client is Windows for Workgroups, which for some reason forces passwords to upper @@ -2300,7 +2302,8 @@ print5|My Printer 5 Windows XP clients. New versions of Windows 2000 or Windows XP service packs do security ACL checking on the owner and ability to write of the profile directory stored on a local workstation when copied from a Samba - share. When not in domain mode with winbindd then the security info copied + share. +

    When not in domain mode with winbindd then the security info copied onto the local workstation has no meaning to the logged in user (SID) on that workstation so the profile storing fails. Adding this parameter onto a share used for profile storage changes two things about the @@ -2309,14 +2312,14 @@ print5|My Printer 5 BUILTIN\\Users respectively (SIDs S-1-5-32-544, S-1-5-32-545). Secondly it adds an ACE entry of "Full Control" to the SID BUILTIN\\Users to every returned ACL. This will allow any Windows 2000 or XP workstation - user to access the profile. Note that if you have multiple users logging + user to access the profile.

    Note that if you have multiple users logging on to a workstation then in order to prevent them from being able to access each others profiles you must remove the "Bypass traverse checking" advanced user right. This will prevent access to other users profile directories as the top level profile directory (named after the user) is created by the workstation profile code and has an ACL restricting entry to the directory tree to the owning user. -

    Default: profile acls = no

    protocol (G)

    Synonym for +

    Default: profile acls = no

    protocol (G)

    Synonym for max protocol.

    public (S)

    Synonym for guest ok.

    queuepause command (S)

    This parameter specifies the command to be executed on the server host in order to pause the printer queue.

    This command should be a program or script which takes @@ -2393,8 +2396,7 @@ print5|My Printer 5 the workgroup parameter is used instead.

    The IP addresses you choose would normally be the broadcast addresses of the remote networks, but can also be the IP addresses - of known browse masters if your network config is that stable.

    See the documentation file BROWSING - in the docs/ directory.

    Default: remote announce = <empty string>

    remote browse sync (G)

    This option allows you to setup nmbd(8) to periodically request + of known browse masters if your network config is that stable.

    See ???.

    Default: remote announce = <empty string>

    remote browse sync (G)

    This option allows you to setup nmbd(8) to periodically request synchronization of browse lists with the master browser of a Samba server that is on a remote segment. This option will allow you to gain browse lists for multiple workgroups across routed networks. This @@ -2488,8 +2490,8 @@ print5|My Printer 5 information to the server.

    The default is security = user, as this is the most common setting needed when talking to Windows 98 and Windows NT.

    The alternatives are security = share, - security = server, security = domain - , or security = ads.

    In versions of Samba prior to 2.0.0, the default was + security = server or security = domain + .

    In versions of Samba prior to 2.0.0, the default was security = share mainly because that was the only option at one stage.

    There is a bug in WfWg that has relevance to this setting. When in user or server level security a WfWg client @@ -2655,7 +2657,13 @@ print5|My Printer 5 vampire. %u will be replaced with the user whose primary group is to be set. %g will be replaced with the group to - set.

    Default: No default value

    Example: set primary group script = /usr/sbin/usermod -g '%g' '%u'

    share modes (S)

    This enables or disables the honoring of + set.

    Default: No default value

    Example: set primary group script = /usr/sbin/usermod -g '%g' '%u'

    set quota command (G)

    The set quota command should only be used + whenever there is no operating system API available from the OS that + samba can use.

    This parameter should specify the path to a script that + can set quota for the specified arguments.

    The specified script should take the following arguments:

    • 1 - quota type +

      • 1 - user quotas

      • 2 - user default quotas (uid = -1)

      • 3 - group quotas

      • 4 - group default quotas (gid = -1)

      +

    • 2 - id (uid for user, gid for group, -1 if N/A)

    • 3 - quota state (0 = disable, 1 = enable, 2 = enable and enforce)

    • 4 - block softlimit

    • 5 - block hardlimit

    • 6 - inode softlimit

    • 7 - inode hardlimit

    • 8(optional) - block size, defaults to 1024

    The script should output at least one line of data.

    See also the get quota command parameter. +

    Default: set quota command =

    Example: set quota command = /usr/local/sbin/set_quota

    share modes (S)

    This enables or disables the honoring of the share modes during a file open. These modes are used by clients to gain exclusive read or write access to a file.

    These open modes are not directly supported by UNIX, so @@ -2699,7 +2707,7 @@ print5|My Printer 5 switch -r. It means reboot after shutdown for NT.

  • %f will be substituted with the switch -f. It means force the shutdown - even if applications do not respond for NT.

  • Default: None.

    Example: abort shutdown script = /usr/local/samba/sbin/shutdown %m %t %r %f

    Shutdown script example: + even if applications do not respond for NT.

    Default: None.

    Example: shutdown script = /usr/local/samba/sbin/shutdown %m %t %r %f

    Shutdown script example:

     #!/bin/bash
     		
    @@ -2973,11 +2981,13 @@ guest = *
         this parameter determines access to the services.

    Default: The guest account if a guest service, else <empty string>.

    Examples:username = fred, mary, jack, jane, @users, @pcgroup

    users (S)

    Synonym for - username.

    user (S)

    Synonym for username.

    use sendfile (S)

    If this parameter is yes, and the underlying operating + username.

    user (S)

    Synonym for username.

    use sendfile (S)

    If this parameter is yes, and Samba + was built with the --with-sendfile-support option, and the underlying operating system supports sendfile system call, then some SMB read calls (mainly ReadAndX and ReadRaw) will use the more efficient sendfile system call for files that are exclusively oplocked. This may make more efficient use of the system CPU's - and cause Samba to be faster.

    Default: use sendfile = no

    use spnego (G)

    This variable controls controls whether samba will try + and cause Samba to be faster. This is off by default as it's effects are unknown + as yet.

    Default: use sendfile = no

    use spnego (G)

    This variable controls controls whether samba will try to use Simple and Protected NEGOciation (as specified by rfc2478) with WindowsXP and Windows2000 clients to agree upon an authentication mechanism. Unless further issues are discovered with our SPNEGO @@ -3055,13 +3065,10 @@ veto files = /.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/ client contention for files ending in .SEM. To cause Samba not to grant oplocks on these files you would use the line (either in the [global] section or in the section for - the particular NetBench share :

    Example: veto oplock files = /*.SEM/

    vfs objects (S)

    This parameter specifies the backend module names which + the particular NetBench share :

    Example: veto oplock files = /*.SEM/

    vfs objects (S)

    This parameter specifies the backend names which are used for Samba VFS I/O operations. By default, normal disk I/O operations are used but these can be overloaded - with one or more VFS objects.

    Options for a given VFS module are specified one per line - smb.conf perfaced by the module name and a colon (:). Such as

    foo:bar=biddle

    where 'foo' is the name of VFS module, 'bar' is a parameter supported - by ;foo;, and 'biddle' is the value of the option 'bar'. Refer to the - manpage for a given VFS modules regarding the options supported by that module.

    Default: no value

    Example: vfs objects = extd_audit recycle

    vfs object (S)

    Synonym for + with one or more VFS objects.

    Default: no value

    Example: vfs objects = extd_audit recycle

    vfs object (S)

    Synonym for vfs objects . @@ -3162,7 +3169,7 @@ veto files = /.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/ seperated from the ip address by a colon.

    Note

    You need to set up Samba to point to a WINS server if you have multiple subnets and wish cross-subnet - browsing to work correctly.

    See the documentation file Browsing in the samba howto collection.

    Default: not enabled

    Example: wins server = mary:192.9.200.1 fred:192.168.3.199 mary:192.168.2.61

    For this example when querying a certain name, 192.19.200.1 will + browsing to work correctly.

    See the ???.

    Default: not enabled

    Example: wins server = mary:192.9.200.1 fred:192.168.3.199 mary:192.168.2.61

    For this example when querying a certain name, 192.19.200.1 will be asked first and if that doesn't respond 192.168.2.61. If either of those doesn't know the name 192.168.3.199 will be queried.

    Example: wins server = 192.9.200.1 192.168.2.61

    wins support (G)

    This boolean controls if the nmbd(8) process in Samba will act as a WINS server. You should diff --git a/docs/htmldocs/smbcacls.1.html b/docs/htmldocs/smbcacls.1.html index a5d22a3197..44585bc1f7 100644 --- a/docs/htmldocs/smbcacls.1.html +++ b/docs/htmldocs/smbcacls.1.html @@ -48,7 +48,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

    Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. diff --git a/docs/htmldocs/smbclient.1.html b/docs/htmldocs/smbclient.1.html index 1535856433..1ee5fd26da 100644 --- a/docs/htmldocs/smbclient.1.html +++ b/docs/htmldocs/smbclient.1.html @@ -84,12 +84,7 @@ messages.

    -p port

    This number is the TCP port number that will be used when making connections to the server. The standard (well-known) TCP port number for an SMB/CIFS server is 139, which is the - default.

    -l logfilename

    If specified, logfilename specifies a base filename - into which operational data from the running client will be - logged.

    The default base name is specified at compile time.

    The base name is used to generate actual log file names. - For example, if the name specified was "log", the debug file - would be log.client.

    The log file generated is never removed by the client. -

    -h|--help

    Print a summary of command line options. + default.

    -h|--help

    Print a summary of command line options.

    -I IP-address

    IP address is the address of the server to connect to. It should be specified in standard "a.b.c.d" notation.

    Normally the client would attempt to locate a named SMB/CIFS server by looking it up via the NetBIOS name resolution @@ -140,7 +135,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

    Note that specifying this parameter here will -override the <smbconfoption><name>log level</name></smbconfoption> parameter +override the log level parameter in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. @@ -175,7 +170,7 @@ via the ps command. To be safe always allow rpcclient to prompt for a password and type it in directly.

    -n <primary NetBIOS name>

    This option allows you to override the NetBIOS name that Samba uses for itself. This is identical -to setting the <smbconfoption><name>netbios name</name></smbconfoption> parameter in the smb.conf file. +to setting the netbios name parameter in the smb.conf file. However, a command line setting will take precedence over settings in smb.conf.

    -i <scope>

    This specifies a NetBIOS scope that diff --git a/docs/htmldocs/smbcontrol.1.html b/docs/htmldocs/smbcontrol.1.html index 2fe363a4ac..e7ccd27f26 100644 --- a/docs/htmldocs/smbcontrol.1.html +++ b/docs/htmldocs/smbcontrol.1.html @@ -1,315 +1,72 @@ - - - %globalentities; - ]> - - - - smbcontrol - 1 - - - - - smbcontrol - send messages to smbd, nmbd or winbindd processes - - - - - smbcontrol - -i - -s - - - - smbcontrol - destination - message-type - parameter - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - smbcontrol is a very small program, which - sends messages to a smbd - 8, a nmbd - 8, or a winbindd - 8 daemon running on the system. - - - - - OPTIONS - - - - --h|--help -Print a summary of command line options. - - - - --s <configuration file> -The file specified contains the +smbcontrol

    Name

    smbcontrol — send messages to smbd, nmbd or winbindd processes

    Synopsis

    smbcontrol [-i] [-s]

    smbcontrol [destination] [message-type] [parameter]

    DESCRIPTION

    This tool is part of the Samba(7) suite.

    smbcontrol is a very small program, which + sends messages to a smbd(8), a nmbd(8), or a winbindd(8) daemon running on the system.

    OPTIONS

    -h|--help

    Print a summary of command line options. +

    -s <configuration file>

    The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - -i - Run interactively. Individual commands +compile time.

    -i

    Run interactively. Individual commands of the form destination message-type parameters can be entered on STDIN. An empty command line or a "q" will quit the - program. - - - - destination - One of nmbd, smbd or a process ID. - - The smbd destination causes the - message to "broadcast" to all smbd daemons. - - The nmbd destination causes the + program.

    destination

    One of nmbd, smbd or a process ID.

    The smbd destination causes the + message to "broadcast" to all smbd daemons.

    The nmbd destination causes the message to be sent to the nmbd daemon specified in the - nmbd.pid file. - - If a single process ID is given, the message is sent - to only that process. - - - - - message-type - Type of message to send. See - the section MESSAGE-TYPES for details. - - - - - - parameters - any parameters required for the message-type - - - - - - - - MESSAGE-TYPES - - Available message types are: - - - close-share - Order smbd to close the client + nmbd.pid file.

    If a single process ID is given, the message is sent + to only that process.

    message-type

    Type of message to send. See + the section MESSAGE-TYPES for details. +

    parameters

    any parameters required for the message-type

    MESSAGE-TYPES

    Available message types are:

    close-share

    Order smbd to close the client connections to the named share. Note that this doesn't affect client connections to any other shares. This message-type takes an argument of the share name for which client connections will be closed, or the "*" character which will close all currently open shares. This may be useful if you made changes to the access controls on the share. - This message can only be sent to smbd. - - - - - debug - Set debug level to the value specified by the - parameter. This can be sent to any of the destinations. - - - - - force-election - This message causes the nmbd daemon to - force a new browse master election. - - - - ping - + This message can only be sent to smbd.

    debug

    Set debug level to the value specified by the + parameter. This can be sent to any of the destinations.

    force-election

    This message causes the nmbd daemon to + force a new browse master election.

    ping

    Send specified number of "ping" messages and wait for the same number of reply "pong" messages. This can be sent to - any of the destinations. - - - - - profile - Change profile settings of a daemon, based on the + any of the destinations.

    profile

    Change profile settings of a daemon, based on the parameter. The parameter can be "on" to turn on profile stats collection, "off" to turn off profile stats collection, "count" to enable only collection of count stats (time stats are disabled), and "flush" to zero the current profile stats. This can - be sent to any smbd or nmbd destinations. - - - - debuglevel - + be sent to any smbd or nmbd destinations.

    debuglevel

    Request debuglevel of a certain daemon and write it to stdout. This - can be sent to any of the destinations. - - - - - profilelevel - + can be sent to any of the destinations.

    profilelevel

    Request profilelevel of a certain daemon and write it to stdout. - This can be sent to any smbd or nmbd destinations. - - - - - printnotify - + This can be sent to any smbd or nmbd destinations.

    printnotify

    Order smbd to send a printer notify message to any Windows NT clients connected to a printer. This message-type takes the following arguments: - - - - - - queuepause printername - Send a queue pause change notify - message to the printer specified. - - - - queueresume printername - Send a queue resume change notify - message for the printer specified. - - - - jobpause printername unixjobid - Send a job pause change notify +

    queuepause printername

    Send a queue pause change notify + message to the printer specified.

    queueresume printername

    Send a queue resume change notify + message for the printer specified.

    jobpause printername unixjobid

    Send a job pause change notify message for the printer and unix jobid - specified. - - - - jobresume printername unixjobid - Send a job resume change notify + specified.

    jobresume printername unixjobid

    Send a job resume change notify message for the printer and unix jobid - specified. - - - - jobdelete printername unixjobid - Send a job delete change notify + specified.

    jobdelete printername unixjobid

    Send a job delete change notify message for the printer and unix jobid - specified. - - - - + specified.

    Note that this message only sends notification that an event has occured. It doesn't actually cause the event to happen. - - - This message can only be sent to smbd. - - - - - samsync - Order smbd to synchronise sam database from PDC (being BDC). Can only be sent to smbd. - Not working at the moment - - - - - samrepl - Send sam replication message, with specified serial. Can only be sent to smbd. Should not be used manually. - - - - dmalloc-mark - Set a mark for dmalloc. Can be sent to both smbd and nmbd. Only available if samba is built with dmalloc support. - - - - dmalloc-log-changed - +

    This message can only be sent to smbd.

    samsync

    Order smbd to synchronise sam database from PDC (being BDC). Can only be sent to smbd.

    Note

    Not working at the moment

    samrepl

    Send sam replication message, with specified serial. Can only be sent to smbd. Should not be used manually.

    dmalloc-mark

    Set a mark for dmalloc. Can be sent to both smbd and nmbd. Only available if samba is built with dmalloc support.

    dmalloc-log-changed

    Dump the pointers that have changed since the mark set by dmalloc-mark. - Can be sent to both smbd and nmbd. Only available if samba is built with dmalloc support. - - - - shutdown - Shut down specified daemon. Can be sent to both smbd and nmbd. - - - - pool-usage - Print a human-readable description of all + Can be sent to both smbd and nmbd. Only available if samba is built with dmalloc support.

    shutdown

    Shut down specified daemon. Can be sent to both smbd and nmbd.

    pool-usage

    Print a human-readable description of all talloc(pool) memory usage by the specified daemon/process. Available - for both smbd and nmbd. - - - - drvupgrade - Force clients of printers using specified driver + for both smbd and nmbd.

    drvupgrade

    Force clients of printers using specified driver to update their local version of the driver. Can only be - sent to smbd. - - - - reload-config - Force daemon to reload smb.conf configuration file. Can be sent - to smbd, nmbd, or winbindd. - - - - - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - SEE ALSO - nmbd - 8 and smbd - 8. - - - - AUTHOR - - The original Samba software and related utilities + sent to smbd.

    reload-config

    Force daemon to reload smb.conf configuration file. Can be sent + to smbd, nmbd, or winbindd. +

    VERSION

    This man page is correct for version 3.0 of + the Samba suite.

    SEE ALSO

    nmbd(8) and smbd(8).

    AUTHOR

    The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

    The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for - Samba 3.0 was done by Alexander Bokovoy. - - - + Samba 3.0 was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/smbcquotas.1.html b/docs/htmldocs/smbcquotas.1.html index df8cffcd26..59dcd106ed 100644 --- a/docs/htmldocs/smbcquotas.1.html +++ b/docs/htmldocs/smbcquotas.1.html @@ -28,7 +28,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

    Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. diff --git a/docs/htmldocs/smbd.8.html b/docs/htmldocs/smbd.8.html index 47c41714e8..291ddbc0f6 100644 --- a/docs/htmldocs/smbd.8.html +++ b/docs/htmldocs/smbd.8.html @@ -1,431 +1,178 @@ - - - %globalentities; - ]> - - - - smbd - 8 - - - - - smbd - server to provide SMB/CIFS services to clients - - - - - smbd - -D - -F - -S - -i - -h - -V - -b - -d <debug level> - -l <log directory> - -p <port number> - -O <socket option> - -s <configuration file> - - - - - DESCRIPTION - This program is part of the Samba - 7 suite. - - smbd is the server daemon that +smbd

    Name

    smbd — server to provide SMB/CIFS services to clients

    Synopsis

    smbd [-D] [-F] [-S] [-i] [-h] [-V] [-b] [-d <debug level>] [-l <log directory>] [-p <port number>] [-O <socket option>] [-s <configuration file>]

    DESCRIPTION

    This program is part of the Samba(7) suite.

    smbd is the server daemon that provides filesharing and printing services to Windows clients. The server provides filespace and printer services to clients using the SMB (or CIFS) protocol. This is compatible with the LanManager protocol, and can service LanManager clients. These include MSCLIENT 3.0 for DOS, Windows for Workgroups, Windows 95/98/ME, Windows NT, Windows 2000, - OS/2, DAVE for Macintosh, and smbfs for Linux. - - An extensive description of the services that the + OS/2, DAVE for Macintosh, and smbfs for Linux.

    An extensive description of the services that the server can provide is given in the man page for the configuration file controlling the attributes of those - services (see smb.conf - 5. This man page will not describe the + services (see smb.conf(5). This man page will not describe the services, but will concentrate on the administrative aspects - of running the server. - - Please note that there are significant security - implications to running this server, and the smb.conf - 5 manual page should be regarded as mandatory reading before - proceeding with installation. - - A session is created whenever a client requests one. + of running the server.

    Please note that there are significant security + implications to running this server, and the smb.conf(5) manual page should be regarded as mandatory reading before + proceeding with installation.

    A session is created whenever a client requests one. Each client gets a copy of the server for each session. This copy then services all connections made by the client during that session. When all connections from its client are closed, - the copy of the server for that client terminates. - - The configuration file, and any files that it includes, + the copy of the server for that client terminates.

    The configuration file, and any files that it includes, are automatically reloaded every minute, if they change. You can force a reload by sending a SIGHUP to the server. Reloading the configuration file will not affect connections to any service that is already established. Either the user will have to - disconnect from the service, or smbd killed and restarted. - - - - OPTIONS - - - - -D - If specified, this parameter causes + disconnect from the service, or smbd killed and restarted.

    OPTIONS

    -D

    If specified, this parameter causes the server to operate as a daemon. That is, it detaches itself and runs in the background, fielding requests on the appropriate port. Operating the server as a - daemon is the recommended way of running smbd for + daemon is the recommended way of running smbd for servers that provide more than casual use file and - print services. This switch is assumed if smbd - is executed on the command line of a shell. - - - - - -F - If specified, this parameter causes - the main smbd process to not daemonize, + print services. This switch is assumed if smbd + is executed on the command line of a shell. +

    -F

    If specified, this parameter causes + the main smbd process to not daemonize, i.e. double-fork and disassociate with the terminal. Child processes are still created as normal to service each connection request, but the main process does not exit. This operation mode is suitable for running - smbd under process supervisors such - as supervise and svscan - from Daniel J. Bernstein's daemontools + smbd under process supervisors such + as supervise and svscan + from Daniel J. Bernstein's daemontools package, or the AIX process monitor. - - - - - -S - If specified, this parameter causes - smbd to log to standard output rather - than a file. - - - - -i - If this parameter is specified it causes the +

    -S

    If specified, this parameter causes + smbd to log to standard output rather + than a file.

    -i

    If this parameter is specified it causes the server to run "interactively", not as a daemon, even if the server is executed on the command line of a shell. Setting this parameter negates the implicit deamon mode when run from the - command line. smbd also logs to standard - output, as if the -S parameter had been + command line. smbd also logs to standard + output, as if the -S parameter had been given. - - - - - - --V -Prints the version number for -smbd. - - - --s <configuration file> -The file specified contains the +

    -V

    Prints the version number for +smbd.

    -s <configuration file>

    The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - --d|--debug=debuglevel - -debuglevel is an integer +compile time.

    -d|--debug=debuglevel

    debuglevel is an integer from 0 to 10. The default value if this parameter is -not specified is zero. - -The higher this value, the more detail will be +not specified is zero.

    The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of -information about operations carried out. - -Levels above 1 will generate considerable +information about operations carried out.

    Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log -data, most of which is extremely cryptic. - -Note that specifying this parameter here will -override the log levellog level parameter -in the smb.conf file. - - - - --l|--logfile=logbasename -File name for log/debug files. The extension -".client" will be appended. The log file is +data, most of which is extremely cryptic.

    Note that specifying this parameter here will +override the log level parameter +in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension +".client" will be appended. The log file is never removed by the client. - - - - - --h|--help -Print a summary of command line options. - - - - - -b - Prints information about how - Samba was built. - - - - -l <log directory> - If specified, - log directory +

    -h|--help

    Print a summary of command line options. +

    -b

    Prints information about how + Samba was built.

    -l <log directory>

    If specified, + log directory specifies a log directory into which the "log.smbd" log file will be created for informational and debug messages from the running server. The log file generated is never removed by the server although its size may be controlled by the - max log sizemax log size - option in the smb.conf - 5 file. Beware: - If the directory specified does not exist, smbd + max log size + option in the smb.conf(5) file. Beware: + If the directory specified does not exist, smbd will log to the default debug log location defined at compile time. - - - The default log directory is specified at - compile time. - - - - -p <port number> - port number is a positive integer +

    The default log directory is specified at + compile time.

    -p <port number>

    port number is a positive integer value. The default value if this parameter is not - specified is 139. - - This number is the port number that will be + specified is 139.

    This number is the port number that will be used when making connections to the server from client software. The standard (well-known) port number for the SMB over TCP is 139, hence the default. If you wish to run the server as an ordinary user rather than as root, most systems will require you to use a port number greater than 1024 - ask your system administrator - for help if you are in this situation. - - In order for the server to be useful by most + for help if you are in this situation.

    In order for the server to be useful by most clients, should you configure it on a port other than 139, you will require port redirection services on port 139, details of which are outlined in rfc1002.txt - section 4.3.5. - - This parameter is not normally specified except - in the above situation. - - - - - - FILES - - - - /etc/inetd.conf - If the server is to be run by the - inetd meta-daemon, this file + section 4.3.5.

    This parameter is not normally specified except + in the above situation.

    FILES

    /etc/inetd.conf

    If the server is to be run by the + inetd meta-daemon, this file must contain suitable startup information for the meta-daemon. - - - - - /etc/rc - or whatever initialization script your - system uses). - - If running the server as a daemon at startup, +

    /etc/rc

    or whatever initialization script your + system uses).

    If running the server as a daemon at startup, this file will need to contain an appropriate startup - sequence for the server. - - - - /etc/services - If running the server via the - meta-daemon inetd, this file + sequence for the server.

    /etc/services

    If running the server via the + meta-daemon inetd, this file must contain a mapping of service name (e.g., netbios-ssn) to service port (e.g., 139) and protocol type (e.g., tcp). - - - - - /usr/local/samba/lib/smb.conf - This is the default location of the smb.conf - 5 server configuration file. Other common places that systems - install this file are /usr/samba/lib/smb.conf - and /etc/samba/smb.conf. - - This file describes all the services the server - is to make available to clients. See smb.conf - 5 for more information. - - - - - - - LIMITATIONS - On some systems smbd cannot change uid back +

    /usr/local/samba/lib/smb.conf

    This is the default location of the smb.conf(5) server configuration file. Other common places that systems + install this file are /usr/samba/lib/smb.conf + and /etc/samba/smb.conf.

    This file describes all the services the server + is to make available to clients. See smb.conf(5) for more information.

    LIMITATIONS

    On some systems smbd cannot change uid back to root after a setuid() call. Such systems are called trapdoor uid systems. If you have such a system, you will be unable to connect from a client (such as a PC) as two different users at once. Attempts to connect the second user will result in access denied or - similar. - - - - ENVIRONMENT VARIABLES - - - - PRINTER - If no printer name is specified to + similar.

    ENVIRONMENT VARIABLES

    PRINTER

    If no printer name is specified to printable services, most systems will use the value of - this variable (or lp if this variable is + this variable (or lp if this variable is not defined) as the name of the printer to use. This - is not specific to the server, however. - - - - - - - PAM INTERACTION - Samba uses PAM for authentication (when presented with a plaintext + is not specific to the server, however.

    PAM INTERACTION

    Samba uses PAM for authentication (when presented with a plaintext password), for account checking (is this account disabled?) and for session management. The degree too which samba supports PAM is restricted - by the limitations of the SMB protocol and the obey pam restrictionsobey pam restrictions smb.conf - 5 paramater. When this is set, the following restrictions apply: - - - - Account Validation: All accesses to a + by the limitations of the SMB protocol and the obey pam restrictions smb.conf(5) paramater. When this is set, the following restrictions apply: +

    • Account Validation: All accesses to a samba server are checked against PAM to see if the account is vaild, not disabled and is permitted to login at this time. This also applies to encrypted logins. - - - Session Management: When not using share +

    • Session Management: When not using share level secuirty, users must pass PAM's session checks before access is granted. Note however, that this is bypassed in share level secuirty. Note also that some older pam configuration files may need a line added for session support. - - - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - DIAGNOSTICS - - Most diagnostics issued by the server are logged +

    VERSION

    This man page is correct for version 3.0 of + the Samba suite.

    DIAGNOSTICS

    Most diagnostics issued by the server are logged in a specified log file. The log file name is specified - at compile time, but may be overridden on the command line. - - The number and nature of diagnostics available depends + at compile time, but may be overridden on the command line.

    The number and nature of diagnostics available depends on the debug level used by the server. If you have problems, set - the debug level to 3 and peruse the log files. - - Most messages are reasonably self-explanatory. Unfortunately, + the debug level to 3 and peruse the log files.

    Most messages are reasonably self-explanatory. Unfortunately, at the time this man page was created, there are too many diagnostics available in the source code to warrant describing each and every diagnostic. At this stage your best bet is still to grep the source code and inspect the conditions that gave rise to the - diagnostics you are seeing. - - - - SIGNALS - - Sending the smbd a SIGHUP will cause it to - reload its smb.conf configuration - file within a short period of time. - - To shut down a user's smbd process it is recommended - that SIGKILL (-9) NOT + diagnostics you are seeing.

    SIGNALS

    Sending the smbd a SIGHUP will cause it to + reload its smb.conf configuration + file within a short period of time.

    To shut down a user's smbd process it is recommended + that SIGKILL (-9) NOT be used, except as a last resort, as this may leave the shared memory area in an inconsistent state. The safe way to terminate - an smbd is to send it a SIGTERM (-15) signal and wait for - it to die on its own. - - The debug log level of smbd may be raised - or lowered using smbcontrol - 1 program (SIGUSR[1|2] signals are no longer + an smbd is to send it a SIGTERM (-15) signal and wait for + it to die on its own.

    The debug log level of smbd may be raised + or lowered using smbcontrol(1) program (SIGUSR[1|2] signals are no longer used since Samba 2.2). This is to allow transient problems to be diagnosed, - whilst still running at a normally low log level. - - Note that as the signal handlers send a debug write, - they are not re-entrant in smbd. This you should wait until - smbd is in a state of waiting for an incoming SMB before + whilst still running at a normally low log level.

    Note that as the signal handlers send a debug write, + they are not re-entrant in smbd. This you should wait until + smbd is in a state of waiting for an incoming SMB before issuing them. It is possible to make the signal handlers safe by un-blocking the signals before the select call and re-blocking - them after, however this would affect performance. - - - - SEE ALSO - hosts_access - 5, inetd - 8, nmbd - 8, smb.conf - 5, smbclient - 1, testparm - 1, testprns - 1, and the - Internet RFC's rfc1001.txt, rfc1002.txt. + them after, however this would affect performance.

    SEE ALSO

    hosts_access(5), inetd(8), nmbd(8), smb.conf(5), smbclient(1), testparm(1), testprns(1), and the + Internet RFC's rfc1001.txt, rfc1002.txt. In addition the CIFS (formerly SMB) specification is available - as a link from the Web page - http://samba.org/cifs/. - - - - AUTHOR - - The original Samba software and related utilities + as a link from the Web page + http://samba.org/cifs/.

    AUTHOR

    The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

    The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for - Samba 3.0 was done by Alexander Bokovoy. - - - + Samba 3.0 was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/smbmnt.8.html b/docs/htmldocs/smbmnt.8.html index 1f5f83f751..8caedac3f5 100644 --- a/docs/htmldocs/smbmnt.8.html +++ b/docs/htmldocs/smbmnt.8.html @@ -1,127 +1,24 @@ - - - %globalentities; - ]> - - - - smbmnt - 8 - - - - - smbmnt - helper utility for mounting SMB filesystems - - - - - smbmnt - mount-point - -s <share> - -r - -u <uid> - -g <gid> - -f <mask> - -d <mask> - -o <options> - -h - - - - - DESCRIPTION - - smbmnt is a helper application used +smbmnt

    Name

    smbmnt — helper utility for mounting SMB filesystems

    Synopsis

    smbmnt {mount-point} [-s <share>] [-r] [-u <uid>] [-g <gid>] [-f <mask>] [-d <mask>] [-o <options>] [-h]

    DESCRIPTION

    smbmnt is a helper application used by the smbmount program to do the actual mounting of SMB shares. - smbmnt can be installed setuid root if you want - normal users to be able to mount their SMB shares. - - A setuid smbmnt will only allow mounts on directories owned - by the user, and that the user has write permission on. - - The smbmnt program is normally invoked - by smbmount - 8. It should not be invoked directly by users. - - smbmount searches the normal PATH for smbmnt. You must ensure - that the smbmnt version in your path matches the smbmount used. - - - - - OPTIONS - - - - -r - mount the filesystem read-only - - - - - -u uid - specify the uid that the files will - be owned by - - - - -g gid - specify the gid that the files will be - owned by - - - - -f mask - specify the octal file mask applied - - - - - -d mask - specify the octal directory mask - applied - - - - -o options - + smbmnt can be installed setuid root if you want + normal users to be able to mount their SMB shares.

    A setuid smbmnt will only allow mounts on directories owned + by the user, and that the user has write permission on.

    The smbmnt program is normally invoked + by smbmount(8). It should not be invoked directly by users.

    smbmount searches the normal PATH for smbmnt. You must ensure + that the smbmnt version in your path matches the smbmount used.

    OPTIONS

    -r

    mount the filesystem read-only +

    -u uid

    specify the uid that the files will + be owned by

    -g gid

    specify the gid that the files will be + owned by

    -f mask

    specify the octal file mask applied +

    -d mask

    specify the octal directory mask + applied

    -o options

    list of options that are passed as-is to smbfs, if this command is run on a 2.4 or higher Linux kernel. - - - - - --h|--help -Print a summary of command line options. - - - - - - - - - AUTHOR - - Volker Lendecke, Andrew Tridgell, Michael H. Warfield - and others. - - The current maintainer of smbfs and the userspace - tools smbmount, smbumount, - and smbmnt is Urban Widmark. - The SAMBA Mailing list +

    -h|--help

    Print a summary of command line options. +

    AUTHOR

    Volker Lendecke, Andrew Tridgell, Michael H. Warfield + and others.

    The current maintainer of smbfs and the userspace + tools smbmount, smbumount, + and smbmnt is Urban Widmark. + The SAMBA Mailing list is the preferred place to ask questions regarding these programs. - - - The conversion of this manpage for Samba 2.2 was performed +

    The conversion of this manpage for Samba 2.2 was performed by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 - was done by Alexander Bokovoy. - - - + was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/smbmount.8.html b/docs/htmldocs/smbmount.8.html index 60e0288035..233dee51d7 100644 --- a/docs/htmldocs/smbmount.8.html +++ b/docs/htmldocs/smbmount.8.html @@ -1,237 +1,71 @@ - - - %globalentities; - ]> - - - - smbmount - 8 - - - - - smbmount - mount an smbfs filesystem - - - - - smbmount - service - mount-point - -o options - - - - - DESCRIPTION - - smbmount mounts a Linux SMB filesystem. It - is usually invoked as mount.smbfs by - the mount - 8 command when using the +smbmount

    Name

    smbmount — mount an smbfs filesystem

    Synopsis

    smbmount {service} {mount-point} [-o options]

    DESCRIPTION

    smbmount mounts a Linux SMB filesystem. It + is usually invoked as mount.smbfs by + the mount(8) command when using the "-t smbfs" option. This command only works in Linux, and the kernel must - support the smbfs filesystem. - - Options to smbmount are specified as a comma-separated + support the smbfs filesystem.

    Options to smbmount are specified as a comma-separated list of key=value pairs. It is possible to send options other than those listed here, assuming that smbfs supports them. If you get mount failures, check your kernel log for errors on - unknown options. - - smbmount is a daemon. After mounting it keeps running until + unknown options.

    smbmount is a daemon. After mounting it keeps running until the mounted smbfs is umounted. It will log things that happen when in daemon mode using the "machine name" smbmount, so - typically this output will end up in log.smbmount. The - smbmount process may also be called mount.smbfs. - - smbmount - calls smbmnt - 8 to do the actual mount. You - must make sure that smbmnt is in the path so - that it can be found. - - - - - OPTIONS - - - - username=<arg> - specifies the username to connect as. If - this is not given, then the environment variable - USER is used. This option can also take the + typically this output will end up in log.smbmount. The + smbmount process may also be called mount.smbfs.

    Note

    smbmount + calls smbmnt(8) to do the actual mount. You + must make sure that smbmnt is in the path so + that it can be found.

    OPTIONS

    username=<arg>

    specifies the username to connect as. If + this is not given, then the environment variable + USER is used. This option can also take the form "user%password" or "user/workgroup" or "user/workgroup%password" to allow the password and workgroup - to be specified as part of the username. - - - - password=<arg> - specifies the SMB password. If this + to be specified as part of the username.

    password=<arg>

    specifies the SMB password. If this option is not given then the environment variable - PASSWD is used. If it can find - no password smbmount will prompt + PASSWD is used. If it can find + no password smbmount will prompt for a passeword, unless the guest option is - given. - - + given.

    Note that passwords which contain the argument delimiter character (i.e. a comma ',') will failed to be parsed correctly on the command line. However, the same password defined in the PASSWD environment variable or a credentials file (see below) will be read correctly. - - - - - - credentials=<filename> - specifies a file that contains a username and/or password. +

    credentials=<filename>

    specifies a file that contains a username and/or password. The format of the file is: - +

     username = <value>
     password = <value>
    -
    -
    -		This is preferred over having passwords in plaintext in a
    -		shared file, such as /etc/fstab. Be sure to protect any
    +

    This is preferred over having passwords in plaintext in a + shared file, such as /etc/fstab. Be sure to protect any credentials file properly. - - - - - krb - Use kerberos (Active Directory). - - - - netbiosname=<arg> - sets the source NetBIOS name. It defaults - to the local hostname. - - - - uid=<arg> - sets the uid that will own all files on +

    krb

    Use kerberos (Active Directory).

    netbiosname=<arg>

    sets the source NetBIOS name. It defaults + to the local hostname.

    uid=<arg>

    sets the uid that will own all files on the mounted filesystem. It may be specified as either a username or a numeric uid. - - - - - - gid=<arg> - sets the gid that will own all files on +

    gid=<arg>

    sets the gid that will own all files on the mounted filesystem. It may be specified as either a groupname or a numeric - gid. - - - - - port=<arg> - sets the remote SMB port number. The default - is 139. - - - - - fmask=<arg> - sets the file mask. This determines the + gid.

    port=<arg>

    sets the remote SMB port number. The default + is 139.

    fmask=<arg>

    sets the file mask. This determines the permissions that remote files have in the local filesystem. This is not a umask, but the actual permissions for the files. - The default is based on the current umask. - - - - - dmask=<arg> - Sets the directory mask. This determines the + The default is based on the current umask.

    dmask=<arg>

    Sets the directory mask. This determines the permissions that remote directories have in the local filesystem. This is not a umask, but the actual permissions for the directories. - The default is based on the current umask. - - - - - debug=<arg> - Sets the debug level. This is useful for + The default is based on the current umask.

    debug=<arg>

    Sets the debug level. This is useful for tracking down SMB connection problems. A suggested value to start with is 4. If set too high there will be a lot of - output, possibly hiding the useful output. - - - - - ip=<arg> - Sets the destination host or IP address. - - - - - - - workgroup=<arg> - Sets the workgroup on the destination - - - - - - sockopt=<arg> - Sets the TCP socket options. See the smb.conf - 5 socket options option. - - - - - - scope=<arg> - Sets the NetBIOS scope - - - - guest - Don't prompt for a password - - - - ro - mount read-only - - - - rwmount read-write - - - - iocharset=<arg> - + output, possibly hiding the useful output.

    ip=<arg>

    Sets the destination host or IP address. +

    workgroup=<arg>

    Sets the workgroup on the destination

    sockopt=<arg>

    Sets the TCP socket options. See the smb.conf(5) socket options option. +

    scope=<arg>

    Sets the NetBIOS scope

    guest

    Don't prompt for a password

    ro

    mount read-only

    rw

    mount read-write

    iocharset=<arg>

    sets the charset used by the Linux side for codepage to charset translations (NLS). Argument should be the name of a charset, like iso8859-1. (Note: only kernel 2.4.0 or later) - - - - - codepage=<arg> - +

    codepage=<arg>

    sets the codepage the server uses. See the iocharset option. Example value cp850. (Note: only kernel 2.4.0 or later) - - - - - ttl=<arg> - +

    ttl=<arg>

    sets how long a directory listing is cached in milliseconds (also affects visibility of file size and date changes). A higher value means that changes on the @@ -241,96 +75,34 @@ password = <value> like 10000ms (10 seconds) is probably more reasonable in many cases. (Note: only kernel 2.4.2 or later) - - - - - - - - - - ENVIRONMENT VARIABLES - - The variable USER may contain the username of the +

    ENVIRONMENT VARIABLES

    The variable USER may contain the username of the person using the client. This information is used only if the protocol level is high enough to support session-level passwords. The variable can be used to set both username and - password by using the format username%password. - - The variable PASSWD may contain the password of the + password by using the format username%password.

    The variable PASSWD may contain the password of the person using the client. This information is used only if the protocol level is high enough to support session-level - passwords. - - The variable PASSWD_FILE may contain the pathname + passwords.

    The variable PASSWD_FILE may contain the pathname of a file to read the password from. A single line of input is - read and used as the password. - - - - - BUGS - - Passwords and other options containing , can not be handled. + read and used as the password.

    BUGS

    Passwords and other options containing , can not be handled. For passwords an alternative way of passing them is in a credentials - file or in the PASSWD environment. - - The credentials file does not handle usernames or passwords with - leading space. - - One smbfs bug is important enough to mention here, even if it - is a bit misplaced: - - - - Mounts sometimes stop working. This is usually + file or in the PASSWD environment.

    The credentials file does not handle usernames or passwords with + leading space.

    One smbfs bug is important enough to mention here, even if it + is a bit misplaced:

    • Mounts sometimes stop working. This is usually caused by smbmount terminating. Since smbfs needs smbmount to reconnect when the server disconnects, the mount will eventually go dead. An umount/mount normally fixes this. At least 2 ways to - trigger this bug are known. - - - - Note that the typical response to a bug report is suggestion + trigger this bug are known.

    Note that the typical response to a bug report is suggestion to try the latest version first. So please try doing that first, and always include which versions you use of relevant software - when reporting bugs (minimum: samba, kernel, distribution) - - - - - - SEE ALSO - - Documentation/filesystems/smbfs.txt in the linux kernel - source tree may contain additional options and information. - - FreeBSD also has a smbfs, but it is not related to smbmount - - For Solaris, HP-UX and others you may want to look at smbsh - 1 or at other solutions, such as - Sharity or perhaps replacing the SMB server with a NFS server. - - - - - - AUTHOR - - Volker Lendecke, Andrew Tridgell, Michael H. Warfield - and others. - - The current maintainer of smbfs and the userspace - tools smbmount, smbumount, - and smbmnt is Urban Widmark. - The SAMBA Mailing list + when reporting bugs (minimum: samba, kernel, distribution)

    SEE ALSO

    Documentation/filesystems/smbfs.txt in the linux kernel + source tree may contain additional options and information.

    FreeBSD also has a smbfs, but it is not related to smbmount

    For Solaris, HP-UX and others you may want to look at smbsh(1) or at other solutions, such as + Sharity or perhaps replacing the SMB server with a NFS server.

    AUTHOR

    Volker Lendecke, Andrew Tridgell, Michael H. Warfield + and others.

    The current maintainer of smbfs and the userspace + tools smbmount, smbumount, + and smbmnt is Urban Widmark. + The SAMBA Mailing list is the preferred place to ask questions regarding these programs. - - - The conversion of this manpage for Samba 2.2 was performed +

    The conversion of this manpage for Samba 2.2 was performed by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 - was done by Alexander Bokovoy. - - - + was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/smbpasswd.5.html b/docs/htmldocs/smbpasswd.5.html index 7f51bed5d9..700f986f30 100644 --- a/docs/htmldocs/smbpasswd.5.html +++ b/docs/htmldocs/smbpasswd.5.html @@ -1,71 +1,18 @@ - - - %globalentities; - ]> - - - - smbpasswd - 5 - - - - - smbpasswd - The Samba encrypted password file - - - - smbpasswd - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - smbpasswd is the Samba encrypted password file. It contains +smbpasswd

    Name

    smbpasswd — The Samba encrypted password file

    Synopsis

    smbpasswd

    DESCRIPTION

    This tool is part of the Samba(7) suite.

    smbpasswd is the Samba encrypted password file. It contains the username, Unix user id and the SMB hashed passwords of the user, as well as account flag information and the time the password was last changed. This file format has been evolving with - Samba and has had several different formats in the past. - - - - FILE FORMAT - - The format of the smbpasswd file used by Samba 2.2 - is very similar to the familiar Unix passwd(5) + Samba and has had several different formats in the past.

    FILE FORMAT

    The format of the smbpasswd file used by Samba 2.2 + is very similar to the familiar Unix passwd(5) file. It is an ASCII file containing one line for each user. Each field ithin each line is separated from the next by a colon. Any entry beginning with '#' is ignored. The smbpasswd file contains the - following information for each user: - - - - name - This is the user name. It must be a name that - already exists in the standard UNIX passwd file. - - - - - uid - This is the UNIX uid. It must match the uid + following information for each user:

    name

    This is the user name. It must be a name that + already exists in the standard UNIX passwd file.

    uid

    This is the UNIX uid. It must match the uid field for the same user entry in the standard UNIX passwd file. If this does not match then Samba will refuse to recognize this smbpasswd file entry as being valid for a user. - - - - - - Lanman Password Hash - This is the LANMAN hash of the user's password, +

    Lanman Password Hash

    This is the LANMAN hash of the user's password, encoded as 32 hex digits. The LANMAN hash is created by DES encrypting a well known string with the user's password as the DES key. This is the same password used by Windows 95/98 machines. @@ -76,135 +23,68 @@ null password this field will contain the characters "NO PASSWORD" as the start of the hex string. If the hex string is equal to 32 'X' characters then the user's account is marked as - disabled and the user will not be able to - log onto the Samba server. - - WARNING !! Note that, due to + disabled and the user will not be able to + log onto the Samba server.

    WARNING !! Note that, due to the challenge-response nature of the SMB/CIFS authentication protocol, anyone with a knowledge of this password hash will be able to impersonate the user on the network. For this - reason these hashes are known as plain text - equivalents and must NOT be made + reason these hashes are known as plain text + equivalents and must NOT be made available to anyone but the root user. To protect these passwords the smbpasswd file is placed in a directory with read and traverse access only to the root user and the smbpasswd file itself must be set to be read/write only by root, with no - other access. - - - - - NT Password Hash - This is the Windows NT hash of the user's + other access.

    NT Password Hash

    This is the Windows NT hash of the user's password, encoded as 32 hex digits. The Windows NT hash is created by taking the user's password as represented in 16-bit, little-endian UNICODE and then applying the MD4 - (internet rfc1321) hashing algorithm to it. - - This password hash is considered more secure than + (internet rfc1321) hashing algorithm to it.

    This password hash is considered more secure than the LANMAN Password Hash as it preserves the case of the password and uses a much higher quality hashing algorithm. However, it is still the case that if two users choose the same password this entry will be identical (i.e. the password is - not "salted" as the UNIX password is). - - WARNING !!. Note that, due to + not "salted" as the UNIX password is).

    WARNING !!. Note that, due to the challenge-response nature of the SMB/CIFS authentication protocol, anyone with a knowledge of this password hash will be able to impersonate the user on the network. For this - reason these hashes are known as plain text - equivalents and must NOT be made + reason these hashes are known as plain text + equivalents and must NOT be made available to anyone but the root user. To protect these passwords the smbpasswd file is placed in a directory with read and traverse access only to the root user and the smbpasswd file itself must be set to be read/write only by root, with no - other access. - - - - - Account Flags - This section contains flags that describe + other access.

    Account Flags

    This section contains flags that describe the attributes of the users account. In the Samba 2.2 release this field is bracketed by '[' and ']' characters and is always 13 characters in length (including the '[' and ']' characters). The contents of this field may be any of the following characters: - - - - U - This means +

    • U - This means this is a "User" account, i.e. an ordinary user. Only User and Workstation Trust accounts are currently supported - in the smbpasswd file. - - N - This means the + in the smbpasswd file.

    • N - This means the account has no password (the passwords in the fields LANMAN Password Hash and NT Password Hash are ignored). Note that this - will only allow users to log on with no password if the - null passwords parameter is set in the - smb.conf - 5 config file. - - D - This means the account - is disabled and no SMB/CIFS logins will be allowed for this user. - - W - This means this account + will only allow users to log on with no password if the + null passwords parameter is set in the + smb.conf(5) config file.

    • D - This means the account + is disabled and no SMB/CIFS logins will be allowed for this user.

    • W - This means this account is a "Workstation Trust" account. This kind of account is used in the Samba PDC code stream to allow Windows NT Workstations - and Servers to join a Domain hosted by a Samba PDC. - - - - Other flags may be added as the code is extended in future. - The rest of this field space is filled in with spaces. - - - - - - Last Change Time - This field consists of the time the account was + and Servers to join a Domain hosted by a Samba PDC.

    Other flags may be added as the code is extended in future. + The rest of this field space is filled in with spaces.

    Last Change Time

    This field consists of the time the account was last modified. It consists of the characters 'LCT-' (standing for "Last Change Time") followed by a numeric encoding of the UNIX time in seconds since the epoch (1970) that the last change was made. - - - - - All other colon separated fields are ignored at this time. - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - SEE ALSO - smbpasswd - 8, Samba - 7, and +

    All other colon separated fields are ignored at this time.

    VERSION

    This man page is correct for version 3.0 of + the Samba suite.

    SEE ALSO

    smbpasswd(8), Samba(7), and the Internet RFC1321 for details on the MD4 algorithm. - - - - - AUTHOR - - The original Samba software and related utilities +

    AUTHOR

    The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

    The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 - for Samba 3.0 was done by Alexander Bokovoy. - - - + for Samba 3.0 was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/smbpasswd.8.html b/docs/htmldocs/smbpasswd.8.html index f74e0b330a..73feaecf14 100644 --- a/docs/htmldocs/smbpasswd.8.html +++ b/docs/htmldocs/smbpasswd.8.html @@ -127,7 +127,7 @@ has been configured to use the experimental --with-ldapsam option. The -w switch is used to specify the password to be used with the - ldap admin dn. Note that the password is stored in + ldap admin dn. Note that the password is stored in the secrets.tdb and is keyed off of the admin's DN. This means that if the value of ldap admin dn ever changes, the password will need to be diff --git a/docs/htmldocs/smbsh.1.html b/docs/htmldocs/smbsh.1.html index 1fce592ae6..c9feebe01b 100644 --- a/docs/htmldocs/smbsh.1.html +++ b/docs/htmldocs/smbsh.1.html @@ -33,7 +33,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

    Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

    -R <name resolve order>

    This option is used to determine what naming services and in what order to resolve host names to IP addresses. The option takes a space-separated @@ -66,9 +66,9 @@ resolution methods as it depends on the target host being on a locally connected subnet.

    If this parameter is not set then the name resolve order defined in the smb.conf file parameter -(name resolve order) will be used. +(name resolve order) will be used.

    The default order is lmhosts, host, wins, bcast. Without -this parameter or any entry in the name resolve order parameter of the smb.conf file, the name +this parameter or any entry in the name resolve order parameter of the smb.conf file, the name resolution methods will be attempted in this order.

    -L libdir

    This parameter specifies the location of the shared libraries used by smbsh. The default value is specified at compile time. diff --git a/docs/htmldocs/smbstatus.1.html b/docs/htmldocs/smbstatus.1.html index 44fa5d41a1..99b152e75c 100644 --- a/docs/htmldocs/smbstatus.1.html +++ b/docs/htmldocs/smbstatus.1.html @@ -1,200 +1,42 @@ - - - %globalentities; - ]> - - - - smbstatus - 1 - - - - - smbstatus - report on current Samba connections - - - - - smbstatus - -P - -b - -d <debug level> - -v - -L - -B - -p - -S - -s <configuration file> - -u <username> - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - smbstatus is a very simple program to - list the current Samba connections. - - - - OPTIONS - - - - -P|--profile - If samba has been compiled with the +smbstatus

    Name

    smbstatus — report on current Samba connections

    Synopsis

    smbstatus [-P] [-b] [-d <debug level>] [-v] [-L] [-B] [-p] [-S] [-s <configuration file>] [-u <username>]

    DESCRIPTION

    This tool is part of the Samba(7) suite.

    smbstatus is a very simple program to + list the current Samba connections.

    OPTIONS

    -P|--profile

    If samba has been compiled with the profiling option, print only the contents of the profiling - shared memory area. - - - - -b|--brief - gives brief output. - - - - - --V -Prints the version number for -smbd. - - - --s <configuration file> -The file specified contains the + shared memory area.

    -b|--brief

    gives brief output.

    -V

    Prints the version number for +smbd.

    -s <configuration file>

    The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - --d|--debug=debuglevel - -debuglevel is an integer +compile time.

    -d|--debug=debuglevel

    debuglevel is an integer from 0 to 10. The default value if this parameter is -not specified is zero. - -The higher this value, the more detail will be +not specified is zero.

    The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of -information about operations carried out. - -Levels above 1 will generate considerable +information about operations carried out.

    Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log -data, most of which is extremely cryptic. - -Note that specifying this parameter here will -override the log levellog level parameter -in the smb.conf file. - - - - --l|--logfile=logbasename -File name for log/debug files. The extension -".client" will be appended. The log file is +data, most of which is extremely cryptic.

    Note that specifying this parameter here will +override the log level parameter +in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension +".client" will be appended. The log file is never removed by the client. - - - - - - -v|--verbose - gives verbose output. - - - - - -L|--locks - causes smbstatus to only list locks. - - - - - - -B|--byterange - causes smbstatus to include byte range locks. - - - - - - -p|--processes - print a list of smbd - 8 processes and exit. - Useful for scripting. - - - - - -S|--shares - causes smbstatus to only list shares. - - - - - --h|--help -Print a summary of command line options. - - - - - -u|--user=<username> - selects information relevant to - username only. - - - - - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - SEE ALSO - smbd - 8 and smb.conf - 5. - - - - AUTHOR - - The original Samba software and related utilities +

    -v|--verbose

    gives verbose output.

    -L|--locks

    causes smbstatus to only list locks.

    -B|--byterange

    causes smbstatus to include byte range locks. +

    -p|--processes

    print a list of smbd(8) processes and exit. + Useful for scripting.

    -S|--shares

    causes smbstatus to only list shares.

    -h|--help

    Print a summary of command line options. +

    -u|--user=<username>

    selects information relevant to + username only.

    VERSION

    This man page is correct for version 3.0 of + the Samba suite.

    SEE ALSO

    smbd(8) and smb.conf(5).

    AUTHOR

    The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

    The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 - for Samba 3.0 was done by Alexander Bokovoy. - - - + for Samba 3.0 was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/smbtar.1.html b/docs/htmldocs/smbtar.1.html index 962b2a82e0..30058d1860 100644 --- a/docs/htmldocs/smbtar.1.html +++ b/docs/htmldocs/smbtar.1.html @@ -1,238 +1,39 @@ - - - %globalentities; - ]> - - - - smbtar - 1 - - - - - smbtar - shell script for backing up SMB/CIFS shares - directly to UNIX tape drives - - - - - smbtar - -r - -i - -a - -v - -s server - -p password - -x services - -X - -N filename - -b blocksize - -d directory - -l loglevel - -u user - -t tape - filenames - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - smbtar is a very small shell script on top - of smbclient1 - which dumps SMB shares directly to tape. - - - - OPTIONS - - - - -s server - The SMB/CIFS server that the share resides - upon. - - - - - -x service - The share name on the server to connect to. - The default is "backup". - - - - - -X - Exclude mode. Exclude filenames... from tar - create or restore. - - - - - - -d directory - Change to initial directory - before restoring / backing up files. - - - - - - -v - Verbose mode. - - - - - - -p password - The password to use to access a share. - Default: none - - - - - -u user - The user id to connect as. Default: - UNIX login name. - - - - - -a - Reset DOS archive bit mode to - indicate file has been archived. - - - - -t tape - Tape device. May be regular file or tape - device. Default: $TAPE environmental - variable; if not set, a file called tar.out - . - - - - - -b blocksize - Blocking factor. Defaults to 20. See - tar(1) for a fuller explanation. - - - - - -N filename - Backup only files newer than filename. Could +smbtar

    Name

    smbtar — shell script for backing up SMB/CIFS shares + directly to UNIX tape drives

    Synopsis

    smbtar [-r] [-i] [-a] [-v] {-s server} [-p password] [-x services] [-X] [-N filename] [-b blocksize] [-d directory] [-l loglevel] [-u user] [-t tape] {filenames}

    DESCRIPTION

    This tool is part of the Samba(7) suite.

    smbtar is a very small shell script on top + of smbclient(1) which dumps SMB shares directly to tape.

    OPTIONS

    -s server

    The SMB/CIFS server that the share resides + upon.

    -x service

    The share name on the server to connect to. + The default is "backup".

    -X

    Exclude mode. Exclude filenames... from tar + create or restore.

    -d directory

    Change to initial directory + before restoring / backing up files.

    -v

    Verbose mode.

    -p password

    The password to use to access a share. + Default: none

    -u user

    The user id to connect as. Default: + UNIX login name.

    -a

    Reset DOS archive bit mode to + indicate file has been archived.

    -t tape

    Tape device. May be regular file or tape + device. Default: $TAPE environmental + variable; if not set, a file called tar.out + .

    -b blocksize

    Blocking factor. Defaults to 20. See + tar(1) for a fuller explanation.

    -N filename

    Backup only files newer than filename. Could be used (for example) on a log file to implement incremental - backups. - - - - - -i - Incremental mode; tar files are only backed + backups.

    -i

    Incremental mode; tar files are only backed up if they have the archive bit set. The archive bit is reset - after each file is read. - - - - - -r - Restore. Files are restored to the share - from the tar file. - - - - - - -l log level - Log (debug) level. Corresponds to the - -d flag of - smbclient1 - . - - - - - - - ENVIRONMENT VARIABLES - - The $TAPE variable specifies the + after each file is read.

    -r

    Restore. Files are restored to the share + from the tar file.

    -l log level

    Log (debug) level. Corresponds to the + -d flag of smbclient(1).

    ENVIRONMENT VARIABLES

    The $TAPE variable specifies the default tape device to write to. May be overridden - with the -t option. - - - - - BUGS - - The smbtar script has different - options from ordinary tar and from smbclient's tar command. - - - - - CAVEATS - - Sites that are more careful about security may not like + with the -t option.

    BUGS

    The smbtar script has different + options from ordinary tar and from smbclient's tar command.

    CAVEATS

    Sites that are more careful about security may not like the way the script handles PC passwords. Backup and restore work on entire shares; should work on file lists. smbtar works best - with GNU tar and may not work well with other versions. - - - - - DIAGNOSTICS - - See the DIAGNOSTICS section for the - smbclient1 - command. - - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - SEE ALSO - smbd - 8, - smbclient1 - , smb.conf - 5. - - - - AUTHOR - - The original Samba software and related utilities + with GNU tar and may not work well with other versions.

    DIAGNOSTICS

    See the DIAGNOSTICS section for the smbclient(1) command.

    VERSION

    This man page is correct for version 3.0 of + the Samba suite.

    AUTHOR

    The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - -Ricky Poulten - wrote the tar extension and this man page. The smbtar - script was heavily rewritten and improved by Martin Kraemer. Many + to the way the Linux kernel is developed.

    Ricky Poulten + wrote the tar extension and this man page. The smbtar + script was heavily rewritten and improved by Martin Kraemer. Many thanks to everyone who suggested extensions, improvements, bug fixes, etc. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for - Samba 3.0 was done by Alexander Bokovoy. - - - + Samba 3.0 was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/smbtree.1.html b/docs/htmldocs/smbtree.1.html index fdecb1c1c0..26120161d5 100644 --- a/docs/htmldocs/smbtree.1.html +++ b/docs/htmldocs/smbtree.1.html @@ -31,7 +31,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

    Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. diff --git a/docs/htmldocs/smbumount.8.html b/docs/htmldocs/smbumount.8.html index 0221202644..f0aa0f974d 100644 --- a/docs/htmldocs/smbumount.8.html +++ b/docs/htmldocs/smbumount.8.html @@ -1,79 +1,16 @@ - - - %globalentities; - ]> - - - - smbumount - 8 - - - - - smbumount - smbfs umount for normal users - - - - - smbumount - mount-point - - - - - DESCRIPTION - - With this program, normal users can unmount smb-filesystems, - provided that it is suid root. smbumount has +smbumount

    Name

    smbumount — smbfs umount for normal users

    Synopsis

    smbumount {mount-point}

    DESCRIPTION

    With this program, normal users can unmount smb-filesystems, + provided that it is suid root. smbumount has been written to give normal Linux users more control over their resources. It is safe to install this program suid root, because only the user who has mounted a filesystem is allowed to unmount it again. For root it is not necessary to use smbumount. The normal umount program works perfectly well, but it would certainly be problematic - to make umount setuid root. - - - - OPTIONS - - - - mount-point - The directory to unmount. - - - - - - - SEE ALSO - - smbmount - 8 - - - - - AUTHOR - - Volker Lendecke, Andrew Tridgell, Michael H. Warfield - and others. - - The current maintainer of smbfs and the userspace - tools smbmount, smbumount, - and smbmnt is Urban Widmark. - The SAMBA Mailing list + to make umount setuid root.

    OPTIONS

    mount-point

    The directory to unmount.

    SEE ALSO

    smbmount(8)

    AUTHOR

    Volker Lendecke, Andrew Tridgell, Michael H. Warfield + and others.

    The current maintainer of smbfs and the userspace + tools smbmount, smbumount, + and smbmnt is Urban Widmark. + The SAMBA Mailing list is the preferred place to ask questions regarding these programs. - - - The conversion of this manpage for Samba 2.2 was performed +

    The conversion of this manpage for Samba 2.2 was performed by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 - was done by Alexander Bokovoy. - - - + was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/speed.html b/docs/htmldocs/speed.html new file mode 100644 index 0000000000..47f19abb70 --- /dev/null +++ b/docs/htmldocs/speed.html @@ -0,0 +1,140 @@ +Chapter 39. Samba Performance Tuning

    Chapter 39. Samba Performance Tuning

    Paul Cochrane

    Dundee Limb Fitting Centre

    Jelmer R. Vernooij

    The Samba Team

    John H. Terpstra

    Samba Team

    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. +

    Socket options

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

    +The socket options that Samba uses are settable both on the command +line with the -O option, or in the smb.conf file. +

    +The socket options section of the smb.conf manual page describes how +to set these and gives recommendations. +

    +Getting the socket options right can make a big difference to your +performance, but getting them wrong can degrade it by just as +much. The correct settings are very dependent on your local network. +

    +The socket option TCP_NODELAY is the one that seems to make the +biggest single difference for most networks. Many people report that +adding socket options = TCP_NODELAY doubles the read +performance of a Samba drive. The best explanation I have seen for this is +that the Microsoft TCP/IP stack is slow in sending tcp ACKs. +

    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 several of the SMB commands (currently SMBwrite, SMBwriteX and +SMBreadbraw) is larger than this value then the server begins writing +the data before it has received the whole packet from the network, or +in the case of SMBreadbraw, it begins writing to the network before +all the data has been read from disk. +

    +This overlapping works best when the speeds of disk and network access +are similar, having very little effect when the speed of one is much +greater than the other. +

    +The default value is 16384, but very little experimentation has been +done yet to determine the optimal value, and it is likely that the best +value will vary greatly between systems anyway. A value over 65536 is +pointless and will cause you to allocate memory unnecessarily. +

    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 +maximum size that Samba will negotiate using the max xmit option +in smb.conf. Note that this is the maximum size of SMB requests that +Samba will accept, but not the maximum size that the *client* will accept. +The client maximum receive size is sent to Samba by the client and Samba +honours this limit. +

    +It defaults to 65536 bytes (the maximum), but it is possible that some +clients may perform better with a smaller transmit unit. Trying values +of less than 2048 is likely to cause severe problems. +

    +In most cases the default is the best option. +

    Log level

    +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. +

    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. +

    +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. +

    Write raw

    +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. +

    Slow Logins

    +Slow logins are almost always due to the password checking time. Using +the lowest practical password level will improve things. +

    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. Check the sections on the various clients in +Samba and Other Clients. +

    Samba performance problem due changing kernel

    +Hi everyone. I am running Gentoo on my server and samba 2.2.8a. Recently +I changed kernel version from linux-2.4.19-gentoo-r10 to +linux-2.4.20-wolk4.0s. And now I have performance issue with samba. Ok +many of you will probably say that move to vanilla sources...well I tried +it too and it didn't work. I have 100mb LAN and two computers (linux + +Windows2000). Linux server shares directory with DivX files, client +(windows2000) plays them via LAN. Before when I was running 2.4.19 kernel +everything was fine, but now movies freezes and stops...I tried moving +files between server and Windows and it's terribly slow. +

    +Grab mii-tool and check the duplex settings on the NIC. +My guess is that it is a link layer issue, not an application +layer problem. Also run ifconfig and verify that the framing +error, collisions, etc... look normal for ethernet. +

    Corrupt tdb Files

    +Well today it happened, Our first major problem using samba. +Our samba PDC server has been hosting 3 TB of data to our 500+ users +[Windows NT/XP] for the last 3 years using samba, no problem. +But today all shares went SLOW; very slow. Also the main smbd kept +spawning new processes so we had 1600+ running smbd's (normally we avg. 250). +It crashed the SUN E3500 cluster twice. After a lot of searching I +decided to rm /var/locks/*.tdb. Happy again. +

    +Q1) Is there any method of keeping the *.tdb files in top condition or +how to early detect corruption? +

    +A1) Yes, run tdbbackup each time after stopping nmbd and before starting nmbd. +

    +Q2) What I also would like to mention is that the service latency seems +a lot lower then before the locks cleanup, any ideas on keeping it top notch? +

    +A2) Yes! Same answer as for Q1! +

    diff --git a/docs/htmldocs/swat.8.html b/docs/htmldocs/swat.8.html index 77027d0cda..33e595e0c3 100644 --- a/docs/htmldocs/swat.8.html +++ b/docs/htmldocs/swat.8.html @@ -1,287 +1,85 @@ - - - %globalentities; - ]> - - - - swat - 8 - - - - - swat - Samba Web Administration Tool - - - - - swat - -s <smb config file> - -a - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - - swat allows a Samba administrator to - configure the complex smb.conf - 5 file via a Web browser. In addition, - a swat configuration page has help links - to all the configurable options in the smb.conf file allowing an - administrator to easily look up the effects of any change. - - swat is run from inetd - - - - - OPTIONS - - - - -s smb configuration file - The default configuration file path is +swat

    Name

    swat — Samba Web Administration Tool

    Synopsis

    swat [-s <smb config file>] [-a]

    DESCRIPTION

    This tool is part of the Samba(7) suite.

    swat allows a Samba administrator to + configure the complex smb.conf(5) file via a Web browser. In addition, + a swat configuration page has help links + to all the configurable options in the smb.conf file allowing an + administrator to easily look up the effects of any change.

    swat is run from inetd

    OPTIONS

    -s smb configuration file

    The default configuration file path is determined at compile time. The file specified contains - the configuration details required by the smbd - 8 server. This is the file - that swat will modify. + the configuration details required by the smbd(8) server. This is the file + that swat will modify. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide. - See smb.conf for more information. - - - - - - -a - This option disables authentication and puts - swat in demo mode. In that mode anyone will be able to modify - the smb.conf file. - - WARNING: Do NOT enable this option on a production - server. - - - - - --V -Prints the version number for -smbd. - - - --s <configuration file> -The file specified contains the + See smb.conf for more information. +

    -a

    This option disables authentication and puts + swat in demo mode. In that mode anyone will be able to modify + the smb.conf file.

    WARNING: Do NOT enable this option on a production + server.

    -V

    Prints the version number for +smbd.

    -s <configuration file>

    The file specified contains the configuration details required by the server. The information in this file includes server-specific information such as what printcap file to use, as well as descriptions of all the services that the server is -to provide. See smb.conf for more information. +to provide. See smb.conf for more information. The default configuration file name is determined at -compile time. - - - --d|--debug=debuglevel - -debuglevel is an integer +compile time.

    -d|--debug=debuglevel

    debuglevel is an integer from 0 to 10. The default value if this parameter is -not specified is zero. - -The higher this value, the more detail will be +not specified is zero.

    The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day to day running - it generates a small amount of -information about operations carried out. - -Levels above 1 will generate considerable +information about operations carried out.

    Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log -data, most of which is extremely cryptic. - -Note that specifying this parameter here will -override the log levellog level parameter -in the smb.conf file. - - - - --l|--logfile=logbasename -File name for log/debug files. The extension -".client" will be appended. The log file is +data, most of which is extremely cryptic.

    Note that specifying this parameter here will +override the log level parameter +in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension +".client" will be appended. The log file is never removed by the client. - - - - - --h|--help -Print a summary of command line options. - - - - - - - - - - INSTALLATION - - Swat is included as binary package with most distributions. The +

    -h|--help

    Print a summary of command line options. +

    INSTALLATION

    Swat is included as binary package with most distributions. The package manager in this case takes care of the installation and configuration. This section is only for those who have compiled swat from scratch. - - - After you compile SWAT you need to run make install - to install the swat binary +

    After you compile SWAT you need to run make install + to install the swat binary and the various help files and images. A default install would put - these in: - - - /usr/local/samba/bin/swat - /usr/local/samba/swat/images/* - /usr/local/samba/swat/help/* - - - - Inetd Installation - - You need to edit your /etc/inetd.conf - and /etc/services - to enable SWAT to be launched via inetd. - - In /etc/services you need to - add a line like this: - - swat 901/tcp - - Note for NIS/YP and LDAP users - you may need to rebuild the - NIS service maps rather than alter your local - /etc/services file. - - the choice of port number isn't really important + these in:

    • /usr/local/samba/bin/swat

    • /usr/local/samba/swat/images/*

    • /usr/local/samba/swat/help/*

    Inetd Installation

    You need to edit your /etc/inetd.conf + and /etc/services + to enable SWAT to be launched via inetd.

    In /etc/services you need to + add a line like this:

    swat 901/tcp

    Note for NIS/YP and LDAP users - you may need to rebuild the + NIS service maps rather than alter your local + /etc/services file.

    the choice of port number isn't really important except that it should be less than 1024 and not currently used (using a number above 1024 presents an obscure security hole depending on the implementation details of your - inetd daemon). - - In /etc/inetd.conf you should - add a line like this: - - swat stream tcp nowait.400 root - /usr/local/samba/bin/swat swat - - One you have edited /etc/services - and /etc/inetd.conf you need to send a - HUP signal to inetd. To do this use kill -1 PID - where PID is the process ID of the inetd daemon. - - - - - - - - - LAUNCHING - - To launch SWAT just run your favorite web browser and - point it at "http://localhost:901/". - - Note that you can attach to SWAT from any IP connected + inetd daemon).

    In /etc/inetd.conf you should + add a line like this:

    swat stream tcp nowait.400 root + /usr/local/samba/bin/swat swat

    One you have edited /etc/services + and /etc/inetd.conf you need to send a + HUP signal to inetd. To do this use kill -1 PID + where PID is the process ID of the inetd daemon.

    LAUNCHING

    To launch SWAT just run your favorite web browser and + point it at "http://localhost:901/".

    Note that you can attach to SWAT from any IP connected machine but connecting from a remote machine leaves your connection open to password sniffing as passwords will be sent - in the clear over the wire. - - - - FILES - - - - /etc/inetd.conf - This file must contain suitable startup - information for the meta-daemon. - - - - /etc/services - This file must contain a mapping of service name + in the clear over the wire.

    FILES

    /etc/inetd.conf

    This file must contain suitable startup + information for the meta-daemon.

    /etc/services

    This file must contain a mapping of service name (e.g., swat) to service port (e.g., 901) and protocol type - (e.g., tcp). - - - - /usr/local/samba/lib/smb.conf - This is the default location of the - smb.conf5 - server configuration file that swat edits. Other - common places that systems install this file are - /usr/samba/lib/smb.conf and /etc/smb.conf - . This file describes all the services the server - is to make available to clients. - - - - - - - WARNINGS - - swat will rewrite your - smb.conf5 - file. It will rearrange the entries and delete all - comments, include= and copy= - options. If you have a carefully crafted - smb.conf then back it up or don't use swat! - - - - - VERSION - - This man page is correct for version 3.0 of the Samba suite. - - - - SEE ALSO - inetd(5), - smbd8 - , smb.conf - 5 - - - - AUTHOR - - The original Samba software and related utilities + (e.g., tcp).

    /usr/local/samba/lib/smb.conf

    This is the default location of the smb.conf(5) server configuration file that swat edits. Other + common places that systems install this file are + /usr/samba/lib/smb.conf and /etc/smb.conf + . This file describes all the services the server + is to make available to clients.

    WARNINGS

    swat will rewrite your smb.conf(5) file. It will rearrange the entries and delete all + comments, include= and copy= + options. If you have a carefully crafted + smb.conf then back it up or don't use swat!

    VERSION

    This man page is correct for version 3.0 of the Samba suite.

    SEE ALSO

    inetd(5), smbd(8), smb.conf(5)

    AUTHOR

    The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

    The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for - Samba 3.0 was done by Alexander Bokovoy. - - - + Samba 3.0 was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/testparm.1.html b/docs/htmldocs/testparm.1.html index 03adba0f38..3732b53f4c 100644 --- a/docs/htmldocs/testparm.1.html +++ b/docs/htmldocs/testparm.1.html @@ -1,203 +1,51 @@ - - - %globalentities; - ]> - - - - testparm - 1 - - - - - testparm - check an smb.conf configuration file for - internal correctness - - - - - testparm - -s - -h - -v - -L <servername> - -t <encoding> - config filename - hostname hostIP - - - - - DESCRIPTION - - This tool is part of the Samba - 7 suite. - - testparm is a very simple test program - to check an smbd - 8 configuration file for +testparm

    Name

    testparm — check an smb.conf configuration file for + internal correctness

    Synopsis

    testparm [-s] [-h] [-v] [-L <servername>] [-t <encoding>] {config filename} [hostname hostIP]

    DESCRIPTION

    This tool is part of the Samba(7) suite.

    testparm is a very simple test program + to check an smbd(8) configuration file for internal correctness. If this program reports no problems, you - can use the configuration file with confidence that smbd - will successfully load the configuration file. - - - Note that this is NOT a guarantee that + can use the configuration file with confidence that smbd + will successfully load the configuration file.

    Note that this is NOT a guarantee that the services specified in the configuration file will be - available or will operate as expected. - - If the optional host name and host IP address are + available or will operate as expected.

    If the optional host name and host IP address are specified on the command line, this test program will run through the service entries reporting whether the specified host - has access to each service. - - If testparm finds an error in the - smb.conf file it returns an exit code of 1 to the calling + has access to each service.

    If testparm finds an error in the + smb.conf file it returns an exit code of 1 to the calling program, else it returns an exit code of 0. This allows shell scripts - to test the output from testparm. - - - - OPTIONS - - - - -s - Without this option, testparm + to test the output from testparm.

    OPTIONS

    -s

    Without this option, testparm will prompt for a carriage return after printing the service - names and before dumping the service definitions. - - - - --h|--help -Print a summary of command line options. - - - - --V -Prints the version number for -smbd. - - - - -L servername - Sets the value of the %L macro to servername. + names and before dumping the service definitions.

    -h|--help

    Print a summary of command line options. +

    -V

    Prints the version number for +smbd.

    -L servername

    Sets the value of the %L macro to servername. This is useful for testing include files specified with the - %L macro. - - - - -v - If this option is specified, testparm - will also output all options that were not used in - smb.conf5 - and are thus set to their defaults. - - - - -t encoding - + %L macro.

    -v

    If this option is specified, testparm + will also output all options that were not used in smb.conf(5) and are thus set to their defaults.

    -t encoding

    Output data in specified encoding. - - - - - configfilename - This is the name of the configuration file +

    configfilename

    This is the name of the configuration file to check. If this parameter is not present then the - default smb.conf5 - file will be checked. - - - - - - hostname - If this parameter and the following are - specified, then testparm will examine the hosts - allow and hosts deny - parameters in the - smb.conf5 - file to + default smb.conf(5) file will be checked. +

    hostname

    If this parameter and the following are + specified, then testparm will examine the hosts + allow and hosts deny + parameters in the smb.conf(5) file to determine if the hostname with this IP address would be - allowed access to the smbd server. If + allowed access to the smbd server. If this parameter is supplied, the hostIP parameter must also - be supplied. - - - - - hostIP - This is the IP address of the host specified + be supplied.

    hostIP

    This is the IP address of the host specified in the previous parameter. This address must be supplied - if the hostname parameter is supplied. - - - - - - FILES - - - - smb.conf5 - - This is usually the name of the configuration - file used by smbd8 - . - - - - - - - DIAGNOSTICS - - The program will issue a message saying whether the + if the hostname parameter is supplied.

    FILES

    smb.conf(5)

    This is usually the name of the configuration + file used by smbd(8). +

    DIAGNOSTICS

    The program will issue a message saying whether the configuration file loaded OK or not. This message may be preceded by errors and warnings if the file did not load. If the file was loaded OK, the program then dumps all known service details - to stdout. - - - - - VERSION - - This man page is correct for version 3.0 of - the Samba suite. - - - - SEE ALSO - - smb.conf5 - , - smbd8 - - - - - AUTHOR - - The original Samba software and related utilities + to stdout.

    VERSION

    This man page is correct for version 3.0 of + the Samba suite.

    AUTHOR

    The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar - to the way the Linux kernel is developed. - - The original Samba man pages were written by Karl Auer. + to the way the Linux kernel is developed.

    The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another - excellent piece of Open Source software, available at - ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 + excellent piece of Open Source software, available at + ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 - for Samba 3.0 was done by Alexander Bokovoy. - - - + for Samba 3.0 was done by Alexander Bokovoy.

    diff --git a/docs/htmldocs/troubleshooting.html b/docs/htmldocs/troubleshooting.html new file mode 100644 index 0000000000..d18399caeb --- /dev/null +++ b/docs/htmldocs/troubleshooting.html @@ -0,0 +1 @@ +Part V. Troubleshooting diff --git a/docs/htmldocs/type.html b/docs/htmldocs/type.html new file mode 100644 index 0000000000..5322995de4 --- /dev/null +++ b/docs/htmldocs/type.html @@ -0,0 +1,5 @@ +Part II. Server Configuration Basics

    Server Configuration Basics

    First Steps in Server Configuration

    +Samba can operate in various modes within SMB networks. This HOWTO section contains information on +configuring samba to function as the type of server your network requires. Please read this +section carefully. +

    Table of Contents

    4. Server Types and Security Modes
    Features and Benefits
    Server Types
    Samba Security Modes
    User Level Security
    Share Level Security
    Domain Security Mode (User Level Security)
    ADS Security Mode (User Level Security)
    Server Security (User Level Security)
    Password checking
    Common Errors
    What makes Samba a SERVER?
    What makes Samba a Domain Controller?
    What makes Samba a Domain Member?
    Constantly Losing Connections to Password Server
    5. Domain Control
    Features and Benefits
    Basics of Domain Control
    Domain Controller Types
    Preparing for Domain Control
    Domain Control - Example Configuration
    Samba ADS Domain Control
    Domain and Network Logon Configuration
    Domain Network Logon Service
    Security Mode and Master Browsers
    Common Errors
    '$' cannot be included in machine name
    Joining domain fails because of existing machine account
    The system can not log you on (C000019B)....
    The machine trust account not accessible
    Account disabled
    Domain Controller Unavailable
    Can not log onto domain member workstation after joining domain
    6. Backup Domain Control
    Features And Benefits
    Essential Background Information
    MS Windows NT4 Style Domain Control
    Active Directory Domain Control
    What qualifies a Domain Controller on the network?
    How does a Workstation find its domain controller?
    Backup Domain Controller Configuration
    Example Configuration
    Common Errors
    Machine Accounts keep expiring, what can I do?
    Can Samba be a Backup Domain Controller to an NT4 PDC?
    How do I replicate the smbpasswd file?
    Can I do this all with LDAP?
    7. Domain Membership
    Features and Benefits
    MS Windows Workstation/Server Machine Trust Accounts
    Manual Creation of Machine Trust Accounts
    Using NT4 Server Manager to Add Machine Accounts to the Domain
    "On-the-Fly" Creation of Machine Trust Accounts
    Making an MS Windows Workstation or Server a Domain Member
    Domain Member Server
    Joining an NT4 type Domain with Samba-3
    Why is this better than security = server?
    Samba ADS Domain Membership
    Setup your smb.conf
    Setup your /etc/krb5.conf
    Create the computer account
    Test your server setup
    Testing with smbclient
    Notes
    Common Errors
    Can Not Add Machine Back to Domain
    Adding Machine to Domain Fails
    I can't join a Windows 2003 PDC
    8. Stand-Alone Servers
    Features and Benefits
    Background
    Example Configuration
    Reference Documentation Server
    Central Print Serving
    Common Errors
    9. MS Windows Network Configuration Guide
    Note
    diff --git a/docs/htmldocs/unicode.html b/docs/htmldocs/unicode.html new file mode 100644 index 0000000000..a4f568576d --- /dev/null +++ b/docs/htmldocs/unicode.html @@ -0,0 +1,67 @@ +Chapter 27. Unicode/Charsets

    Chapter 27. Unicode/Charsets

    Jelmer R. Vernooij

    The Samba Team

    TAKAHASHI Motonobu

    25 March 2003

    Features and Benefits

    +Every industry eventually matures. One of the great areas of maturation is in +the focus that has been given over the past decade to make it possible for anyone +anywhere to use a computer. It has not always been that way, in fact, not so long +ago it was common for software to be written for exclusive use in the country of +origin. +

    +Of all the effort that has been brought to bear on providing native language support +for all computer users, the efforts of the Openi18n organisation is deserving of +special mention. +

    +Samba-2.x supported a single locale through a mechanism called +codepages. Samba-3 is destined to become a truly trans-global +file and printer sharing platform. +

    What are charsets and unicode?

    +Computers communicate in numbers. In texts, each number will be +translated to a corresponding letter. The meaning that will be assigned +to a certain number depends on the character set(charset) + that is used. +A charset can be seen as a table that is used to translate numbers to +letters. Not all computers use the same charset (there are charsets +with German umlauts, Japanese characters, etc). Usually a charset contains +256 characters, which means that storing a character with it takes +exactly one byte.

    +There are also charsets that support even more characters, +but those need twice(or even more) as much storage space. These +charsets can contain 256 * 256 = 65536 characters, which +is more then all possible characters one could think of. They are called +multibyte charsets (because they use more then one byte to +store one character). +

    + A standardised multibyte charset is unicode. +A big advantage of using a multibyte charset is that you only need one; there +is no need to make sure two computers use the same charset when they are +communicating. +

    Old windows clients use single-byte charsets, named +'codepages' by Microsoft. However, there is no support for +negotiating the charset to be used in the smb protocol. Thus, you +have to make sure you are using the same charset when talking to an older client. +Newer clients (Windows NT, 2K, XP) talk unicode over the wire. +

    Samba and charsets

    +As of samba 3.0, samba can (and will) talk unicode over the wire. Internally, +samba knows of three kinds of character sets: +

    unix charset

    + This is the charset used internally by your operating system. + The default is UTF-8, which is fine for most + systems. The default in previous samba releases was ASCII. +

    display charset

    This is the charset samba will use to print messages + on your screen. It should generally be the same as the unix charset. +

    dos charset

    This is the charset samba uses when communicating with + DOS and Windows 9x clients. It will talk unicode to all newer clients. + The default depends on the charsets you have installed on your system. + Run testparm -v | grep "dos charset" to see + what the default is on your system. +

    Conversion from old names

    Because previous samba versions did not do any charset conversion, +characters in filenames are usually not correct in the unix charset but only +for the local charset used by the DOS/Windows clients.

    Bjoern Jacke has written a utility named convm that can convert whole directory + structures to different charsets with one single command. +

    Japanese charsets

    Samba doesn't work correctly with Japanese charsets yet. Here are +points of attention when setting it up:

    • You should set mangling method = hash

    • There are various iconv() implementations around and not +all of them work equally well. glibc2's iconv() has a critical problem +in CP932. libiconv-1.8 works with CP932 but still has some problems and +does not work with EUC-JP.

    • You should set dos charset = CP932, not +Shift_JIS, SJIS...

    • Currently only unix charset = CP932 +will work (but still has some problems...) because of iconv() issues. +unix charset = EUC-JP doesn't work well because of +iconv() issues.

    • Currently Samba 3.0 does not support unix charset = UTF8-MAC/CAP/HEX/JIS*

    More information (in Japanese) is available at: http://www.atmarkit.co.jp/flinux/special/samba3/samba3a.html.

    Common errors

    CP850.so can't be found

    Samba is complaining about a missing CP850.so file”.

    CP850 is the default dos charset. The dos charset is used to convert data to the codepage used by your dos clients. If you don't have any dos clients, you can safely ignore this message.

    CP850 should be supported by your local iconv implementation. Make sure you have all the required packages installed. If you compiled samba from source, make sure configure found iconv.

    diff --git a/docs/htmldocs/upgrading-to-3.0.html b/docs/htmldocs/upgrading-to-3.0.html new file mode 100644 index 0000000000..e7c1c61234 --- /dev/null +++ b/docs/htmldocs/upgrading-to-3.0.html @@ -0,0 +1,176 @@ +Chapter 30. Upgrading from Samba-2.x to Samba-3.0.0

    Chapter 30. Upgrading from Samba-2.x to Samba-3.0.0

    Jelmer R. Vernooij

    The Samba Team

    John H. Terpstra

    Samba Team

    Gerald (Jerry) Carter

    Samba Team

    June 30, 2003

    New Features in Samba-3

    +Major new features: +

    1. + Active Directory support. This release is able to join a ADS realm + as a member server and authenticate users using LDAP/kerberos. +

    2. + Unicode support. Samba will now negotiate UNICODE on the wire and + internally there is now a much better infrastructure for multi-byte + and UNICODE character sets. +

    3. + New authentication system. The internal authentication system has + been almost completely rewritten. Most of the changes are internal, + but the new auth system is also very configurable. +

    4. + New filename mangling system. The filename mangling system has been + completely rewritten. An internal database now stores mangling maps + persistently. This needs lots of testing. +

    5. + New "net" command. A new "net" command has been added. It is + somewhat similar to the "net" command in windows. Eventually we + plan to replace a bunch of other utilities (such as smbpasswd) + with subcommands in "net", at the moment only a few things are + implemented. +

    6. + Samba now negotiates NT-style status32 codes on the wire. This + improves error handling a lot. +

    7. + Better Windows 2000/XP/2003 printing support including publishing + printer attributes in active directory +

    8. + New loadable RPC modules +

    9. + New dual-daemon winbindd support (-B) for better performance +

    10. + Support for migrating from a Windows NT 4.0 domain to a Samba + domain and maintaining user, group and domain SIDs +

    11. + Support for establishing trust relationships with Windows NT 4.0 + domain controllers +

    12. + Initial support for a distributed Winbind architecture using + an LDAP directory for storing SID to uid/gid mappings +

    13. + Major updates to the Samba documentation tree. +

    +Plus lots of other improvements! +

    Configuration Parameter Changes

    +This section contains a brief listing of changes to smb.conf options +in the 3.0.0 release. Please refer to the smb.conf(5) man page for +complete descriptions of new or modified parameters. +

    Removed Parameters

    (order alphabetically):

    • admin log

    • alternate permissions

    • character set

    • client codepage

    • code page directory

    • coding system

    • domain admin group

    • domain guest group

    • force unknown acl user

    • nt smb support

    • post script

    • printer driver

    • printer driver file

    • printer driver location

    • status

    • total print jobs

    • use rhosts

    • valid chars

    • vfs options

    New Parameters

    (new parameters have been grouped by function):

    Remote management

    • abort shutdown script

    • shutdown script

    User and Group Account Management

    • add group script

    • add machine script

    • add user to group script

    • algorithmic rid base

    • delete group script

    • delete user from group script

    • passdb backend

    • set primary group script

    Authentication

    • auth methods

    • ads server

    • realm

    Protocol Options

    • client lanman auth

    • client NTLMv2 auth

    • client schannel

    • client signing

    • client use spnego

    • disable netbios

    • ntlm auth

    • paranoid server security

    • server schannel

    • smb ports

    • use spnego

    File Service

    • get quota command

    • hide special files

    • hide unwriteable files

    • hostname lookups

    • kernel change notify

    • mangle prefix

    • msdfs proxy

    • set quota command

    • use sendfile

    • vfs objects

    Printing

    • max reported print jobs

    UNICODE and Character Sets

    • display charset

    • dos charset

    • unicode

    • unix charset

    SID to uid/gid Mappings

    • idmap backend

    • idmap gid

    • idmap only

    • idmap uid

    LDAP

    • ldap delete dn

    • ldap group suffix

    • ldap idmap suffix

    • ldap machine suffix

    • ldap passwd sync

    • ldap trust ids

    • ldap user suffix

    General Configuration

    • preload modules

    • privatedir

    Modified Parameters (changes in behavior):

    • encrypt passwords (enabled by default)

    • mangling method (set to 'hash2' by default)

    • passwd chat

    • passwd program

    • restrict anonymous (integer value)

    • security (new 'ads' value)

    • strict locking (enabled by default)

    • winbind cache time (increased to 5 minutes)

    • winbind uid (deprecated in favor of 'idmap uid')

    • winbind gid (deprecated in favor of 'idmap gid')

    New Functionality

    Databases

    + This section contains brief descriptions of any new databases + introduced in Samba 3.0. Please remember to backup your existing + ${lock directory}/*tdb before upgrading to Samba 3.0. Samba will + upgrade databases as they are opened (if necessary), but downgrading + from 3.0 to 2.2 is an unsupported path. +

    Table 30.1. TDB File Descriptions

    NameDescriptionBackup?
    account_policyUser policy settingsyes
    gencacheGeneric caching dbno
    group_mapping

    Mapping table from Windows groups/SID to unix groups

    yes
    idmap

    new ID map table from SIDS to UNIX uids/gids

    yes
    namecacheName resolution cache entriesno
    netlogon_unigrp

    Cache of universal group membership obtained when operating + as a member of a Windows domain

    no
    printing/*.tdb

    Cached output from 'lpq command' created on a per print + service basis

    no
    registry

    Read-only samba registry skeleton that provides support for + exporting various db tables via the winreg RPCs

    no

    Changes in Behavior

    + The following issues are known changes in behavior between Samba 2.2 and + Samba 3.0 that may affect certain installations of Samba. +

    1. + When operating as a member of a Windows domain, Samba 2.2 would + map any users authenticated by the remote DC to the 'guest account' + if a uid could not be obtained via the getpwnam() call. Samba 3.0 + rejects the connection as NT_STATUS_LOGON_FAILURE. There is no + current work around to re-establish the 2.2 behavior. +

    2. + When adding machines to a Samba 2.2 controlled domain, the + 'add user script' was used to create the UNIX identity of the + machine trust account. Samba 3.0 introduces a new 'add machine + script' that must be specified for this purpose. Samba 3.0 will + not fall back to using the 'add user script' in the absence of + an 'add machine script' +

    Charsets

    + You might experience problems with special characters when communicating with old DOS + clients. Codepage support has changed in samba 3.0. Read the chapter + Unicode support for details. +

    Passdb Backends and Authentication

    + There have been a few new changes that Samba administrators should be + aware of when moving to Samba 3.0. +

    1. + Encrypted passwords have been enabled by default in order to + inter-operate better with out-of-the-box Windows client + installations. This does mean that either (a) a samba account + must be created for each user, or (b) 'encrypt passwords = no' + must be explicitly defined in smb.conf. +

    2. + Inclusion of new security = ads option for integration + with an Active Directory domain using the native Windows + Kerberos 5 and LDAP protocols. +

    + Samba 3.0 also includes the possibility of setting up chains + of authentication methods + (auth methods) and account + storage backends + (passdb backend). + Please refer to the smb.conf + man page and the chapter about account information databases for details. While both parameters assume sane default + values, it is likely that you will need to understand what the + values actually mean in order to ensure Samba operates correctly. +

    + Certain functions of the smbpasswd(8) tool have been split between the + new smbpasswd(8) utility, the net(8) tool, and the new pdbedit(8) + utility. See the respective man pages for details. +

    Charsets

    + You might experience problems with special characters when communicating with old DOS + clients. Codepage support has changed in samba 3.0. Read the chapter + Unicode support for details. +

    LDAP

    + This section outlines the new features affecting Samba / LDAP integration. +

    New Schema

    + A new object class (sambaSamAccount) has been introduced to replace + the old sambaAccount. This change aids us in the renaming of attributes + to prevent clashes with attributes from other vendors. There is a + conversion script (examples/LDAP/convertSambaAccount) to modify and LDIF + file to the new schema. +

    + Example: +

    +		$ ldapsearch .... -b "ou=people,dc=..." > old.ldif
    +		$ convertSambaAccount <DOM SID> old.ldif new.ldif
    +		

    + The <DOM SID> can be obtained by running 'net getlocalsid <DOMAINNAME> + on the Samba PDC as root. +

    + The old sambaAccount schema may still be used by specifying the + "ldapsam_compat" passdb backend. However, the sambaAccount and + associated attributes have been moved to the historical section of + the schema file and must be uncommented before use if needed. + The 2.2 object class declaration for a sambaAccount has not changed + in the 3.0 samba.schema file. +

    + Other new object classes and their uses include: +

    • + sambaDomain - domain information used to allocate rids + for users and groups as necessary. The attributes are added + in 'ldap suffix' directory entry automatically if + an idmap uid/gid range has been set and the 'ldapsam' + passdb backend has been selected. +

    • + sambaGroupMapping - an object representing the + relationship between a posixGroup and a Windows + group/SID. These entries are stored in the 'ldap + group suffix' and managed by the 'net groupmap' command. +

    • + sambaUnixIdPool - created in the 'ldap idmap suffix' entry + automatically and contains the next available 'idmap uid' and + 'idmap gid' +

    • + sambaIdmapEntry - object storing a mapping between a + SID and a UNIX uid/gid. These objects are created by the + idmap_ldap module as needed. +

    New Suffix for Searching

    + The following new smb.conf parameters have been added to aid in directing + certain LDAP queries when 'passdb backend = ldapsam://...' has been + specified. +

    • ldap suffix - used to search for user and computer accounts

    • ldap user suffix - used to store user accounts

    • ldap machine suffix - used to store machine trust accounts

    • ldap group suffix - location of posixGroup/sambaGroupMapping entries

    • ldap idmap suffix - location of sambaIdmapEntry objects

    + If an 'ldap suffix' is defined, it will be appended to all of the + remaining sub-suffix parameters. In this case, the order of the suffix + listings in smb.conf is important. Always place the 'ldap suffix' first + in the list. +

    + Due to a limitation in Samba's smb.conf parsing, you should not surround + the DN's with quotation marks. +

    IdMap LDAP support

    + Samba 3.0 supports an ldap backend for the idmap subsystem. The + following options would inform Samba that the idmap table should be + stored on the directory server onterose in the "ou=idmap,dc=plainjoe, + dc=org" partition. +

    [global]
    ...
    idmap backend = ldap:ldap://onterose/
    ldap idmap suffix = ou=idmap,dc=plainjoe,dc=org
    idmap uid = 40000-50000
    idmap gid = 40000-50000

    + This configuration allows winbind installations on multiple servers to + share a uid/gid number space, thus avoiding the interoperability problems + with NFS that were present in Samba 2.2. +

    diff --git a/docs/htmldocs/vfstest.1.html b/docs/htmldocs/vfstest.1.html index 138ec374bd..561b3deb45 100644 --- a/docs/htmldocs/vfstest.1.html +++ b/docs/htmldocs/vfstest.1.html @@ -28,7 +28,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

    Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. diff --git a/docs/htmldocs/winbind.html b/docs/htmldocs/winbind.html new file mode 100644 index 0000000000..1ee1de9f2f --- /dev/null +++ b/docs/htmldocs/winbind.html @@ -0,0 +1,721 @@ +Chapter 21. Winbind: Use of Domain Accounts

    Chapter 21. Winbind: Use of Domain Accounts

    Tim Potter

    Andrew Tridgell

    Samba Team

    Naag Mummaneni

    Notes for Solaris

    John Trostel

    Jelmer R. Vernooij

    The Samba Team

    John H. Terpstra

    Samba Team

    27 June 2002

    Features and Benefits

    + Integration of UNIX and Microsoft Windows NT through a unified logon has + been considered a "holy grail" in heterogeneous computing environments for + a long time. +

    + There is one other facility without which UNIX and Microsoft Windows network + interoperability would suffer greatly. It is imperative that there be a + mechanism for sharing files across UNIX systems and to be able to assign + domain user and group ownerships with integrity. +

    + winbind is a component of the Samba suite of programs + solves the unified logon problem. Winbind uses a UNIX implementation of Microsoft + RPC calls, Pluggable Authentication Modules, and the Name Service Switch to + allow Windows NT domain users to appear and operate as UNIX users on a UNIX + machine. This chapter describes the winbind system, explaining the functionality + it provides, how it is configured, and how it works internally. +

    + Winbind provides three separate functions: +

    • + Authentication of user credentials (via PAM) +

    • + Identity resolution (via NSS)` +

    • + Windindd maintains a database called winbind_idmap.tdb in which it stores + mappings between UNIX UIDs / GIDs and NT SIDs. This mapping is used only + for users and groups that do not have a local UID/GID. It stored the UID/GID + allocated from the idmap uid/gid range that it has mapped to the NT SID. + If idmap backend has been specified as ldapsam:url + then instead of using a local mapping winbindd will obtain this information + from the LDAP database. +

    Note

    + If winbindd is not running, then smbd (which calls winbindd) will fall back to + using purely local information from /etc/passwd and /etc/group and no dynamic + mapping will be used. +

    Introduction

    It is well known that UNIX and Microsoft Windows NT have + different models for representing user and group information and + use different technologies for implementing them. This fact has + made it difficult to integrate the two systems in a satisfactory + manner.

    One common solution in use today has been to create + identically named user accounts on both the UNIX and Windows systems + and use the Samba suite of programs to provide file and print services + between the two. This solution is far from perfect however, as + adding and deleting users on both sets of machines becomes a chore + and two sets of passwords are required both of which + can lead to synchronization problems between the UNIX and Windows + systems and confusion for users.

    We divide the unified logon problem for UNIX machines into + three smaller problems:

    • Obtaining Windows NT user and group information +

    • Authenticating Windows NT users +

    • Password changing for Windows NT users +

    Ideally, a prospective solution to the unified logon problem + would satisfy all the above components without duplication of + information on the UNIX machines and without creating additional + tasks for the system administrator when maintaining users and + groups on either system. The winbind system provides a simple + and elegant solution to all three components of the unified logon + problem.

    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 + this is done the UNIX box will see NT users and groups as if + they were native UNIX users and groups, allowing the NT domain + to be used in much the same manner that NIS+ is used within + UNIX-only environments.

    The end result is that whenever any + program on the UNIX machine asks the operating system to lookup + a user or group name, the query will be resolved by asking the + NT domain controller for the specified domain to do the lookup. + Because Winbind hooks into the operating system at a low level + (via the NSS name resolution modules in the C library) this + redirection to the NT domain controller is completely + transparent.

    Users on the UNIX machine can then use NT user and group + names as they would use "native" UNIX names. They can chown files + so that they are owned by NT domain users or even login to the + UNIX machine and run a UNIX X-Window session as a domain user.

    The only obvious indication that Winbind is being used is + that user and group names take the form DOMAIN\user and + DOMAIN\group. This is necessary as it allows Winbind to determine + that redirection to a domain controller is wanted for a particular + lookup and which trusted domain is being referenced.

    Additionally, Winbind provides an authentication service + that hooks into the Pluggable Authentication Modules (PAM) system + to provide authentication via a NT domain to any PAM enabled + applications. This capability solves the problem of synchronizing + passwords between systems since all passwords are stored in a single + location (on the domain controller).

    Target Uses

    Winbind is targeted at organizations that have an + existing NT based domain infrastructure into which they wish + to put UNIX workstations or servers. Winbind will allow these + organizations to deploy UNIX workstations without having to + maintain a separate account infrastructure. This greatly + simplifies the administrative overhead of deploying UNIX + workstations into a NT based organization.

    Another interesting way in which we expect Winbind to + be used is as a central part of UNIX based appliances. Appliances + that provide file and print services to Microsoft based networks + will be able to use Winbind to provide seamless integration of + the appliance into the domain.

    How Winbind Works

    The winbind system is designed around a client/server + architecture. A long running winbindd daemon + listens on a UNIX domain socket waiting for requests + to arrive. These requests are generated by the NSS and PAM + clients and processed sequentially.

    The technologies used to implement winbind are described + in detail below.

    Microsoft Remote Procedure Calls

    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 + Windows NT machines including remote management, user authentication + and print spooling. Although initially this work was done + to aid the implementation of Primary Domain Controller (PDC) + functionality in Samba, it has also yielded a body of code which + can be used for other purposes.

    Winbind uses various MSRPC calls to enumerate domain users + and groups and to obtain detailed information about individual + users or groups. Other MSRPC calls can be used to authenticate + NT domain users and to change user passwords. By directly querying + a Windows PDC for user and group information, winbind maps the + NT account information onto UNIX user and group names.

    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. +

    Name Service Switch

    The Name Service Switch, or NSS, is a feature that is + present in many UNIX operating systems. It allows system + information such as hostnames, mail aliases and user information + to be resolved from different sources. For example, a standalone + UNIX workstation may resolve system information from a series of + flat files stored on the local filesystem. A networked workstation + may first attempt to resolve system information from local files, + and then consult a NIS database for user information or a DNS server + for hostname information.

    The NSS application programming interface allows winbind + to present itself as a source of system information when + resolving UNIX usernames and groups. Winbind uses this interface, + and information obtained from a Windows NT server using MSRPC + calls to provide a new source of account enumeration. Using standard + UNIX library calls, one can enumerate the users and groups on + a UNIX machine running winbind and see all users and groups in + a NT domain plus any trusted domain as though they were local + users and groups.

    The primary control file for NSS is + /etc/nsswitch.conf. + When a UNIX application makes a request to do a lookup + the C library looks in /etc/nsswitch.conf + for a line which matches the service type being requested, for + example the "passwd" service type is used when user or group names + are looked up. This config line specifies which implementations + of that service should be tried and in what order. If the passwd + config line is:

    +passwd: files example
    +		

    then the C library will first load a module called + /lib/libnss_files.so followed by + the module /lib/libnss_example.so. The + C library will dynamically load each of these modules in turn + and call resolver functions within the modules to try to resolve + the request. Once the request is resolved the C library returns the + result to the application.

    This NSS interface provides a very easy way for Winbind + to hook into the operating system. All that needs to be done + is to put libnss_winbind.so in /lib/ + then add "winbind" into /etc/nsswitch.conf at + the appropriate place. The C library will then call Winbind to + resolve user and group names.

    Pluggable Authentication Modules

    Pluggable Authentication Modules, also known as PAM, + is a system for abstracting authentication and authorization + technologies. With a PAM module it is possible to specify different + authentication methods for different system applications without + having to recompile these applications. PAM is also useful + for implementing a particular policy for authorization. For example, + a system administrator may only allow console logins from users + stored in the local password file but only allow users resolved from + a NIS database to log in over the network.

    Winbind uses the authentication management and password + management PAM interface to integrate Windows NT users into a + UNIX system. This allows Windows NT users to log in to a UNIX + machine and be authenticated against a suitable Primary Domain + Controller. These users can also change their passwords and have + this change take effect directly on the Primary Domain Controller. +

    PAM is configured by providing control files in the directory + /etc/pam.d/ for each of the services that + require authentication. When an authentication request is made + by an application the PAM code in the C library looks up this + control file to determine what modules to load to do the + authentication check and in what order. This interface makes adding + a new authentication service for Winbind very easy, all that needs + to be done is that the pam_winbind.so module + is copied to /lib/security/ and the PAM + control files for relevant services are updated to allow + authentication via winbind. See the PAM documentation + for more details.

    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 + slightly different to UNIX which has a range of numbers that are + used to identify users, and the same range in which to identify + groups. It is winbind's job to convert RIDs to UNIX id numbers and + vice versa. When winbind is configured it is given part of the UNIX + user id space and a part of the UNIX group id space in which to + store Windows NT users and groups. If a Windows NT user is + resolved for the first time, it is allocated the next UNIX id from + the range. The same process applies for Windows NT groups. Over + time, winbind will have mapped all Windows NT users and groups + to UNIX user ids and group ids.

    The results of this mapping are stored persistently in + an ID mapping database held in a tdb database). This ensures that + RIDs are mapped to UNIX IDs in a consistent way.

    Result Caching

    An active system can generate a lot of user and group + name lookups. To reduce the network cost of these lookups winbind + uses a caching scheme based on the SAM sequence number supplied + by NT domain controllers. User or group information returned + by a PDC is cached by winbind along with a sequence number also + returned by the PDC. This sequence number is incremented by + Windows NT whenever any user or group information is modified. If + a cached entry has expired, the sequence number is requested from + the PDC and compared against the sequence number of the cached entry. + If the sequence numbers do not match, then the cached information + is discarded and up to date information is requested directly + from the PDC.

    Installation and Configuration

    Introduction

    +This section describes the procedures used to get winbind up and +running. Winbind is capable of providing access +and authentication control for Windows Domain users through an NT +or Win2K PDC for 'regular' services, such as telnet a nd ftp, as +well for SAMBA services. +

    • + Why should I to this? +

      This allows the SAMBA administrator to rely on the + authentication mechanisms on the NT/Win2K PDC for the authentication + of domain members. NT/Win2K users no longer need to have separate + accounts on the SAMBA server. +

    • + Who should be reading this document? +

      + This HOWTO is designed for system administrators. If you are + implementing SAMBA on a file server and wish to (fairly easily) + integrate existing NT/Win2K users from your PDC onto the + SAMBA server, this HOWTO is for you. That said, I am no NT or PAM + expert, so you may find a better or easier way to accomplish + these tasks. +

    Requirements

    +If you have a Samba configuration file that you are currently +using... BACK IT UP! If your system already uses PAM, +back up the /etc/pam.d directory +contents! If you haven't already made a boot disk, +MAKE ONE NOW! +

    +Messing with the PAM configuration files can make it nearly impossible +to log in to your machine. That's why you want to be able to boot back +into your machine in single user mode and restore your +/etc/pam.d back to the original state they were in if +you get frustrated with the way things are going. ;-) +

    +The latest version of SAMBA (version 3.0 as of this writing), now +includes a functioning winbindd daemon. Please refer to the +main SAMBA web page or, +better yet, your closest SAMBA mirror site for instructions on +downloading the source code. +

    +To allow Domain users the ability to access SAMBA shares and +files, as well as potentially other services provided by your +SAMBA machine, PAM (pluggable authentication modules) must +be setup properly on your machine. In order to compile the +winbind modules, you should have at least the pam libraries resident +on your system. For recent RedHat systems (7.1, for instance), that +means pam-0.74-22. For best results, it is helpful to also +install the development packages in pam-devel-0.74-22. +

    Testing Things Out

    +Before starting, it is probably best to kill off all the SAMBA +related daemons running on your server. Kill off all smbd, +nmbd, and winbindd processes that may +be running. To use PAM, you will want to make sure that you have the +standard PAM package which supplies the /etc/pam.d +directory structure, including the pam modules are used by pam-aware +services, several pam libraries, and the /usr/doc +and /usr/man entries for pam. Winbind built better +in SAMBA if the pam-devel package was also installed. This package includes +the header files needed to compile pam-aware applications. +

    Configure nsswitch.conf and the +winbind libraries on Linux and Solaris

    +The libraries needed to run the winbindd daemon +through nsswitch need to be copied to their proper locations, so +

    +

    +root# cp ../samba/source/nsswitch/libnss_winbind.so /lib
    +

    +

    +I also found it necessary to make the following symbolic link: +

    +root# ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2 +

    And, in the case of Sun Solaris:

    +root# ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1
    +root# ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1
    +root# ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.2
    +

    +Now, as root you need to edit /etc/nsswitch.conf to +allow user and group entries to be visible from the winbindd +daemon. My /etc/nsswitch.conf file look like +this after editing: +

    +	passwd:     files winbind
    +	shadow:     files 
    +	group:      files winbind
    +

    +The libraries needed by the winbind daemon will be automatically +entered into the ldconfig cache the next time +your system reboots, but it +is faster (and you don't need to reboot) if you do it manually: +

    +root# /sbin/ldconfig -v | grep winbind +

    +This makes libnss_winbind available to winbindd +and echos back a check to you. +

    NSS Winbind on AIX

    (This section is only for those running AIX)

    +The winbind AIX identification module gets built as libnss_winbind.so in the +nsswitch directory of the samba source. This file can be copied to +/usr/lib/security, and the AIX naming convention would indicate that it +should be named WINBIND. A stanza like the following: +

    +WINBIND:
    +        program = /usr/lib/security/WINBIND
    +        options = authonly
    +

    can then be added to +/usr/lib/security/methods.cfg. This module only +supports identification, but there have been success reports using the +standard winbind pam module for authentication. Use caution configuring +loadable authentication modules as it is possible to make it impossible +to logon to the system. More information about the AIX authentication +module API can be found at "Kernel Extensions and Device Support +Programming Concepts for AIX": +Chapter 18. Loadable Authentication Module Programming Interface +and more information on administering the modules at +"System Management Guide: Operating System and Devices". +

    Configure smb.conf

    +Several parameters are needed in the smb.conf file to control +the behavior of winbindd. Configure +smb.conf These are described in more detail in +the winbindd(8) man page. My +smb.conf file was modified to +include the following entries in the [global] section: +

    Example 21.1. smb.conf for winbind set-up

    [global]
    ...
    # separate domain and username with '+', like DOMAIN+username
    winbind separator = +
    # use uids from 10000 to 20000 for domain users
    idmap uid = 10000-20000
    # use gids from 10000 to 20000 for domain groups
    winbind gid = 10000-20000
    # allow enumeration of winbind users and groups
    winbind enum users = yes
    winbind enum groups = yes
    # give winbind users a real shell (only needed if they have telnet access)
    template homedir = /home/winnt/%D/%U
    template shell = /bin/bash

    Join the SAMBA server to the PDC domain

    +Enter the following command to make the SAMBA server join the +PDC domain, where DOMAIN is the name of +your Windows domain and Administrator is +a domain user who has administrative privileges in the domain. +

    +root# /usr/local/samba/bin/net rpc join -S PDC -U Administrator +

    +The proper response to the command should be: "Joined the domain +DOMAIN" where DOMAIN +is your DOMAIN name. +

    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 +SAMBA start, but it is possible to test out just the winbind +portion first. To start up winbind services, enter the following +command as root: +

    +root# /usr/local/samba/bin/winbindd +

    +Winbindd can now also run in 'dual daemon mode'. This will make it +run as 2 processes. The first will answer all requests from the cache, +thus making responses to clients faster. The other will +update the cache for the query that the first has just responded. +Advantage of this is that responses stay accurate and are faster. +You can enable dual daemon mode by adding -B to the commandline: +

    +root# /usr/local/samba/bin/winbindd -B +

    +I'm always paranoid and like to make sure the daemon +is really running... +

    +root# ps -ae | grep winbindd +

    +This command should produce output like this, if the daemon is running +

    +3025 ?        00:00:00 winbindd
    +

    +Now... for the real test, try to get some information about the +users on your PDC +

    +root# /usr/local/samba/bin/wbinfo -u +

    +This should echo back a list of users on your Windows users on +your PDC. For example, I get the following response: +

    +	CEO+Administrator
    +	CEO+burdell
    +	CEO+Guest
    +	CEO+jt-ad
    +	CEO+krbtgt
    +	CEO+TsInternetUser
    +

    + Obviously, I have named my domain 'CEO' and my winbind separator is '+'. +

    +You can do the same sort of thing to get group information from +the PDC: +

    +root# /usr/local/samba/bin/wbinfo -g
    +	CEO+Domain Admins
    +	CEO+Domain Users
    +	CEO+Domain Guests
    +	CEO+Domain Computers
    +	CEO+Domain Controllers
    +	CEO+Cert Publishers
    +	CEO+Schema Admins
    +	CEO+Enterprise Admins
    +	CEO+Group Policy Creator Owners
    +

    +The function 'getent' can now be used to get unified +lists of both local and PDC users and groups. +Try the following command: +

    +root# getent passwd +

    +You should get a list that looks like your /etc/passwd +list followed by the domain users with their new uids, gids, home +directories and default shells. +

    +The same thing can be done for groups with the command +

    +root# getent group +

    Fix the init.d startup scripts

    Linux

    +The winbindd daemon needs to start up after the +smbd and nmbd daemons are running. +To accomplish this task, you need to modify the startup scripts of your system. +They are located at /etc/init.d/smb in RedHat and +/etc/init.d/samba in Debian. +script to add commands to invoke this daemon in the proper sequence. My +startup script starts up smbd, nmbd, and winbindd from the +/usr/local/samba/bin directory directly. The 'start' +function in the script looks like this: +

    +start() {
    +        KIND="SMB"
    +        echo -n $"Starting $KIND services: "
    +        daemon /usr/local/samba/bin/smbd $SMBDOPTIONS
    +        RETVAL=$?
    +        echo
    +        KIND="NMB"
    +        echo -n $"Starting $KIND services: "
    +        daemon /usr/local/samba/bin/nmbd $NMBDOPTIONS
    +        RETVAL2=$?
    +        echo
    +        KIND="Winbind"
    +        echo -n $"Starting $KIND services: "
    +        daemon /usr/local/samba/bin/winbindd
    +        RETVAL3=$?
    +        echo
    +        [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] && \
    +		touch /var/lock/subsys/smb || RETVAL=1
    +        return $RETVAL
    +}
    +

    If you would like to run winbindd in dual daemon mode, replace +the line +

    +        daemon /usr/local/samba/bin/winbindd
    +

    + +in the example above with: + +

    +        daemon /usr/local/samba/bin/winbindd -B
    +

    . +

    +The 'stop' function has a corresponding entry to shut down the +services and looks like this: +

    +stop() {
    +        KIND="SMB"
    +        echo -n $"Shutting down $KIND services: "
    +        killproc smbd
    +        RETVAL=$?
    +        echo
    +        KIND="NMB"
    +        echo -n $"Shutting down $KIND services: "
    +        killproc nmbd
    +        RETVAL2=$?
    +        echo
    +        KIND="Winbind"
    +        echo -n $"Shutting down $KIND services: "
    +        killproc winbindd
    +        RETVAL3=$?
    +        [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 -a $RETVAL3 -eq 0 ] && \
    +		 rm -f /var/lock/subsys/smb
    +        echo ""
    +        return $RETVAL
    +}
    +
    Solaris

    Winbind doesn't work on Solaris 9, see the Portability chapter for details.

    On Solaris, you need to modify the +/etc/init.d/samba.server startup script. It usually +only starts smbd and nmbd but should now start winbindd too. If you +have samba installed in /usr/local/samba/bin, +the file could contains something like this: +

    +	##
    +	## samba.server
    +	##
    +
    +	if [ ! -d /usr/bin ]
    +	then                    # /usr not mounted
    +		exit
    +	fi
    +
    +	killproc() {            # kill the named process(es)
    +		pid=`/usr/bin/ps -e |
    +		     /usr/bin/grep -w $1 |
    +		     /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
    +		[ "$pid" != "" ] && kill $pid
    +	}
    +	 
    +	# Start/stop processes required for samba server
    +
    +	case "$1" in
    +
    +	'start')
    +	#
    +	# Edit these lines to suit your installation (paths, workgroup, host)
    +	#
    +	echo Starting SMBD
    +	   /usr/local/samba/bin/smbd -D -s \
    +		/usr/local/samba/smb.conf
    +
    +	echo Starting NMBD
    +	   /usr/local/samba/bin/nmbd -D -l \
    +		/usr/local/samba/var/log -s /usr/local/samba/smb.conf
    +
    +	echo Starting Winbind Daemon
    +	   /usr/local/samba/bin/winbindd
    +	   ;;
    +
    +	'stop')
    +	   killproc nmbd
    +	   killproc smbd
    +	   killproc winbindd
    +	   ;;
    +
    +	*)
    +	   echo "Usage: /etc/init.d/samba.server { start | stop }"
    +	   ;;
    +	esac
    +

    +Again, if you would like to run samba in dual daemon mode, replace +

    +	/usr/local/samba/bin/winbindd
    +

    + +in the script above with: + +

    +	/usr/local/samba/bin/winbindd -B
    +

    +

    Restarting

    +If you restart the smbd, nmbd, and winbindd daemons at this point, you +should be able to connect to the samba server as a domain member just as +if you were a local user. +

    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 +services, keep reading. The pam configuration files need to be altered in +this step. (Did you remember to make backups of your original +/etc/pam.d files? If not, do it now.) +

    +You will need a pam module to use winbindd with these other services. This +module will be compiled in the ../source/nsswitch directory +by invoking the command +

    +root# make nsswitch/pam_winbind.so +

    +from the ../source directory. The +pam_winbind.so file should be copied to the location of +your other pam security modules. On my RedHat system, this was the +/lib/security directory. On Solaris, the pam security +modules reside in /usr/lib/security. +

    +root# cp ../samba/source/nsswitch/pam_winbind.so /lib/security +

    Linux/FreeBSD-specific PAM configuration

    +The /etc/pam.d/samba file does not need to be changed. I +just left this file as it was: +

    +	auth    required        /lib/security/pam_stack.so service=system-auth
    +	account required        /lib/security/pam_stack.so service=system-auth
    +

    +The other services that I modified to allow the use of winbind +as an authentication service were the normal login on the console (or a terminal +session), telnet logins, and ftp service. In order to enable these +services, you may first need to change the entries in +/etc/xinetd.d (or /etc/inetd.conf). +RedHat 7.1 uses the new xinetd.d structure, in this case you need +to change the lines in /etc/xinetd.d/telnet +and /etc/xinetd.d/wu-ftp from +

    +	enable = no
    +

    +to +

    +	enable = yes
    +

    +For ftp services to work properly, you will also need to either +have individual directories for the domain users already present on +the server, or change the home directory template to a general +directory for all domain users. These can be easily set using +the smb.conf global entry +template homedir. +

    +The /etc/pam.d/ftp file can be changed +to allow winbind ftp access in a manner similar to the +samba file. My /etc/pam.d/ftp file was +changed to look like this: +

    +	auth       required     /lib/security/pam_listfile.so item=user sense=deny \
    +		 file=/etc/ftpusers onerr=succeed
    +	auth       sufficient   /lib/security/pam_winbind.so
    +	auth       required     /lib/security/pam_stack.so service=system-auth
    +	auth       required     /lib/security/pam_shells.so
    +	account    sufficient   /lib/security/pam_winbind.so
    +	account    required     /lib/security/pam_stack.so service=system-auth
    +	session    required     /lib/security/pam_stack.so service=system-auth
    +

    +The /etc/pam.d/login file can be changed nearly the +same way. It now looks like this: +

    +	auth       required     /lib/security/pam_securetty.so
    +	auth       sufficient   /lib/security/pam_winbind.so
    +	auth       sufficient   /lib/security/pam_unix.so use_first_pass
    +	auth       required     /lib/security/pam_stack.so service=system-auth
    +	auth       required     /lib/security/pam_nologin.so
    +	account    sufficient   /lib/security/pam_winbind.so
    +	account    required     /lib/security/pam_stack.so service=system-auth
    +	password   required     /lib/security/pam_stack.so service=system-auth
    +	session    required     /lib/security/pam_stack.so service=system-auth
    +	session    optional     /lib/security/pam_console.so
    +

    +In this case, I added the

    auth sufficient /lib/security/pam_winbind.so

    +lines as before, but also added the

    required pam_securetty.so

    +above it, to disallow root logins over the network. I also added a +

    sufficient /lib/security/pam_unix.so use_first_pass

    +line after the winbind.so line to get rid of annoying +double prompts for passwords. +

    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 +that I made.You can customize the pam.conf file as per your requirements,but +be sure of those changes because in the worst case it will leave your system +nearly impossible to boot. +

    +	#
    +	#ident	"@(#)pam.conf	1.14	99/09/16 SMI"
    +	#
    +	# Copyright (c) 1996-1999, Sun Microsystems, Inc.
    +	# All Rights Reserved.
    +	#
    +	# PAM configuration
    +	#
    +	# Authentication management
    +	#
    +	login   auth required   /usr/lib/security/pam_winbind.so
    +	login	auth required 	/usr/lib/security/$ISA/pam_unix.so.1 try_first_pass 
    +	login	auth required 	/usr/lib/security/$ISA/pam_dial_auth.so.1 try_first_pass 
    +	#
    +	rlogin  auth sufficient /usr/lib/security/pam_winbind.so
    +	rlogin  auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so.1
    +	rlogin	auth required 	/usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
    +	#
    +	dtlogin auth sufficient /usr/lib/security/pam_winbind.so
    +	dtlogin	auth required 	/usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
    +	#
    +	rsh	auth required	/usr/lib/security/$ISA/pam_rhosts_auth.so.1
    +	other   auth sufficient /usr/lib/security/pam_winbind.so
    +	other	auth required	/usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
    +	#
    +	# Account management
    +	#
    +	login   account sufficient      /usr/lib/security/pam_winbind.so
    +	login	account requisite	/usr/lib/security/$ISA/pam_roles.so.1 
    +	login	account required	/usr/lib/security/$ISA/pam_unix.so.1 
    +	#
    +	dtlogin account sufficient      /usr/lib/security/pam_winbind.so
    +	dtlogin	account requisite	/usr/lib/security/$ISA/pam_roles.so.1 
    +	dtlogin	account required	/usr/lib/security/$ISA/pam_unix.so.1 
    +	#
    +	other   account sufficient      /usr/lib/security/pam_winbind.so
    +	other	account requisite	/usr/lib/security/$ISA/pam_roles.so.1 
    +	other	account required	/usr/lib/security/$ISA/pam_unix.so.1 
    +	#
    +	# Session management
    +	#
    +	other	session required	/usr/lib/security/$ISA/pam_unix.so.1 
    +	#
    +	# Password management
    +	#
    +	#other   password sufficient     /usr/lib/security/pam_winbind.so
    +	other	password required	/usr/lib/security/$ISA/pam_unix.so.1 
    +	dtsession auth required	/usr/lib/security/$ISA/pam_unix.so.1
    +	#
    +	# Support for Kerberos V5 authentication (uncomment to use Kerberos)
    +	#
    +	#rlogin	auth optional	/usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
    +	#login	auth optional	/usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
    +	#dtlogin	auth optional	/usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
    +	#other	auth optional	/usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
    +	#dtlogin	account optional /usr/lib/security/$ISA/pam_krb5.so.1
    +	#other	account optional /usr/lib/security/$ISA/pam_krb5.so.1
    +	#other	session optional /usr/lib/security/$ISA/pam_krb5.so.1
    +	#other	password optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
    +

    +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 and try connecting through your application that you +configured in the pam.conf. +

    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.

    Common Errors

    Winbind has a number of limitations in its current + released version that we hope to overcome in future + releases:

    • Winbind is currently only available for + the Linux, Solaris, AIX 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 + Modules systems. This is becoming more common as NSS and + PAM gain support among UNIX vendors.

    • 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.

    NSCD Problem Warning

    Note

    + Do NOT under ANY circumstances run nscd on any system + on which winbind is running. +

    + If nscd is running on the UNIX/Linux system, then + even though NSSWITCH is correctly configured it will NOT be possible to resolve + domain users and groups for file and directory controls. +

    diff --git a/docs/htmldocs/winbindd.8.html b/docs/htmldocs/winbindd.8.html index fdcde9fba8..748dbe1e4b 100644 --- a/docs/htmldocs/winbindd.8.html +++ b/docs/htmldocs/winbindd.8.html @@ -69,7 +69,7 @@ amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

    Note that specifying this parameter here will -override the log level parameter +override the log level parameter in the smb.conf file.

    -l|--logfile=logbasename

    File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client. @@ -108,15 +108,15 @@ never removed by the client. and group rids.

    CONFIGURATION

    Configuration of the winbindd daemon is done through configuration parameters in the smb.conf(5) file. All parameters should be specified in the [global] section of smb.conf.

    • - winbind separator

    • - idmap uid

    • - idmap gid

    • - winbind cache time

    • - winbind enum users

    • - winbind enum groups

    • - template homedir

    • - template shell

    • - winbind use default domain

    EXAMPLE SETUP

    To setup winbindd for user and group lookups plus + winbind separator

  • + idmap uid

  • + idmap gid

  • + winbind cache time

  • + winbind enum users

  • + winbind enum groups

  • + template homedir

  • + template shell

  • + winbind use default domain

  • EXAMPLE SETUP

    To setup winbindd for user and group lookups plus authentication from a domain controller use something like the following setup. This was tested on a RedHat 6.2 Linux box.

    In /etc/nsswitch.conf put the following: -- cgit