4 >Configuring PAM for distributed but centrally
5 managed authentication
</TITLE
8 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.57"></HEAD
24 >Configuring PAM for distributed but centrally
25 managed authentication
</A
37 >A number of Unix systems (eg: Sun Solaris), as well as the
38 xxxxBSD family and Linux, now utilize the Pluggable Authentication
39 Modules (PAM) facility to provide all authentication,
40 authorization and resource control services. Prior to the
41 introduction of PAM, a decision to use an alternative to
42 the system password database (
<TT
46 would require the provision of alternatives for all programs that provide
47 security services. Such a choice would involve provision of
48 alternatives to such programs as:
<B
60 >PAM provides a mechanism that disconnects these security programs
61 from the underlying authentication/authorization infrastructure.
62 PAM is configured either through one file
<TT
66 or by editing individual files that are located in
<TT
71 >The following is an example
<TT
75 This example had all options been uncommented is probably not usable
76 as it stacks many conditions before allowing successful completion
77 of the login process. Essentially all conditions can be disabled
78 by commenting them out except the calls to
<TT
84 CLASS=
"PROGRAMLISTING"
86 # The PAM configuration file for the `login' service
88 auth required pam_securetty.so
89 auth required pam_nologin.so
90 # auth required pam_dialup.so
91 # auth optional pam_mail.so
92 auth required pam_pwdb.so shadow md5
93 # account requisite pam_time.so
94 account required pam_pwdb.so
95 session required pam_pwdb.so
96 # session optional pam_lastlog.so
97 # password required pam_cracklib.so retry=
3
98 password required pam_pwdb.so shadow md5
</PRE
101 >PAM allows use of replacable modules. Those available on a
102 sample system include:
</P
105 CLASS=
"PROGRAMLISTING"
106 >$ /bin/ls /lib/security
107 pam_access.so pam_ftp.so pam_limits.so
108 pam_ncp_auth.so pam_rhosts_auth.so pam_stress.so
109 pam_cracklib.so pam_group.so pam_listfile.so
110 pam_nologin.so pam_rootok.so pam_tally.so
111 pam_deny.so pam_issue.so pam_mail.so
112 pam_permit.so pam_securetty.so pam_time.so
113 pam_dialup.so pam_lastlog.so pam_mkhomedir.so
114 pam_pwdb.so pam_shells.so pam_unix.so
115 pam_env.so pam_ldap.so pam_motd.so
116 pam_radius.so pam_smbpass.so pam_unix_acct.so
117 pam_wheel.so pam_unix_auth.so pam_unix_passwd.so
118 pam_userdb.so pam_warn.so pam_unix_session.so
</PRE
121 >The following example for the login program replaces the use of
125 > module which uses the system
126 password database (
<TT
140 > which uses the Samba
141 database which contains the Microsoft MD4 encrypted password
142 hashes. This database is stored in either
145 >/usr/local/samba/private/smbpasswd
</TT
149 >/etc/samba/smbpasswd
</TT
153 >/etc/samba.d/smbpasswd
</TT
155 Samba implementation for your Unix/Linux system. The
159 > module is provided by
160 Samba version
2.2.1 or later. It can be compiled by specifying the
163 >--with-pam_smbpass
</B
164 > options when running Samba's
168 > script. For more information
172 > module, see the documentation
175 >source/pam_smbpass
</TT
176 > directory of the Samba
177 source distribution.
</P
180 CLASS=
"PROGRAMLISTING"
182 # The PAM configuration file for the `login' service
184 auth required pam_smbpass.so nodelay
185 account required pam_smbpass.so nodelay
186 session required pam_smbpass.so nodelay
187 password required pam_smbpass.so nodelay
</PRE
190 >The following is the PAM configuration file for a particular
191 Linux system. The default condition uses
<TT
197 CLASS=
"PROGRAMLISTING"
199 # The PAM configuration file for the `samba' service
201 auth required /lib/security/pam_pwdb.so nullok nodelay shadow audit
202 account required /lib/security/pam_pwdb.so audit nodelay
203 session required /lib/security/pam_pwdb.so nodelay
204 password required /lib/security/pam_pwdb.so shadow md5
</PRE
207 >In the following example the decision has been made to use the
208 smbpasswd database even for basic samba authentication. Such a
209 decision could also be made for the passwd program and would
210 thus allow the smbpasswd passwords to be changed using the passwd
214 CLASS=
"PROGRAMLISTING"
216 # The PAM configuration file for the `samba' service
218 auth required /lib/security/pam_smbpass.so nodelay
219 account required /lib/security/pam_pwdb.so audit nodelay
220 session required /lib/security/pam_pwdb.so nodelay
221 password required /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba.d/smb.conf
</PRE
224 >Note: PAM allows stacking of authentication mechanisms. It is
225 also possible to pass information obtained within on PAM module through
226 to the next module in the PAM stack. Please refer to the documentation for
227 your particular system implementation for details regarding the specific
228 capabilities of PAM in this environment. Some Linux implmentations also
232 > module that allows all
233 authentication to be configured in a single central file. The
237 > method has some very devoted followers
238 on the basis that it allows for easier administration. As with all issues in
239 life though, every decision makes trade-offs, so you may want examine the
240 PAM documentation for further helpful information.
</P
248 >Distributed Authentication
</A
251 >The astute administrator will realize from this that the
264 HREF=
"http://rsync.samba.org/"
266 >http://rsync.samba.org/
</A
268 will allow the establishment of a centrally managed, distributed
269 user/password database that can also be used by all
270 PAM (eg: Linux) aware programs and applications. This arrangement
271 can have particularly potent advantages compared with the
272 use of Microsoft Active Directory Service (ADS) in so far as
273 reduction of wide area network authentication traffic.
</P
281 >PAM Configuration in smb.conf
</A
284 >There is an option in smb.conf called
<A
285 HREF=
"smb.conf.5.html#OBEYPAMRESTRICTIONS"
287 >obey pam restrictions
</A
289 The following is from the on-line help for this option in SWAT;
</P
291 >When Samba
2.2 is configure to enable PAM support (i.e.
295 >), this parameter will
296 control whether or not Samba should obey PAM's account
297 and session management directives. The default behavior
298 is to use PAM for clear text authentication only and to
299 ignore any account or session management. Note that Samba always
300 ignores PAM for authentication in the case of
302 HREF=
"smb.conf.5.html#ENCRYPTPASSWORDS"
304 >encrypt passwords = yes
</A
306 The reason is that PAM modules cannot support the challenge/response
307 authentication mechanism needed in the presence of SMB
308 password encryption.
</P
312 >obey pam restrictions = no
</B