update to include a few non-Linux locations & instructions
[Samba.git] / docs / textdocs / Solaris-Winbind-HOWTO.txt
bloba81bacf4864e8b9bc3926689c28f8f1bb635266b
1 !==
2 !== Solaris-Winbind-HOWTO.txt
3 !==
4 Contributors:   Naag Mummaneni <getnag@rediffmail.com>
5 Updated:        May 2, 2002
6 Status:         Current
8 Subject:        Installing and Configuring Winbind on Solaris
9 =============================================================================
11 Installation and Configuration of Winbind on Solaris.
12 -----------------------------------------------------
14 This HOWTO describes how to get winbind services up and running to control
15 access and authenticate users on your Solaris box using the winbind services
16 which come with SAMBA 2.2.x latest CVS Checkout.Make sure you are using the
17 latest Samba 2.2.x cvs checkout as other versions come with a lots of bugs
18 regarding winbind .And even the Latest Samba Stable Release is also not an
19 exception to this.
21 Introduction
22 ------------
24 This HOWTO describes the procedures used to get winbind up and running on a
25 Solaris system. Winbind is capable of providing access and authentication
26 control for Windows Domain users through an NT or Win2K PDC for 'regular'
27 services, such as telnet and ftp, as well for SAMBA services.
29 Why should I to this? 
31 This allows the SAMBA administrator to rely on the authentication mechanisms
32 on the NT/Win2K PDC for the authentication of domain members. NT/Win2K users
33 no longer need to have separate accounts on the SAMBA server.
35 Who should be reading this document? 
37 This HOWTO is designed for system administrators. If you are implementing
38 SAMBA on a file server and wish to (fairly easily) integrate existing
39 NT/Win2K users from your PDC onto the SAMBA server, this HOWTO is for you.
41 Requirements
42 ------------
44 If you have a samba configuration file that you are currently using... BACK
45 IT UP! If your system already uses PAM, back up the /etc/pam.conf file ! If
46 you haven't already made a boot disk, MAKEONE NOW! Messing with the pam
47 configuration file can make it nearly impossible to log in to yourmachine.
48 That's why you want to be able to boot back into your machine in single user
49 mode and restore your /etc/pam.conf back to the original state they were in
50 if you get frustrated with the way things are going. ;-) Please refer to the
51 main SAMBA web page or, better yet, your closest SAMBA mirror site for
52 instructions on downloading the source code of Samba 2.2.x from the SAMBA
53 CVS repository. To allow Domain users the ability to access SAMBA shares and
54 files, as well as potentially other services provided by your SAMBA machine,
55 PAM (pluggable authentication modules) must be setup properly on your
56 machine. In order to compile the winbind modules, you should have at least
57 the pam libraries resident on your system. Solaris 7/8 has its pam modules
58 coming with the distribution itself.
60 Testing Things Out
61 ------------------
63 Before starting, it is probably best to kill off all the SAMBA related
64 daemons running on your server. Kill off all smbd, nmbd, and winbindd
65 processes that may be running.
68 Configure and compile SAMBA
69 ---------------------------
71 The configuration and compilation of SAMBA is pretty straightforward. The
72 first three steps may not be necessary depending upon whether or not you
73 have previously built the Samba binaries.
75 root# autoconf
76 root# make clean
77 root# rm config.cache
78 root# ./configure --with-winbind --with-pam
79 root# make
80 root# make install
82 This will, by default, install SAMBA in /usr/local/samba. See the main SAMBA
83 documentation if you want to install SAMBA somewhere else. It will also
84 build the winbindd executable and libraries.
86 Configure nsswitch.conf and the winbind libraries
87 -------------------------------------------------
89 The libraries needed to run the winbindd daemon through nsswitch need to be
90 copied to their proper locations, so
92 root# cp ../samba/source/nsswitch/libnss_winbind.so /usr/lib
94 I also found it necessary to make the following symbolic links:
96 root# ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1
97 root# ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.2
98 root# ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1
99 root# ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.2
101 Now, as root you need to edit /etc/nsswitch.conf to allow user and group
102 entries to be visible from the winbindd daemon. My /etc/nsswitch.conf file
103 look like this after editing:
105   passwd: files winbind
106   group: files winbind
109 Configure smb.conf
110 ------------------
112 Several parameters are needed in the smb.conf file to control the behavior
113 of winbindd. Configure smb.conf These are described in more detail in the
114 winbindd(8) man page. My smb.conf file was modified to include the following
115 entries in the [global] section:
117 [global]
118         <...>
119         # The previous documentation says to 
120         # as the "winbind seperator " directive also but 
121         # it is no longer supported.
123         # use uids from 10000 to 20000 for domain users
124         winbind uid = 10000-20000
126         # use gids from 10000 to 20000 for domain groups
127         winbind gid = 10000-20000
129         # allow enumeration of winbind users and groups
130         winbind enum users = yes
131         winbind enum groups = yes
133         # give winbind users a real shell (only needed if 
134         # they have telnet access)
135         template homedir = /home/winnt/%D/%U
136         template shell = /bin/bash
139 Join the SAMBA server to the PDC domain
140 ---------------------------------------
142 Enter the following command to make the SAMBA server join the PDC domain,
143 where DOMAIN is the name of your Windows domain and Administrator is a
144 domain user who has administrative privileges in the domain.
146 root# /usr/local/samba/bin/smbpasswd -j DOMAIN -r PDC -U Administrator
148 The proper response to the command should be: "Joined the domain DOMAIN"
149 where DOMAIN is your DOMAIN name.
151 Start up the winbindd daemon and test it!
153 Eventually, you will want to modify your smb startup script to automatically
154 invoke the winbindd daemon when the other parts of SAMBA start, but it is
155 possible to test out just the winbind portion first. To start up winbind
156 services, enter the following command as root:
158 root# /usr/local/samba/bin/winbindd
160 I'm always paranoid and like to make sure the daemon is really running...
162 root# ps -ae | grep winbindd
164 This command should produce output like this, if the daemon is running
166   3025 ? 00:00:00 winbindd
168 Now... for the real test, try to get some information about the users on
169 your PDC
171 root# /usr/local/samba/bin/wbinfo -u
173 This should echo back a list of users on your Windows users on your PDC. For
174 example, I get the following response:
176 CEO\Administrator
177 CEO\burdell
178 CEO\Guest
179 CEO\jt-ad
180 CEO\krbtgt
181 CEO\TsInternetUser
183 root# /usr/local/samba/bin/wbinfo -g
185 CEO\Domain Admins
186 CEO\Domain Users
187 CEO\Domain Guests
188 CEO\Domain Computers
189 CEO\Domain Controllers
190 CEO\Cert Publishers
191 CEO\Schema Admins
192 CEO\Enterprise Admins
193 CEO\Group Policy Creator Owners
195 The function 'getent' can now be used to get unified lists of both local and
196 PDC users and groups. Try the following command:
198 root# getent passwd
200 You should get a list that looks like your /etc/passwd list followed by the domain users with their new
201 uids, gids, home directories and default shells.
203 The same thing can be done for groups with the command
205 root# getent group
207 Fix the /etc/rc.d/init.d/samba.server startup files The winbindd daemon
208 needs to start up after the smbd and nmbd daemons are running. To accomplish
209 this task, you need to modify the /etc/init.d/samba.server script to add
210 commands to invoke this daemon in the proper sequence. My
211 /etc/init.d/samba.server file starts up smbd, nmbd, and winbindd from the
212 /usr/local/samba/bin directory directly.
215 ## samba.server
218 if [ ! -d /usr/bin ]
219 then                    # /usr not mounted
220         exit
223 killproc() {            # kill the named process(es)
224         pid=`/usr/bin/ps -e |
225              /usr/bin/grep -w $1 |
226              /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
227         [ "$pid" != "" ] && kill $pid
230 # Start/stop processes required for samba server
232 case "$1" in
234 'start')
236 # Edit these lines to suit your installation (paths, workgroup, host)
238 echo Starting SMBD
239    /usr/local/samba/bin/smbd -D -s \
240         /usr/local/samba/smb.conf
242 echo Starting NMBD
243    /usr/local/samba/bin/nmbd -D -l \
244         /usr/local/samba/var/log -s /usr/local/samba/smb.conf
246 echo Starting Winbind Daemon
247    /usr/local/samba/bin/winbindd
248    ;;
250 'stop')
251    killproc nmbd
252    killproc smbd
253    killproc winbindd
254    ;;
257    echo "Usage: /etc/init.d/samba.server { start | stop }"
258    ;;
259 esac
261 If you restart the smbd, nmbd, and winbindd daemons at this point, you
262 should be able to connect to the samba server as a domain member just as if
263 you were a local user.
266 Configure Winbind and PAM
267 -------------------------
269 If you have made it this far, you know that winbindd and samba are working
270 together. If you want to use winbind to provide authentication for other
271 services, keep reading. The pam configuration file need to be altered in
272 this step. (Did you remember to make backups of your original /etc/pam.conf
273 file? If not, do it now.) You will need a pam module to use winbindd with
274 these other services. This module will be compiled in the ../source/nsswitch
275 directory by default when we used ./configure --with-pam option.
277 root# make nsswitch/pam_winbind.so
279 from the ../source directory. The pam_winbind.so file should be copied to
280 the location of your other pam security modules. On my Solaris 8, this was
281 the /usr/lib/security directory.
283 root# cp ../samba/source/nsswitch/pam_winbind.so /usr/lib/security
285 The /etc/pam.conf need to be changed. I changed this file so that my Domain
286 users can logon both locally as well as telnet.The following are the changes
287 that I made.You can customize the pam.conf file as per your requirements,but
288 be sure of those changes because in the worst case it will leave your system
289 nearly impossible to boot.
292 #ident  "@(#)pam.conf   1.14    99/09/16 SMI"
294 # Copyright (c) 1996-1999, Sun Microsystems, Inc.
295 # All Rights Reserved.
297 # PAM configuration
299 # Authentication management
301 login   auth required   /usr/lib/security/pam_winbind.so
302 login   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass 
303 login   auth required   /usr/lib/security/$ISA/pam_dial_auth.so.1 try_first_pass 
305 rlogin  auth sufficient /usr/lib/security/pam_winbind.so
306 rlogin  auth sufficient /usr/lib/security/$ISA/pam_rhosts_auth.so.1
307 rlogin  auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
309 dtlogin auth sufficient /usr/lib/security/pam_winbind.so
310 dtlogin auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
312 rsh     auth required   /usr/lib/security/$ISA/pam_rhosts_auth.so.1
313 other   auth sufficient /usr/lib/security/pam_winbind.so
314 other   auth required   /usr/lib/security/$ISA/pam_unix.so.1 try_first_pass
316 # Account management
318 login   account sufficient      /usr/lib/security/pam_winbind.so
319 login   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
320 login   account required        /usr/lib/security/$ISA/pam_unix.so.1 
322 dtlogin account sufficient      /usr/lib/security/pam_winbind.so
323 dtlogin account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
324 dtlogin account required        /usr/lib/security/$ISA/pam_unix.so.1 
326 other   account sufficient      /usr/lib/security/pam_winbind.so
327 other   account requisite       /usr/lib/security/$ISA/pam_roles.so.1 
328 other   account required        /usr/lib/security/$ISA/pam_unix.so.1 
330 # Session management
332 other   session required        /usr/lib/security/$ISA/pam_unix.so.1 
334 # Password management
336 #other   password sufficient     /usr/lib/security/pam_winbind.so
337 other   password required       /usr/lib/security/$ISA/pam_unix.so.1 
338 dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1
340 # Support for Kerberos V5 authentication (uncomment to use Kerberos)
342 #rlogin auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
343 #login  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
344 #dtlogin        auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
345 #other  auth optional   /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
346 #dtlogin        account optional /usr/lib/security/$ISA/pam_krb5.so.1
347 #other  account optional /usr/lib/security/$ISA/pam_krb5.so.1
348 #other  session optional /usr/lib/security/$ISA/pam_krb5.so.1
349 #other  password optional /usr/lib/security/$ISA/pam_krb5.so.1 try_first_pass
351 I also added a try_first_pass line after the winbind.so line to get rid of
352 annoying double prompts for passwords.
354 Now restart your Samba & try connecting through your application that you
355 configured in the pam.conf.
360 !== end of Solaris-Winbind-HOWTO.txt