1 | <sect2>
|
---|
2 | <title>Configuring <application><acronym>PAM</acronym></application> to work
|
---|
3 | with <application>shadow</application></title>
|
---|
4 |
|
---|
5 | <sect3><title>Config files</title>
|
---|
6 | <para><filename>/etc/pam.d/login</filename>,
|
---|
7 | <filename>/etc/pam.d/passwd</filename>,
|
---|
8 | <filename>/etc/pam.d/su</filename>,
|
---|
9 | <filename>/etc/pam.d/shadow</filename>,
|
---|
10 | <filename>/etc/pam.d/useradd</filename></para>
|
---|
11 | </sect3>
|
---|
12 |
|
---|
13 | <sect3><title>Configuration Information</title>
|
---|
14 |
|
---|
15 | <para>Add the following <application><acronym>PAM</acronym></application>
|
---|
16 | configuration files to <filename class="directory">/etc/pam.d</filename> (or add them to
|
---|
17 | <filename>/etc/pam.conf</filename> with the additional field for the program).
|
---|
18 | </para>
|
---|
19 | <screen><userinput><command>cat > /etc/pam.d/login << "EOF"</command>
|
---|
20 | # Begin /etc/pam.d/login
|
---|
21 |
|
---|
22 | auth requisite pam_securetty.so
|
---|
23 | auth requisite pam_nologin.so
|
---|
24 | auth required pam_env.so
|
---|
25 | auth required pam_unix.so
|
---|
26 | account required pam_access.so
|
---|
27 | account required pam_unix.so
|
---|
28 | session required pam_motd.so
|
---|
29 | session required pam_limits.so
|
---|
30 | session optional pam_mail.so dir=/var/mail standard
|
---|
31 | session optional pam_lastlog.so
|
---|
32 | session required pam_unix.so
|
---|
33 |
|
---|
34 | # End /etc/pam.d/login
|
---|
35 | <command>EOF
|
---|
36 | cat > /etc/pam.d/passwd << "EOF"</command>
|
---|
37 | # Begin /etc/pam.d/passwd
|
---|
38 |
|
---|
39 | password required pam_unix.so md5 shadow
|
---|
40 |
|
---|
41 | # End /etc/pam.d/passwd
|
---|
42 | <command>EOF
|
---|
43 | cat > /etc/pam.d/shadow << "EOF"</command>
|
---|
44 | # Begin /etc/pam.d/shadow
|
---|
45 |
|
---|
46 | auth sufficient pam_rootok.so
|
---|
47 | auth required pam_unix.so
|
---|
48 | account required pam_unix.so
|
---|
49 | session required pam_unix.so
|
---|
50 | password required pam_permit.so
|
---|
51 |
|
---|
52 | # End /etc/pam.d/shadow
|
---|
53 | <command>EOF
|
---|
54 | cat > /etc/pam.d/su << "EOF"</command>
|
---|
55 | # Begin /etc/pam.d/su
|
---|
56 |
|
---|
57 | auth sufficient pam_rootok.so
|
---|
58 | auth required pam_unix.so
|
---|
59 | account required pam_unix.so
|
---|
60 | session required pam_unix.so
|
---|
61 |
|
---|
62 | # End /etc/pam.d/su
|
---|
63 | <command>EOF
|
---|
64 | cat > /etc/pam.d/useradd << "EOF"</command>
|
---|
65 | # Begin /etc/pam.d/useradd
|
---|
66 |
|
---|
67 | auth sufficient pam_rootok.so
|
---|
68 | auth required pam_unix.so
|
---|
69 | account required pam_unix.so
|
---|
70 | session required pam_unix.so
|
---|
71 | password required pam_permit.so
|
---|
72 |
|
---|
73 | # End /etc/pam.d/useradd
|
---|
74 | <command>EOF
|
---|
75 | cat > /etc/pam.d/chage << "EOF"</command>
|
---|
76 | # Begin /etc/pam.d/chage
|
---|
77 |
|
---|
78 | auth sufficient pam_rootok.so
|
---|
79 | auth required pam_unix.so
|
---|
80 | account required pam_unix.so
|
---|
81 | session required pam_unix.so
|
---|
82 | password required pam_permit.so
|
---|
83 |
|
---|
84 | # End /etc/pam.d/chage
|
---|
85 | <command>EOF</command></userinput></screen>
|
---|
86 |
|
---|
87 | <para>Currently, <filename>/etc/pam.d/other</filename> is configured to
|
---|
88 | allow anyone with an account on the machine to use programs
|
---|
89 | that do not specifically have a configuration file of their own. After
|
---|
90 | testing <application><acronym>PAM</acronym></application> for proper
|
---|
91 | configuration, it can be changed to the following:</para>
|
---|
92 |
|
---|
93 | <screen><userinput><command>cat > /etc/pam.d/other << "EOF"</command>
|
---|
94 | # Begin /etc/pam.d/other
|
---|
95 |
|
---|
96 | auth required pam_deny.so
|
---|
97 | auth required pam_warn.so
|
---|
98 | account required pam_deny.so
|
---|
99 | session required pam_deny.so
|
---|
100 | password required pam_deny.so
|
---|
101 | password required pam_warn.so
|
---|
102 |
|
---|
103 | # End /etc/pam.d/other
|
---|
104 | <command>EOF</command></userinput></screen>
|
---|
105 |
|
---|
106 | <para>Finally, edit <filename>/etc/login.defs</filename> by adding '#'
|
---|
107 | to the beginning of the following lines:</para>
|
---|
108 | <screen>DIALUPS_CHECK_ENAB
|
---|
109 | LASTLOG_ENAB
|
---|
110 | MAIL_CHECK_ENAB
|
---|
111 | PORTTIME_CHECKS_ENAB
|
---|
112 | CONSOLE
|
---|
113 | MOTD_FILE
|
---|
114 | NOLOGINS_FILE
|
---|
115 | PASS_MIN_LEN
|
---|
116 | SU_WHEEL_ONLY
|
---|
117 | MD5_CRYPT_ENAB
|
---|
118 | CONSOLE_GROUPS
|
---|
119 | ENVIRON_FILE</screen>
|
---|
120 |
|
---|
121 | <para>This stops <command>login</command> from performing these functions, as
|
---|
122 | they will now be performed by <acronym>PAM</acronym> modules.</para>
|
---|
123 |
|
---|
124 | </sect3>
|
---|
125 |
|
---|
126 | </sect2>
|
---|
127 |
|
---|