Tryag File Manager
Home
-
Turbo Force
Current Path :
/
proc
/
self
/
root
/
usr
/
share
/
doc
/
pam-0.99.6.2
/
html
/
Upload File :
New :
File
Dir
//proc/self/root/usr/share/doc/pam-0.99.6.2/html/sag-pam_limits.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>6.14. pam_limits - limit resources</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="Linux-PAM_SAG.html" title="The Linux-PAM System Administrators' Guide"><link rel="up" href="sag-module-reference.html" title="Chapter 6. A reference guide for available modules"><link rel="prev" href="sag-pam_lastlog.html" title="6.13. pam_lastlog - display date of last login"><link rel="next" href="sag-pam_listfile.html" title="6.15. pam_listfile - deny or allow services based on an arbitrary file"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.14. pam_limits - limit resources</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sag-pam_lastlog.html">Prev</a> </td><th width="60%" align="center">Chapter 6. A reference guide for available modules</th><td width="20%" align="right"> <a accesskey="n" href="sag-pam_listfile.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sag-pam_limits"></a>6.14. pam_limits - limit resources</h2></div></div></div><div class="cmdsynopsis"><p><code class="command">pam_limits.so</code> [ change_uid ] [ conf=<em class="replaceable"><code>/path/to/limits.conf</code></em> ] [ debug ] [ utmp_early ] [ noaudit ]</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_limits-description"></a>6.14.1. DESCRIPTION</h3></div></div></div><p> The pam_limits PAM module sets limits on the system resources that can be obtained in a user-session. Users of <span class="emphasis"><em>uid=0</em></span> are affected by this limits, too. </p><p> By default limits are taken from the <code class="filename">/etc/security/limits.conf</code> config file. Then individual files from the <code class="filename">/etc/security/limits.d/</code> 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 explicitely specified with a module option then the files in the above directory are not parsed. </p><p> The module must not be called by a multithreaded application. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-limits.conf-description"></a>6.14.2. DESCRIPTION</h3></div></div></div><p> The syntax of the lines is as follows: </p><p> <em class="replaceable"><code><domain></code></em> <em class="replaceable"><code><type></code></em> <em class="replaceable"><code><item></code></em> <em class="replaceable"><code><value></code></em> </p><p> The fields listed above should be filled as follows: </p><div class="variablelist"><dl><dt><span class="term"> <code class="option"><domain></code> </span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p> a username </p></li><li><p> a groupname, with <span class="emphasis"><em>@group</em></span> syntax. This should not be confused with netgroups. </p></li><li><p> the wildcard <span class="emphasis"><em>*</em></span>, for default entry. </p></li><li><p> the wildcard <span class="emphasis"><em>%</em></span>, for maxlogins limit only, can also be used with <span class="emphasis"><em>%group</em></span> syntax. </p></li></ul></div></dd><dt><span class="term"> <code class="option"><type></code> </span></dt><dd><div class="variablelist"><dl><dt><span class="term"><code class="option">hard</code></span></dt><dd><p> for enforcing <span class="emphasis"><em>hard</em></span> resource limits. These limits are set by the superuser and enforced by the Kernel. The user cannot raise his requirement of system resources above such values. </p></dd><dt><span class="term"><code class="option">soft</code></span></dt><dd><p> for enforcing <span class="emphasis"><em>soft</em></span> resource limits. These limits are ones that the user can move up or down within the permitted range by any pre-exisiting <span class="emphasis"><em>hard</em></span> limits. The values specified with this token can be thought of as <span class="emphasis"><em>default</em></span> values, for normal system usage. </p></dd><dt><span class="term"><code class="option">-</code></span></dt><dd><p> for enforcing both <span class="emphasis"><em>soft</em></span> and <span class="emphasis"><em>hard</em></span> resource limits together. </p><p> Note, if you specify a type of '-' but neglect to supply the item and value fields then the module will never enforce any limits on the specified user/group etc. . </p></dd></dl></div></dd><dt><span class="term"> <code class="option"><item></code> </span></dt><dd><div class="variablelist"><dl><dt><span class="term"><code class="option">core</code></span></dt><dd><p>limits the core file size (KB)</p></dd><dt><span class="term"><code class="option">data</code></span></dt><dd><p>maximum data size (KB)</p></dd><dt><span class="term"><code class="option">fsize</code></span></dt><dd><p>maximum filesize (KB)</p></dd><dt><span class="term"><code class="option">memlock</code></span></dt><dd><p>maximum locked-in-memory address space (KB)</p></dd><dt><span class="term"><code class="option">nofile</code></span></dt><dd><p>maximum number of open files</p></dd><dt><span class="term"><code class="option">rss</code></span></dt><dd><p>maximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)</p></dd><dt><span class="term"><code class="option">stack</code></span></dt><dd><p>maximum stack size (KB)</p></dd><dt><span class="term"><code class="option">cpu</code></span></dt><dd><p>maximum CPU time (minutes)</p></dd><dt><span class="term"><code class="option">nproc</code></span></dt><dd><p>maximum number of processes</p></dd><dt><span class="term"><code class="option">as</code></span></dt><dd><p>address space limit</p></dd><dt><span class="term"><code class="option">maxlogins</code></span></dt><dd><p>maximum number of logins for this user</p></dd><dt><span class="term"><code class="option">maxsyslogins</code></span></dt><dd><p>maximum number of logins on system</p></dd><dt><span class="term"><code class="option">priority</code></span></dt><dd><p>the priority to run user process with (negative values boost process priority)</p></dd><dt><span class="term"><code class="option">locks</code></span></dt><dd><p>maximum locked files (Linux 2.4 and higher)</p></dd><dt><span class="term"><code class="option">sigpending</code></span></dt><dd><p>maximum number of pending signals (Linux 2.6 and higher)</p></dd><dt><span class="term"><code class="option">msqqueue</code></span></dt><dd><p>maximum memory used by POSIX message queues (bytes) (Linux 2.6 and higher)</p></dd><dt><span class="term"><code class="option">nice</code></span></dt><dd><p>maximum nice priority allowed to raise to (Linux 2.6.12 and higher)</p></dd><dt><span class="term"><code class="option">rtprio</code></span></dt><dd><p>maximum realtime priority allowed for non-privileged processes (Linux 2.6.12 and higher)</p></dd></dl></div></dd></dl></div><p> In general, individual limits have priority over group limits, so if you impose no limits for <span class="emphasis"><em>admin</em></span> group, but one of the members in this group have a limits line, the user will have its limits set according to this line. </p><p> Also, please note that all limit settings are set <span class="emphasis"><em>per login</em></span>. They are not global, nor are they permanent; existing only for the duration of the session. </p><p> In the <span class="emphasis"><em>limits</em></span> configuration file, the '<span class="emphasis"><em>#</em></span>' character introduces a comment - after which the rest of the line is ignored. </p><p> The pam_limits module does its best to report configuration problems found in its configuration file via <span class="citerefentry"><span class="refentrytitle">syslog</span>(3)</span>. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_limits-options"></a>6.14.3. OPTIONS</h3></div></div></div><div class="variablelist"><dl><dt><span class="term"> <code class="option">change_uid</code> </span></dt><dd><p> Change real uid to the user for who the limits are set up. Use this option if you have problems like login not forking a shell for user who has no processes. Be warned that something else may break when you do this. </p></dd><dt><span class="term"> <code class="option">conf=<em class="replaceable"><code>/path/to/limits.conf</code></em></code> </span></dt><dd><p> Indicate an alternative limits.conf style configuration file to override the default. </p></dd><dt><span class="term"> <code class="option">debug</code> </span></dt><dd><p> Print debug information. </p></dd><dt><span class="term"> <code class="option">utmp_early</code> </span></dt><dd><p> 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. </p></dd><dt><span class="term"> <code class="option">noaudit</code> </span></dt><dd><p> Do not report exceeded maximum logins count to the audit subsystem. </p></dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_limits-services"></a>6.14.4. MODULE SERVICES PROVIDED</h3></div></div></div><p> Only the <code class="option">session</code> service is supported. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_limits-return_values"></a>6.14.5. RETURN VALUES</h3></div></div></div><div class="variablelist"><dl><dt><span class="term">PAM_ABORT</span></dt><dd><p> Cannot get current limits. </p></dd><dt><span class="term">PAM_IGNORE</span></dt><dd><p> No limits found for this user. </p></dd><dt><span class="term">PAM_PERM_DENIED</span></dt><dd><p> New limits could not be set. </p></dd><dt><span class="term">PAM_SERVICE_ERR</span></dt><dd><p> Cannot read config file. </p></dd><dt><span class="term">PAM_SESSEION_ERR</span></dt><dd><p> Error recovering account name. </p></dd><dt><span class="term">PAM_SUCCESS</span></dt><dd><p> Limits were changed. </p></dd><dt><span class="term">PAM_USER_UNKNOWN</span></dt><dd><p> The user is not known to the system. </p></dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_limits-files"></a>6.14.6. FILES</h3></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="filename">/etc/security/limits.conf</code></span></dt><dd><p>Default configuration file</p></dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-limits.conf-examples"></a>6.14.7. EXAMPLES</h3></div></div></div><p> These are some example lines which might be specified in <code class="filename">/etc/security/limits.conf</code>. </p><pre class="programlisting"> * soft core 0 * hard rss 10000 @student hard nproc 20 @faculty soft nproc 20 @faculty hard nproc 50 ftp hard nproc 0 @student - maxlogins 4 </pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_limits-authors"></a>6.14.8. AUTHORS</h3></div></div></div><p> pam_limits was initially written by Cristian Gafton <gafton@redhat.com> </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sag-pam_lastlog.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sag-module-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sag-pam_listfile.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.13. pam_lastlog - display date of last login </td><td width="20%" align="center"><a accesskey="h" href="Linux-PAM_SAG.html">Home</a></td><td width="40%" align="right" valign="top"> 6.15. pam_listfile - deny or allow services based on an arbitrary file</td></tr></table></div></body></html>