| 1 |
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="pam_nologin"> |
| 2 |
|
| 3 |
<refmeta> |
| 4 |
<refentrytitle>pam_nologin</refentrytitle> |
| 5 |
<manvolnum>8</manvolnum> |
| 6 |
<refmiscinfo class="source">Linux-PAM</refmiscinfo> |
| 7 |
<refmiscinfo class="manual">Linux-PAM Manual</refmiscinfo> |
| 8 |
</refmeta> |
| 9 |
|
| 10 |
<refnamediv xml:id="pam_nologin-name"> |
| 11 |
<refname>pam_nologin</refname> |
| 12 |
<refpurpose>Prevent non-root users from login</refpurpose> |
| 13 |
</refnamediv> |
| 14 |
|
| 15 |
<refsynopsisdiv> |
| 16 |
<cmdsynopsis xml:id="pam_nologin-cmdsynopsis" sepchar=" "> |
| 17 |
<command>pam_nologin.so</command> |
| 18 |
<arg choice="opt" rep="norepeat"> |
| 19 |
file=<replaceable>/path/nologin</replaceable> |
| 20 |
</arg> |
| 21 |
<arg choice="opt" rep="norepeat"> |
| 22 |
successok |
| 23 |
</arg> |
| 24 |
</cmdsynopsis> |
| 25 |
</refsynopsisdiv> |
| 26 |
|
| 27 |
<refsect1 xml:id="pam_nologin-description"> |
| 28 |
|
| 29 |
<title>DESCRIPTION</title> |
| 30 |
|
| 31 |
<para> |
| 32 |
pam_nologin is a PAM module that prevents users from logging into |
| 33 |
the system when <filename>/var/run/nologin</filename> or |
| 34 |
<filename>/etc/nologin</filename> exists. The contents |
| 35 |
of the file are displayed to the user. The pam_nologin module |
| 36 |
has no effect on the root user's ability to log in. |
| 37 |
</para> |
| 38 |
</refsect1> |
| 39 |
|
| 40 |
<refsect1 xml:id="pam_nologin-options"> |
| 41 |
|
| 42 |
<title>OPTIONS</title> |
| 43 |
<variablelist> |
| 44 |
<varlistentry> |
| 45 |
<term> |
| 46 |
file=/path/nologin |
| 47 |
</term> |
| 48 |
<listitem> |
| 49 |
<para> |
| 50 |
Use this file instead the default |
| 51 |
<filename>/var/run/nologin</filename> or |
| 52 |
<filename>/etc/nologin</filename>. |
| 53 |
</para> |
| 54 |
</listitem> |
| 55 |
</varlistentry> |
| 56 |
<varlistentry> |
| 57 |
<term> |
| 58 |
successok |
| 59 |
</term> |
| 60 |
<listitem> |
| 61 |
<para> |
| 62 |
Return PAM_SUCCESS if no file exists, the default is PAM_IGNORE. |
| 63 |
</para> |
| 64 |
</listitem> |
| 65 |
</varlistentry> |
| 66 |
</variablelist> |
| 67 |
</refsect1> |
| 68 |
|
| 69 |
<refsect1 xml:id="pam_nologin-types"> |
| 70 |
<title>MODULE TYPES PROVIDED</title> |
| 71 |
<para> |
| 72 |
The <option>auth</option> and <option>account</option> module |
| 73 |
types are provided. |
| 74 |
</para> |
| 75 |
</refsect1> |
| 76 |
|
| 77 |
<refsect1 xml:id="pam_nologin-return_values"> |
| 78 |
<title>RETURN VALUES</title> |
| 79 |
<variablelist> |
| 80 |
<varlistentry> |
| 81 |
<term>PAM_AUTH_ERR</term> |
| 82 |
<listitem> |
| 83 |
<para> |
| 84 |
The user is not root and <filename>/etc/nologin</filename> |
| 85 |
exists, so the user is not permitted to log in. |
| 86 |
</para> |
| 87 |
</listitem> |
| 88 |
</varlistentry> |
| 89 |
<varlistentry> |
| 90 |
<term>PAM_BUF_ERR</term> |
| 91 |
<listitem> |
| 92 |
<para>Memory buffer error.</para> |
| 93 |
</listitem> |
| 94 |
</varlistentry> |
| 95 |
<varlistentry> |
| 96 |
<term>PAM_IGNORE</term> |
| 97 |
<listitem> |
| 98 |
<para> |
| 99 |
This is the default return value. |
| 100 |
</para> |
| 101 |
</listitem> |
| 102 |
</varlistentry> |
| 103 |
<varlistentry> |
| 104 |
<term>PAM_SUCCESS</term> |
| 105 |
<listitem> |
| 106 |
<para> |
| 107 |
Success: either the user is root or the |
| 108 |
nologin file does not exist. |
| 109 |
</para> |
| 110 |
</listitem> |
| 111 |
</varlistentry> |
| 112 |
<varlistentry> |
| 113 |
<term>PAM_USER_UNKNOWN</term> |
| 114 |
<listitem> |
| 115 |
<para> |
| 116 |
User not known to the underlying authentication module. |
| 117 |
</para> |
| 118 |
</listitem> |
| 119 |
</varlistentry> |
| 120 |
</variablelist> |
| 121 |
</refsect1> |
| 122 |
|
| 123 |
<refsect1 xml:id="pam_nologin-examples"> |
| 124 |
<title>EXAMPLES</title> |
| 125 |
<para> |
| 126 |
The suggested usage for <filename>/etc/pam.d/login</filename> is: |
| 127 |
<programlisting> |
| 128 |
auth required pam_nologin.so |
| 129 |
</programlisting> |
| 130 |
</para> |
| 131 |
</refsect1> |
| 132 |
<refsect1 xml:id="pam_nologin-note"> |
| 133 |
<title>NOTES</title> |
| 134 |
<para> |
| 135 |
In order to make this module effective, all login methods should be |
| 136 |
secured by it. It should be used as a <emphasis>required</emphasis> |
| 137 |
method listed before any <emphasis>sufficient</emphasis> methods in |
| 138 |
order to get standard Unix nologin semantics. Note, the use of |
| 139 |
<option>successok</option> module argument causes the module to |
| 140 |
return <emphasis>PAM_SUCCESS</emphasis> and as such would break |
| 141 |
such a configuration - failing <emphasis>sufficient</emphasis> modules |
| 142 |
would lead to a successful login because the nologin module |
| 143 |
<emphasis>succeeded</emphasis>. |
| 144 |
</para> |
| 145 |
</refsect1> |
| 146 |
|
| 147 |
<refsect1 xml:id="pam_nologin-see_also"> |
| 148 |
<title>SEE ALSO</title> |
| 149 |
<para> |
| 150 |
<citerefentry> |
| 151 |
<refentrytitle>nologin</refentrytitle><manvolnum>5</manvolnum> |
| 152 |
</citerefentry>, |
| 153 |
<citerefentry> |
| 154 |
<refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum> |
| 155 |
</citerefentry>, |
| 156 |
<citerefentry> |
| 157 |
<refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum> |
| 158 |
</citerefentry>, |
| 159 |
<citerefentry> |
| 160 |
<refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum> |
| 161 |
</citerefentry> |
| 162 |
</para> |
| 163 |
</refsect1> |
| 164 |
|
| 165 |
<refsect1 xml:id="pam_nologin-author"> |
| 166 |
<title>AUTHOR</title> |
| 167 |
<para> |
| 168 |
pam_nologin was written by Michael K. Johnson <[email protected]>. |
| 169 |
</para> |
| 170 |
</refsect1> |
| 171 |
|
| 172 |
</refentry> |