lines with something like this:
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_nologin.so
auth sufficient /lib/security/pam_winbind.so
auth required /lib/security/pam_unix.so \
use_first_pass shadow nullok
"Note"
The PAM module pam_unix has recently replaced the module pam_pwdb. Some Linux systems use the module pam_unix2 in place of pam_unix.
Note in particular the use of the sufficient keyword and the use_first_pass keyword.
Now replace the account lines with this:
account required /lib/security/pam_winbind.so
The next step is to join the domain. To do that use thenet program like this:
net join -S PDC -U Administrator
The username after the -U can be any Domain user that has administrator privileges on the machine. Substitute the name or IP of your PDC for "PDC".
Next copy libnss_winbind.so to/lib and pam_winbind.so to /lib/security. A symbolic link needs to be made from /lib/libnss_winbind.so to/lib/libnss_winbind.so.2. If you are using an older version of glibc then the target of the link should be/lib/libnss_winbind.so.1.
Finally, setup a smb.conf(5) containing directives like the following:
[global]
winbind separator = +
winbind cache time = 10
template shell = /bin/bash
template homedir = /home/%D/%U
idmap uid = 10000-20000
idmap gid = 10000-20000
workgroup = DOMAIN
security = domain
password server = *
Now start winbindd and you should find that your user and group database is expanded to include your NT users and groups, and that you can login to your unix box as a domain user, using the DOMAIN+user syntax for the username. You may wish to use the commands getent passwd and getent group to confirm the correct operation of winbindd.