Configure nsswitch.conf
and the Winbind Libraries on Linux and Solaris
PAM is a standard component of most current generation UNIX/Linux systems. Unfortunately, few systems install
the pam-devel
libraries that are needed to build PAM-enabled Samba. Additionally, Samba-3
may auto-install the Winbind files into their correct locations on your system, so before you get too far down
the track, be sure to check if the following configuration is really
necessary. You may only need to configure
/etc/nsswitch.conf
.
The libraries needed to run the winbindd daemon through nsswitch need to be copied to their proper locations:
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
As root, edit /etc/nsswitch.conf
to
allow user and group entries to be visible from the winbindd
daemon. My /etc/nsswitch.conf
file looked like
this after editing:
passwd: files winbind
shadow: files
group: files winbind
The libraries needed by the
winbindd
daemon will be automatically
entered into the
ldconfig
cache the next time
your system reboots, but it is faster (and you do not need to reboot) if you do it manually:
root#
/sbin/ldconfig -v | grep winbind
This makes libnss_winbind
available to winbindd and reports the current
search path that is used by the dynamic link loader. The use of the
grep
filters the output of the
ldconfig
command so that we may see proof that
this library is indeed recognized by the dynamic link loader.
The Sun Solaris dynamic link loader management tool is called
crle
. The
use of this tool is necessary to instruct the dynamic link loader to search directories that
contain library files that were not supplied as part of the original operating system platform.
The following example shows how to use this tool to add the directory /usr/local/lib
to the dynamic link loader's search path:
root#
crle -u -l /usr/lib:/usr/local/lib
When executed without arguments,
crle
reports the current dynamic
link loader configuration. This is demonstrated here:
root#
crle
Configuration file [version 4]: /var/ld/ld.config
Default Library Path (ELF): /lib:/usr/lib:/usr/local/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
Command line:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib
From this it is apparent that the /usr/local/lib
directory is included
in the search dynamic link libraries in order to satisfy object module dependencies.