{"id":4598,"date":"2022-12-20T18:09:14","date_gmt":"2022-12-20T21:09:14","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/limits-conf-man5\/"},"modified":"2022-12-20T18:09:14","modified_gmt":"2022-12-20T21:09:14","slug":"limits-conf-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/limits-conf-man5\/","title":{"rendered":"LIMITS.CONF (man5)"},"content":{"rendered":"<h1 align=\"center\">LIMITS.CONF<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">limits.conf \u2212 configuration file for the pam_limits module<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>pam_limits.so<\/i> 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 \/etc\/security\/limits.conf file and *.conf files in the \/etc\/security\/limits.d directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The syntax of the lines is as follows:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i><domain><type><item><value><\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The fields listed above should be filled as follows:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b><domain><\/b><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">\u2022 a username<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">\u2022 a groupname, with <b>@group<\/b> syntax. This should not be confused with netgroups.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">\u2022 the wildcard <b>*<\/b>, for default entry.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">\u2022 the wildcard <b>%<\/b>, for maxlogins limit only, can also be used with <b>%group<\/b> syntax. If the <b>%<\/b> wildcard is used alone it is identical to using <b>*<\/b> with maxsyslogins limit. With a group specified after <b>%<\/b> it limits the total number of logins of all users that are member of the group.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">\u2022 an uid range specified as <i><min_uid><\/i><b>:<\/b><i><max_uid><\/i>. 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.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">\u2022 a gid range specified as <b>@<\/b><i><min_gid><\/i><b>:<\/b><i><max_gid><\/i>. 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&#8217;s supplementary groups are examined. For the range matches only the user&#8217;s primary group is examined.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">\u2022 a gid specified as <b>%:<\/b><i><gid><\/i> 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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b><type><\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>hard<\/b><\/p>\n<p style=\"margin-left:23%;\">for enforcing <b>hard<\/b> 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>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>soft<\/b><\/p>\n<p style=\"margin-left:23%;\">for enforcing <b>soft<\/b> resource limits. These limits are ones that the user can move up or down within the permitted range by any pre\u2212existing <b>hard<\/b> limits. The values specified with this token can be thought of as <i>default<\/i> values, for normal system usage.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>\u2212<\/b><\/p>\n<p style=\"margin-left:23%;\">for enforcing both <b>soft<\/b> and <b>hard<\/b> resource limits together.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">Note, if you specify a type of &#8216;\u2212&#8217; but neglect to supply the item and value fields then the module will never enforce any limits on the specified user\/group etc. .<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b><item><\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>core<\/b><\/p>\n<p style=\"margin-left:23%;\">limits the core file size (KB)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>data<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum data size (KB)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>fsize<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum filesize (KB)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>memlock<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum locked\u2212in\u2212memory address space (KB)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>nofile<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum number of open file descriptors<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>rss<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>stack<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum stack size (KB)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>cpu<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum CPU time (minutes)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>nproc<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum number of processes<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>as<\/b><\/p>\n<p style=\"margin-left:23%;\">address space limit (KB)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>maxlogins<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum number of logins for this user (this limit does not apply to user with <i>uid=0<\/i>)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>maxsyslogins<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum number of all logins on system; user is not allowed to log\u2212in if total number of all user logins is greater than specified number (this limit does not apply to user with <i>uid=0<\/i>)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>priority<\/b><\/p>\n<p style=\"margin-left:23%;\">the priority to run user process with (negative values boost process priority)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>locks<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum locked files (Linux 2.4 and higher)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>sigpending<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum number of pending signals (Linux 2.6 and higher)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>msgqueue<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum memory used by POSIX message queues (bytes) (Linux 2.6 and higher)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>nice<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum nice priority allowed to raise to (Linux 2.6.12 and higher) values: [\u221220,19]<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>rtprio<\/b><\/p>\n<p style=\"margin-left:23%;\">maximum realtime priority allowed for non\u2212privileged processes (Linux 2.6.12 and higher)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">All items support the values <i>\u22121<\/i>, <i>unlimited<\/i> or <i>infinity<\/i> indicating no limit, except for <b>priority<\/b> and <b>nice<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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 <i>required<\/i> is used, the module will reject the login if a limit could not be set.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In general, individual limits have priority over group limits, so if you impose no limits for <i>admin<\/i> 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>\n<p style=\"margin-left:11%; margin-top: 1em\">Also, please note that all limit settings are set <i>per login<\/i>. They are not global, nor are they permanent; existing only for the duration of the session. One exception is the <i>maxlogin<\/i> 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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In the <i>limits<\/i> configuration file, the &#8216;<b>#<\/b>&#8216; character introduces a comment \u2212 after which the rest of the line is ignored.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The pam_limits module does report configuration problems found in its configuration file and errors via <b>syslog<\/b>(3).<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These are some example lines which might be specified in \/etc\/security\/limits.conf.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">* soft core 0 <br \/> bodies manpages.csv script_extrae_body.sh script.sh usr hard nofile 512 <br \/> @student hard nproc 20 <br \/> @faculty soft nproc 20 <br \/> @faculty hard nproc 50 <br \/> ftp hard nproc 0 <br \/> @student \u2212 maxlogins 4 <br \/> :123 hard cpu 5000 <br \/> @500: soft cpu 10000 <br \/> 600:700 hard locks 10<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pam_limits<\/b>(8), <b>pam.d<\/b>(5), <b>pam<\/b>(8), <b>getrlimit<\/b>(2), <b>getrlimit<\/b>(3p)<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">pam_limits was initially written by Cristian Gafton <gafton@redhat.com><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  limits.conf \u2212 configuration file for the pam_limits module <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1545,1291],"class_list":["post-4598","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-limits","tag-man5"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4598"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4598\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}