Import Linux-PAM.
[profile/ivi/pam.git] / modules / pam_limits / limits.conf.5.xml
1 <?xml version="1.0" encoding='UTF-8'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3         "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
4
5 <refentry id="limits.conf">
6
7   <refmeta>
8     <refentrytitle>limits.conf</refentrytitle>
9     <manvolnum>5</manvolnum>
10     <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
11   </refmeta>
12
13   <refnamediv>
14     <refname>limits.conf</refname>
15     <refpurpose>configuration file for the pam_limits module</refpurpose>
16   </refnamediv>
17
18   <refsect1 id='limits.conf-description'>
19     <title>DESCRIPTION</title>
20     <para>
21       The syntax of the lines is as follows:
22     </para>
23     <para>
24       <replaceable>&lt;domain&gt;</replaceable> <replaceable>&lt;type&gt;</replaceable>
25       <replaceable>&lt;item&gt;</replaceable> <replaceable>&lt;value&gt;</replaceable>
26     </para>
27     <para>
28       The fields listed above should be filled as follows:
29     </para>
30     <variablelist>
31       <varlistentry>
32         <term>
33           <option>&lt;domain&gt;</option>
34         </term>
35         <listitem>
36           <itemizedlist>
37             <listitem>
38               <para>
39                 a username
40               </para>
41             </listitem>
42             <listitem>
43               <para>
44                 a groupname, with <emphasis remap='B'>@group</emphasis> syntax.
45                 This should not be confused with netgroups.
46               </para>
47             </listitem>
48             <listitem>
49               <para>
50                 the wildcard <emphasis remap='B'>*</emphasis>, for default entry.
51               </para>
52             </listitem>
53             <listitem>
54               <para>
55                 the wildcard <emphasis remap='B'>%</emphasis>, for maxlogins limit only,
56                 can also be used with <emphasis remap='B'>%group</emphasis> syntax. If the
57                 <emphasis remap='B'>%</emphasis> wildcard is used alone it is identical
58                 to using <emphasis remap='B'>*</emphasis> with maxsyslogins limit. With
59                 a group specified after <emphasis remap='B'>%</emphasis> it limits the total
60                 number of logins of all users that are member of the group.
61               </para>
62             </listitem>
63             <listitem>
64               <para>
65                 an uid range specified as <replaceable>&lt;min_uid&gt;</replaceable><emphasis
66                 remap='B'>:</emphasis><replaceable>&lt;max_uid&gt;</replaceable>. If min_uid
67                 is omitted, the match is exact for the max_uid. If max_uid is omitted, all
68                 uids greater than or equal min_uid match.
69               </para>
70             </listitem>
71             <listitem>
72               <para>
73                 a gid range specified as <emphasis
74                 remap='B'>@</emphasis><replaceable>&lt;min_gid&gt;</replaceable><emphasis
75                 remap='B'>:</emphasis><replaceable>&lt;max_gid&gt;</replaceable>. If min_gid
76                 is omitted, the match is exact for the max_gid. If max_gid is omitted, all
77                 gids greater than or equal min_gid match. For the exact match all groups including
78                 the user's supplementary groups are examined. For the range matches only
79                 the user's primary group is examined.
80               </para>
81             </listitem>
82             <listitem>
83               <para>
84                 a gid specified as <emphasis
85                 remap='B'>%:</emphasis><replaceable>&lt;gid&gt;</replaceable> applicable
86                 to maxlogins limit only. It limits the total number of logins of all users
87                 that are member of the group with the specified gid.
88               </para>
89             </listitem>
90           </itemizedlist>
91         </listitem>
92       </varlistentry>
93
94       <varlistentry>
95         <term>
96           <option>&lt;type&gt;</option>
97         </term>
98         <listitem>
99           <variablelist>
100             <varlistentry>
101               <term><option>hard</option></term>
102               <listitem>
103                 <para>
104                   for enforcing <emphasis remap='B'>hard</emphasis> resource limits.
105                   These limits are set by the superuser and enforced by the Kernel.
106                   The user cannot raise his requirement of system resources above such values.
107                 </para>
108               </listitem>
109             </varlistentry>
110             <varlistentry>
111               <term><option>soft</option></term>
112               <listitem>
113                 <para>
114                   for enforcing <emphasis remap='B'>soft</emphasis> resource limits.
115                   These limits are ones that the user can move up or down within the
116                   permitted range by any pre-existing <emphasis remap='B'>hard</emphasis>
117                   limits. The values specified with this token can be thought of as
118                   <emphasis>default</emphasis> values, for normal system usage.
119                 </para>
120               </listitem>
121             </varlistentry>
122             <varlistentry>
123               <term><option>-</option></term>
124               <listitem>
125                 <para>
126                   for enforcing both <emphasis remap='B'>soft</emphasis> and
127                   <emphasis remap='B'>hard</emphasis> resource limits together.
128                 </para>
129                 <para>
130                   Note, if you specify a type of '-' but neglect to supply the
131                   item and value fields then the module will never enforce any
132                   limits on the specified user/group etc. .
133                 </para>
134               </listitem>
135             </varlistentry>
136           </variablelist>
137         </listitem>
138       </varlistentry>
139
140       <varlistentry>
141         <term>
142           <option>&lt;item&gt;</option>
143         </term>
144         <listitem>
145           <variablelist>
146             <varlistentry>
147               <term><option>core</option></term>
148               <listitem>
149                 <para>limits the core file size (KB)</para>
150               </listitem>
151             </varlistentry>
152             <varlistentry>
153               <term><option>data</option></term>
154               <listitem>
155                 <para>maximum data size (KB)</para>
156               </listitem>
157             </varlistentry>
158             <varlistentry>
159               <term><option>fsize</option></term>
160               <listitem>
161                 <para>maximum filesize (KB)</para>
162               </listitem>
163             </varlistentry>
164             <varlistentry>
165               <term><option>memlock</option></term>
166               <listitem>
167                 <para>maximum locked-in-memory address space (KB)</para>
168               </listitem>
169             </varlistentry>
170             <varlistentry>
171               <term><option>nofile</option></term>
172               <listitem>
173                 <para>maximum number of open files</para>
174               </listitem>
175             </varlistentry>
176             <varlistentry>
177               <term><option>rss</option></term>
178               <listitem>
179                 <para>maximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)</para>
180               </listitem>
181             </varlistentry>
182             <varlistentry>
183               <term><option>stack</option></term>
184               <listitem>
185                 <para>maximum stack size (KB)</para>
186               </listitem>
187             </varlistentry>
188             <varlistentry>
189               <term><option>cpu</option></term>
190               <listitem>
191                 <para>maximum CPU time (minutes)</para>
192               </listitem>
193             </varlistentry>
194             <varlistentry>
195               <term><option>nproc</option></term>
196               <listitem>
197                 <para>maximum number of processes</para>
198               </listitem>
199             </varlistentry>
200             <varlistentry>
201               <term><option>as</option></term>
202               <listitem>
203                 <para>address space limit (KB)</para>
204               </listitem>
205             </varlistentry>
206             <varlistentry>
207               <term><option>maxlogins</option></term>
208               <listitem>
209                 <para>maximum number of logins for this user except
210                       for this with <emphasis>uid=0</emphasis></para>
211               </listitem>
212             </varlistentry>
213             <varlistentry>
214               <term><option>maxsyslogins</option></term>
215               <listitem>
216                 <para>maximum number of all logins on system</para>
217               </listitem>
218             </varlistentry>
219             <varlistentry>
220               <term><option>priority</option></term>
221               <listitem>
222                 <para>the priority to run user process with (negative
223                   values boost process priority)</para>
224               </listitem>
225             </varlistentry>
226             <varlistentry>
227               <term><option>locks</option></term>
228               <listitem>
229                 <para>maximum locked files (Linux 2.4 and higher)</para>
230               </listitem>
231             </varlistentry>
232             <varlistentry>
233               <term><option>sigpending</option></term>
234               <listitem>
235                 <para>maximum number of pending signals (Linux 2.6 and higher)</para>
236               </listitem>
237             </varlistentry>
238             <varlistentry>
239               <term><option>msgqueue</option></term>
240               <listitem>
241                 <para>maximum memory used by POSIX message queues (bytes)
242                   (Linux 2.6 and higher)</para>
243               </listitem>
244             </varlistentry>
245             <varlistentry>
246               <term><option>nice</option></term>
247               <listitem>
248                 <para>maximum nice priority allowed to raise to (Linux 2.6.12 and higher) values: [-20,19]</para>
249               </listitem>
250             </varlistentry>
251             <varlistentry>
252               <term><option>rtprio</option></term>
253               <listitem>
254                 <para>maximum realtime priority allowed for non-privileged processes
255                   (Linux 2.6.12 and higher)</para>
256               </listitem>
257             </varlistentry>
258           </variablelist>
259         </listitem>
260       </varlistentry>
261
262     </variablelist>
263     <para>
264       All items support the values <emphasis>-1</emphasis>,
265       <emphasis>unlimited</emphasis> or <emphasis>infinity</emphasis> indicating no limit,
266       except for <emphasis remap='B'>priority</emphasis> and <emphasis remap='B'>nice</emphasis>.
267     </para>
268     <para>
269       If a hard limit or soft limit of a resource is set to a valid value,
270       but outside of the supported range of the local system, the system
271       may reject the new limit or unexpected behavior may occur. If the
272       control value <emphasis>required</emphasis>  is used, the module will
273       reject the login if a limit could not be set.
274     </para>
275     <para>
276       In general, individual limits have priority over group limits, so if
277       you impose no limits for <emphasis>admin</emphasis> group, but one of
278       the members in this group have a limits line, the user will have its
279       limits set according to this line.
280     </para>
281     <para>
282       Also, please note that all limit settings are set
283       <emphasis>per login</emphasis>. They are not global, nor are they
284       permanent; existing only for the duration of the session.
285     </para>
286     <para>
287       In the <emphasis>limits</emphasis> configuration file, the
288       '<emphasis remap='B'>#</emphasis>' character introduces a comment
289       - after which the rest of the line is ignored.
290     </para>
291     <para>
292       The pam_limits module does report configuration problems
293       found in its configuration file and errors via <citerefentry>
294       <refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
295     </para>
296   </refsect1>
297
298   <refsect1 id="limits.conf-examples">
299     <title>EXAMPLES</title>
300     <para>
301       These are some example lines which might be specified in
302       <filename>/etc/security/limits.conf</filename>.
303     </para>
304     <programlisting>
305 *               soft    core            0
306 *               hard    nofile          512
307 @student        hard    nproc           20
308 @faculty        soft    nproc           20
309 @faculty        hard    nproc           50
310 ftp             hard    nproc           0
311 @student        -       maxlogins       4
312 :123            hard    cpu             5000
313 @500:           soft    cpu             10000
314 600:700         hard    locks           10
315     </programlisting>
316   </refsect1>
317
318   <refsect1 id="limits.conf-see_also">
319     <title>SEE ALSO</title>
320     <para>
321       <citerefentry><refentrytitle>pam_limits</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
322       <citerefentry><refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
323       <citerefentry><refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
324       <citerefentry><refentrytitle>getrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>
325       <citerefentry><refentrytitle>getrlimit</refentrytitle><manvolnum>3p</manvolnum></citerefentry>
326     </para>
327   </refsect1>
328
329   <refsect1 id="limits.conf-author">
330     <title>AUTHOR</title>
331     <para>
332       pam_limits was initially written by Cristian Gafton &lt;gafton@redhat.com&gt;
333     </para>
334   </refsect1>
335 </refentry>