From 99bde6889d3d8b7a9e950c86c30e82662e1dacdd Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 9 Sep 2003 02:58:53 +0000 Subject: syncing files from 3.0 into HEAD again (This used to be commit bca0bba209255d0effbae6a3d3b6d298f0952c3a) --- docs/htmldocs/winbind.html | 163 +++++++++++++++++++++------------------------ 1 file changed, 76 insertions(+), 87 deletions(-) (limited to 'docs/htmldocs/winbind.html') diff --git a/docs/htmldocs/winbind.html b/docs/htmldocs/winbind.html index 567e882367..1ee1de9f2f 100644 --- a/docs/htmldocs/winbind.html +++ b/docs/htmldocs/winbind.html @@ -1,14 +1,38 @@ -Chapter 21. Integrated Logon Support using Winbind

Chapter 21. Integrated Logon Support using Winbind

Tim Potter

Andrew Tridgell

Samba Team

Naag Mummaneni

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. We present - winbind, a component of the Samba suite - of programs as a solution to 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 paper describes the winbind - system, explaining the functionality it provides, how it is configured, - and how it works internally.

Introduction

It is well known that UNIX and Microsoft Windows NT have +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 @@ -29,7 +53,7 @@ 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 + 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 @@ -53,7 +77,7 @@ 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 + 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 @@ -63,12 +87,12 @@ 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 + 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 + 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 @@ -81,7 +105,7 @@ 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

+ 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. @@ -90,7 +114,7 @@ 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 +

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 @@ -112,7 +136,7 @@ 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 species which implementations + 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
@@ -127,7 +151,7 @@ passwd: files example
 		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, + 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 @@ -152,7 +176,7 @@ passwd: files example 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 + 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 @@ -165,7 +189,7 @@ passwd: files example 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 + 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 @@ -176,23 +200,12 @@ passwd: files example 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

-Many thanks to John Trostel jtrostel@snapserver.com -for providing the HOWTO for this section. -

-This HOWTO describes how to get winbind services up and running -to control access and authenticate users on your Linux box using -the winbind services which come with SAMBA 3.0. -

Introduction

+ from the PDC.

Installation and Configuration

Introduction

This section describes the procedures used to get winbind up and -running on a RedHat 7.1 system. Winbind is capable of providing access +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. -

-This HOWTO has been written from a 'RedHat-centric' perspective, so if -you are using another distribution, you may have to modify the instructions -somewhat to fit the way your distribution works.

  • Why should I to this?

    This allows the SAMBA administrator to rely on the @@ -208,7 +221,7 @@ somewhat to fit the way your distribution works. 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

+

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 @@ -235,33 +248,18 @@ 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

+

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 (for RedHat) which supplies the /etc/pam.d +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 and compile SAMBA

-The configuration and compilation of SAMBA is pretty straightforward. -The first three steps may not be necessary depending upon -whether or not you have previously built the Samba binaries. -

-root# autoconf
-root# make clean
-root# rm config.cache
-root# ./configure
-root# make
-root# make install
-

-This will, by default, install SAMBA in /usr/local/samba. -See the main SAMBA documentation if you want to install SAMBA somewhere else. -It will also build the winbindd executable and libraries. -

Configure nsswitch.conf and the +

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 @@ -296,7 +294,7 @@ is faster (and you don't need to reboot) if you do it manually:

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)

+

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 @@ -316,40 +314,25 @@ Programming Concepts for AIX": "System Management Guide: Operating System and Devices". -

Configure smb.conf

+

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: -

-[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
-     idmap 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

+

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 join -S PDC -U Administrator +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!

+

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 @@ -391,8 +374,7 @@ your PDC. For example, I get the following response: CEO+krbtgt CEO+TsInternetUser

-Obviously, I have named my domain 'CEO' and my winbind -separator is '+'. + 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: @@ -421,7 +403,7 @@ 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

+

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. @@ -487,7 +469,7 @@ stop() { echo "" return $RETVAL } -

Solaris

Winbind doesn't work on Solaris 9, see the Portability chapter for details.

On Solaris, you need to modify the +

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, @@ -550,11 +532,11 @@ in the script above with:

 	/usr/local/samba/bin/winbindd -B
 

-

Restarting

+

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

+

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 @@ -574,7 +556,7 @@ your other pam security modules. On my RedHat system, this was the modules reside in /usr/lib/security.

root# cp ../samba/source/nsswitch/pam_winbind.so /lib/security -

Linux/FreeBSD-specific PAM configuration

+

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:

@@ -601,7 +583,7 @@ 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.
+template homedir.
 

The /etc/pam.d/ftp file can be changed to allow winbind ftp access in a manner similar to the @@ -634,10 +616,10 @@ same way. It now looks like this: 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 +

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

+

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 @@ -709,15 +691,15 @@ 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 +

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 + 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 and IRIX operating systems, although ports to other operating + 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 @@ -729,4 +711,11 @@ configured in the pam.conf. 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.

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

-- cgit