| 1 |
'\" t |
| 2 |
.\" Title: pam_limits |
| 3 |
.\" Author: [see the "AUTHORS" section] |
| 4 |
.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/> |
| 5 |
.\" Date: 06/29/2025 |
| 6 |
.\" Manual: Linux-PAM Manual |
| 7 |
.\" Source: Linux-PAM |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "PAM_LIMITS" "8" "06/29/2025" "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 |
pam_limits \- PAM module to limit resources |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.HP \w'\fBpam_limits\&.so\fR\ 'u |
| 34 |
\fBpam_limits\&.so\fR [conf=\fI/path/to/limits\&.conf\fR] [debug] [set_all] [utmp_early] [noaudit] |
| 35 |
.SH "DESCRIPTION" |
| 36 |
.PP |
| 37 |
The pam_limits PAM module sets limits on the system resources that can be obtained in a user\-session\&. Users of |
| 38 |
\fIuid=0\fR |
| 39 |
are affected by this limits, too\&. |
| 40 |
.PP |
| 41 |
By default limits are taken from the |
| 42 |
/etc/security/limits\&.conf |
| 43 |
config file\&. Then individual *\&.conf files from the |
| 44 |
/etc/security/limits\&.d/ |
| 45 |
directory are read\&. The files are parsed one after another in the order of "C" locale\&. The effect of the individual files is the same as if all the files were concatenated together in the order of parsing\&. If a config file is explicitly specified with a module option then the files in the above directory are not parsed\&. |
| 46 |
.PP |
| 47 |
The module must not be called by a multithreaded application\&. |
| 48 |
.PP |
| 49 |
If Linux PAM is compiled with audit support the module will report when it denies access based on limit of maximum number of concurrent login sessions\&. |
| 50 |
.SH "OPTIONS" |
| 51 |
.PP |
| 52 |
conf=/path/to/limits\&.conf |
| 53 |
.RS 4 |
| 54 |
Indicate an alternative limits\&.conf style configuration file to override the default\&. |
| 55 |
.RE |
| 56 |
.PP |
| 57 |
debug |
| 58 |
.RS 4 |
| 59 |
Print debug information\&. |
| 60 |
.RE |
| 61 |
.PP |
| 62 |
set_all |
| 63 |
.RS 4 |
| 64 |
Set the limits for which no value is specified in the configuration file to the one from the process with the PID 1\&. Please note that if the init process is systemd these limits will not be the kernel default limits and this option should not be used\&. |
| 65 |
.RE |
| 66 |
.PP |
| 67 |
utmp_early |
| 68 |
.RS 4 |
| 69 |
Some broken applications actually allocate a utmp entry for the user before the user is admitted to the system\&. If some of the services you are configuring PAM for do this, you can selectively use this module argument to compensate for this behavior and at the same time maintain system\-wide consistency with a single limits\&.conf file\&. |
| 70 |
.RE |
| 71 |
.PP |
| 72 |
noaudit |
| 73 |
.RS 4 |
| 74 |
Do not report exceeded maximum logins count to the audit subsystem\&. |
| 75 |
.RE |
| 76 |
.SH "MODULE TYPES PROVIDED" |
| 77 |
.PP |
| 78 |
Only the |
| 79 |
\fBsession\fR |
| 80 |
module type is provided\&. |
| 81 |
.SH "RETURN VALUES" |
| 82 |
.PP |
| 83 |
PAM_ABORT |
| 84 |
.RS 4 |
| 85 |
Cannot get current limits\&. |
| 86 |
.RE |
| 87 |
.PP |
| 88 |
PAM_IGNORE |
| 89 |
.RS 4 |
| 90 |
No limits found for this user\&. |
| 91 |
.RE |
| 92 |
.PP |
| 93 |
PAM_PERM_DENIED |
| 94 |
.RS 4 |
| 95 |
New limits could not be set\&. |
| 96 |
.RE |
| 97 |
.PP |
| 98 |
PAM_SERVICE_ERR |
| 99 |
.RS 4 |
| 100 |
Cannot read config file\&. |
| 101 |
.RE |
| 102 |
.PP |
| 103 |
PAM_SESSION_ERR |
| 104 |
.RS 4 |
| 105 |
Error recovering account name\&. |
| 106 |
.RE |
| 107 |
.PP |
| 108 |
PAM_SUCCESS |
| 109 |
.RS 4 |
| 110 |
Limits were changed\&. |
| 111 |
.RE |
| 112 |
.PP |
| 113 |
PAM_USER_UNKNOWN |
| 114 |
.RS 4 |
| 115 |
The user is not known to the system\&. |
| 116 |
.RE |
| 117 |
.SH "FILES" |
| 118 |
.PP |
| 119 |
/etc/security/limits\&.conf |
| 120 |
.RS 4 |
| 121 |
Default configuration file |
| 122 |
.RE |
| 123 |
.SH "EXAMPLES" |
| 124 |
.PP |
| 125 |
For the services you need resources limits (login for example) put a the following line in |
| 126 |
/etc/pam\&.d/login |
| 127 |
as the last line for that service (usually after the pam_unix session line): |
| 128 |
.sp |
| 129 |
.if n \{\ |
| 130 |
.RS 4 |
| 131 |
.\} |
| 132 |
.nf |
| 133 |
#%PAM\-1\&.0 |
| 134 |
# |
| 135 |
# Resource limits imposed on login sessions via pam_limits |
| 136 |
# |
| 137 |
session required pam_limits\&.so |
| 138 |
|
| 139 |
.fi |
| 140 |
.if n \{\ |
| 141 |
.RE |
| 142 |
.\} |
| 143 |
.PP |
| 144 |
Replace "login" for each service you are using this module\&. |
| 145 |
.SH "SEE ALSO" |
| 146 |
.PP |
| 147 |
\fBlimits.conf\fR(5), |
| 148 |
\fBpam.d\fR(5), |
| 149 |
\fBpam\fR(7)\&. |
| 150 |
.SH "AUTHORS" |
| 151 |
.PP |
| 152 |
pam_limits was initially written by Cristian Gafton <gafton@redhat\&.com> |