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