Debian Codegraph @

upstream/mageia-cauldron/man5/limits.conf.5

raw
1 '\" t
2 .\" Title: limits.conf
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
5 .\" Date: 01/25/2026
6 .\" Manual: Linux-PAM Manual
7 .\" Source: Linux-PAM
8 .\" Language: English
9 .\"
10 .TH "LIMITS\&.CONF" "5" "01/25/2026" "Linux\-PAM" "Linux\-PAM Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 limits.conf \- configuration file for the pam_limits module
32 .SH "DESCRIPTION"
33 .PP
34 The
35 \fIpam_limits\&.so\fR
36 module applies ulimit limits, nice priority and number of simultaneous login sessions limit to user login sessions\&. This description of the configuration file syntax applies to the
37 /etc/security/limits\&.conf
38 file and
39 *\&.conf
40 files in the
41 /etc/security/limits\&.d
42 directory\&.
43 .PP
44 The syntax of the lines is as follows:
45 .PP
46 \fI<domain>\fR
47 \fI<type>\fR
48 \fI<item>\fR
49 \fI<value>\fR
50 .PP
51 The fields listed above should be filled as follows:
52 .PP
53 <domain>
54 .RS 4
55 .sp
56 .RS 4
57 .ie n \{\
58 \h'-04'\(bu\h'+03'\c
59 .\}
60 .el \{\
61 .sp -1
62 .IP \(bu 2.3
63 .\}
64 a username
65 .RE
66 .sp
67 .RS 4
68 .ie n \{\
69 \h'-04'\(bu\h'+03'\c
70 .\}
71 .el \{\
72 .sp -1
73 .IP \(bu 2.3
74 .\}
75 a groupname, with
76 \fB@group\fR
77 syntax\&. This should not be confused with netgroups\&.
78 .RE
79 .sp
80 .RS 4
81 .ie n \{\
82 \h'-04'\(bu\h'+03'\c
83 .\}
84 .el \{\
85 .sp -1
86 .IP \(bu 2.3
87 .\}
88 the wildcard
89 \fB*\fR, for default entry\&.
90 .RE
91 .sp
92 .RS 4
93 .ie n \{\
94 \h'-04'\(bu\h'+03'\c
95 .\}
96 .el \{\
97 .sp -1
98 .IP \(bu 2.3
99 .\}
100 the wildcard
101 \fB%\fR, for maxlogins limit only, can also be used with
102 \fB%group\fR
103 syntax\&. If the
104 \fB%\fR
105 wildcard is used alone it is identical to using
106 \fB*\fR
107 with maxsyslogins limit\&. With a group specified after
108 \fB%\fR
109 it limits the total number of logins of all users that are member of the group\&.
110 .RE
111 .sp
112 .RS 4
113 .ie n \{\
114 \h'-04'\(bu\h'+03'\c
115 .\}
116 .el \{\
117 .sp -1
118 .IP \(bu 2.3
119 .\}
120 an uid range specified as
121 \fI<min_uid>\fR\fB:\fR\fI<max_uid>\fR\&. If min_uid is omitted, the match is exact for the max_uid\&. If max_uid is omitted, all uids greater than or equal min_uid match\&.
122 .RE
123 .sp
124 .RS 4
125 .ie n \{\
126 \h'-04'\(bu\h'+03'\c
127 .\}
128 .el \{\
129 .sp -1
130 .IP \(bu 2.3
131 .\}
132 a gid range specified as
133 \fB@\fR\fI<min_gid>\fR\fB:\fR\fI<max_gid>\fR\&. If min_gid is omitted, the match is exact for the max_gid\&. If max_gid is omitted, all gids greater than or equal min_gid match\&. For the exact match all groups including the user\*(Aqs supplementary groups are examined\&. For the range matches only the user\*(Aqs primary group is examined\&.
134 .RE
135 .sp
136 .RS 4
137 .ie n \{\
138 \h'-04'\(bu\h'+03'\c
139 .\}
140 .el \{\
141 .sp -1
142 .IP \(bu 2.3
143 .\}
144 a gid specified as
145 \fB%:\fR\fI<gid>\fR
146 applicable to maxlogins limit only\&. It limits the total number of logins of all users that are member of the group with the specified gid\&.
147 .RE
148 .RE
149 .PP
150 <type>
151 .RS 4
152 .PP
153 hard
154 .RS 4
155 for enforcing
156 \fBhard\fR
157 resource limits\&. These limits are set by the superuser and enforced by the Kernel\&. Users cannot raise their own requirement of system resources above such values\&.
158 .RE
159 .PP
160 soft
161 .RS 4
162 for enforcing
163 \fBsoft\fR
164 resource limits\&. These limits are ones that the user can move up or down within the permitted range by any pre\-existing
165 \fBhard\fR
166 limits\&. The values specified with this token can be thought of as
167 \fIdefault\fR
168 values, for normal system usage\&.
169 .RE
170 .PP
171 \-
172 .RS 4
173 for enforcing both
174 \fBsoft\fR
175 and
176 \fBhard\fR
177 resource limits together\&.
178 .sp
179 Note, if you specify a type of \*(Aq\-\*(Aq but neglect to supply the item and value fields then the module will never enforce any limits on the specified user/group etc\&. \&.
180 .RE
181 .RE
182 .PP
183 <item>
184 .RS 4
185 .PP
186 core
187 .RS 4
188 limits the core file size (KB)
189 .RE
190 .PP
191 data
192 .RS 4
193 maximum data size (KB)
194 .RE
195 .PP
196 fsize
197 .RS 4
198 maximum filesize (KB)
199 .RE
200 .PP
201 memlock
202 .RS 4
203 maximum locked\-in\-memory address space (KB)
204 .RE
205 .PP
206 nofile
207 .RS 4
208 maximum number of open file descriptors
209 .RE
210 .PP
211 rss
212 .RS 4
213 maximum resident set size (KB) (Ignored in Linux 2\&.4\&.30 and higher)
214 .RE
215 .PP
216 stack
217 .RS 4
218 maximum stack size (KB)
219 .RE
220 .PP
221 cpu
222 .RS 4
223 maximum CPU time (minutes)
224 .RE
225 .PP
226 nproc
227 .RS 4
228 maximum number of processes
229 .RE
230 .PP
231 as
232 .RS 4
233 address space limit (KB)
234 .RE
235 .PP
236 maxlogins
237 .RS 4
238 maximum number of logins for this user (this limit does not apply to user with
239 \fIuid=0\fR)
240 .RE
241 .PP
242 maxsyslogins
243 .RS 4
244 maximum number of all logins on system; user is not allowed to log\-in if total number of all user logins is greater than specified number (this limit does not apply to user with
245 \fIuid=0\fR)
246 .RE
247 .PP
248 nonewprivs
249 .RS 4
250 value of 0 or 1; if set to 1 disables acquiring new privileges by invoking prctl(PR_SET_NO_NEW_PRIVS)
251 .RE
252 .PP
253 priority
254 .RS 4
255 the priority to run user process with (negative values boost process priority)
256 .RE
257 .PP
258 locks
259 .RS 4
260 maximum locked files (Linux 2\&.4 and higher)
261 .RE
262 .PP
263 sigpending
264 .RS 4
265 maximum number of pending signals (Linux 2\&.6 and higher)
266 .RE
267 .PP
268 msgqueue
269 .RS 4
270 maximum memory used by POSIX message queues (bytes) (Linux 2\&.6 and higher)
271 .RE
272 .PP
273 nice
274 .RS 4
275 maximum nice priority allowed to raise to (Linux 2\&.6\&.12 and higher) values: [\-20,19]
276 .RE
277 .PP
278 rtprio
279 .RS 4
280 maximum realtime priority allowed for non\-privileged processes (Linux 2\&.6\&.12 and higher)
281 .RE
282 .PP
283 rttime
284 .RS 4
285 Timeout for real\-time tasks in microseconds (Linux 2\&.6\&.25 and higher)
286 .RE
287 .RE
288 .PP
289 All items support the values
290 \fI\-1\fR,
291 \fIunlimited\fR
292 or
293 \fIinfinity\fR
294 indicating no limit, except for
295 \fBpriority\fR,
296 \fBnice\fR, and
297 \fBnonewprivs\fR\&. If
298 \fBnofile\fR
299 is to be set to one of these values, it will be set to the contents of /proc/sys/fs/nr_open instead (see setrlimit(3))\&.
300 .PP
301 If a hard limit or soft limit of a resource is set to a valid value, but outside of the supported range of the local system, the system may reject the new limit or unexpected behavior may occur\&. If the control value
302 \fIrequired\fR
303 is used, the module will reject the login if a limit could not be set\&.
304 .PP
305 In general, individual limits have priority over group limits, so if you impose no limits for
306 \fIadmin\fR
307 group, but one of the members in this group have a limits line, the user will have its limits set according to this line\&.
308 .PP
309 Also, please note that all limit settings are set
310 \fIper login\fR\&. They are not global, nor are they permanent; existing only for the duration of the session\&. One exception is the
311 \fImaxlogin\fR
312 option, this one is system wide\&. But there is a race, concurrent logins at the same time will not always be detect as such but only counted as one\&.
313 .PP
314 In the
315 \fIlimits\fR
316 configuration file, the \*(Aq\fB#\fR\*(Aq character introduces a comment \- after which the rest of the line is ignored\&.
317 .PP
318 The pam_limits module does report configuration problems found in its configuration file and errors via
319 \fBsyslog\fR(3)\&.
320 .SH "EXAMPLES"
321 .PP
322 These are some example lines which might be specified in
323 /etc/security/limits\&.conf\&.
324 .sp
325 .if n \{\
326 .RS 4
327 .\}
328 .nf
329 * soft core 0
330 * hard nofile 512
331 @student hard nproc 20
332 @faculty soft nproc 20
333 @faculty hard nproc 50
334 ftp hard nproc 0
335 @student \- maxlogins 4
336 @student \- nonewprivs 1
337 :123 hard cpu 5000
338 @500: soft cpu 10000
339 600:700 hard locks 10
340
341 .fi
342 .if n \{\
343 .RE
344 .\}
345 .SH "SEE ALSO"
346 .PP
347 \fBpam_limits\fR(8),
348 \fBpam.d\fR(5),
349 \fBpam\fR(8),
350 \fBgetrlimit\fR(2),
351 \fBgetrlimit\fR(3p)
352 .SH "AUTHOR"
353 .PP
354 pam_limits was initially written by Cristian Gafton <gafton@redhat\&.com>