{
    "mode": "man",
    "parameter": "LIMITS.CONF",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/LIMITS.CONF/5/json",
    "generated": "2026-11-24T02:16:55Z",
    "sections": {
        "NAME": {
            "content": "limits.conf - configuration file for the pamlimits module\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The pamlimits.so module applies ulimit limits, nice priority and number of simultaneous\nlogin sessions limit to user login sessions. This description of the configuration file\nsyntax applies to the /etc/security/limits.conf file and *.conf files in the\n/etc/security/limits.d directory.\n\nThe syntax of the lines is as follows:\n\n<domain> <type> <item> <value>\n\nThe fields listed above should be filled as follows:\n\n<domain>\n\n•   a username\n\n•   a groupname, with @group syntax. This should not be confused with netgroups.\n\n•   the wildcard *, for default entry.\n\n•   the wildcard %, for maxlogins limit only, can also be used with %group syntax. If the\n% wildcard is used alone it is identical to using * with maxsyslogins limit. With a\ngroup specified after % it limits the total number of logins of all users that are\nmember of the group.\n\n•   an uid range specified as <minuid>:<maxuid>. If minuid is omitted, the match is\nexact for the maxuid. If maxuid is omitted, all uids greater than or equal minuid\nmatch.\n\n•   a gid range specified as @<mingid>:<maxgid>. If mingid is omitted, the match is\nexact for the maxgid. If maxgid is omitted, all gids greater than or equal mingid\nmatch. For the exact match all groups including the user's supplementary groups are\nexamined. For the range matches only the user's primary group is examined.\n\n•   a gid specified as %:<gid> applicable to maxlogins limit only. It limits the total\nnumber of logins of all users that are member of the group with the specified gid.\n\nNOTE: group and wildcard limits are not applied to the root user. To set a limit for the\nroot user, this field must contain the literal username root.\n\n<type>\n\nhard\nfor enforcing hard resource limits. These limits are set by the superuser and\nenforced by the Kernel. The user cannot raise his requirement of system resources\nabove such values.\n\nsoft\nfor enforcing soft resource limits. These limits are ones that the user can move up\nor down within the permitted range by any pre-existing hard limits. The values\nspecified with this token can be thought of as default values, for normal system\nusage.\n\n-\nfor enforcing both soft and hard resource limits together.\n\nNote, if you specify a type of '-' but neglect to supply the item and value fields\nthen the module will never enforce any limits on the specified user/group etc. .\n\n<item>\n\ncore\nlimits the core file size (KB)\n\ndata\nmaximum data size (KB)\n\nfsize\nmaximum filesize (KB)\n\nmemlock\nmaximum locked-in-memory address space (KB)\n\nnofile\nmaximum number of open file descriptors\n\nrss\nmaximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)\n\nstack\nmaximum stack size (KB)\n\ncpu\nmaximum CPU time (minutes)\n\nnproc\nmaximum number of processes\n\nas\naddress space limit (KB)\n\nmaxlogins\nmaximum number of logins for this user (this limit does not apply to user with uid=0)\n\nmaxsyslogins\nmaximum number of all logins on system; user is not allowed to log-in if total number\nof all user logins is greater than specified number (this limit does not apply to\nuser with uid=0)\n\nnonewprivs\nvalue of 0 or 1; if set to 1 disables acquiring new privileges by invoking\nprctl(PRSETNONEWPRIVS)\n\npriority\nthe priority to run user process with (negative values boost process priority)\n\nlocks\nmaximum locked files (Linux 2.4 and higher)\n\nsigpending\nmaximum number of pending signals (Linux 2.6 and higher)\n\nmsgqueue\nmaximum memory used by POSIX message queues (bytes) (Linux 2.6 and higher)\n\nnice\nmaximum nice priority allowed to raise to (Linux 2.6.12 and higher) values: [-20,19]\n\nrtprio\nmaximum realtime priority allowed for non-privileged processes (Linux 2.6.12 and\nhigher)\n\nchroot\nthe directory to chroot the user to\n\nAll items support the values -1, unlimited or infinity indicating no limit, except for\npriority, nice, and nonewprivs. If nofile is to be set to one of these values, it will be set\nto the contents of /proc/sys/fs/nropen instead (see setrlimit(3)).\n\nIf a hard limit or soft limit of a resource is set to a valid value, but outside of the\nsupported range of the local system, the system may reject the new limit or unexpected\nbehavior may occur. If the control value required is used, the module will reject the login\nif a limit could not be set.\n\nIn general, individual limits have priority over group limits, so if you impose no limits for\nadmin group, but one of the members in this group have a limits line, the user will have its\nlimits set according to this line.\n\nAlso, please note that all limit settings are set per login. They are not global, nor are\nthey permanent; existing only for the duration of the session. One exception is the maxlogin\noption, this one is system wide. But there is a race, concurrent logins at the same time will\nnot always be detect as such but only counted as one.\n\nIn the limits configuration file, the '#' character introduces a comment - after which the\nrest of the line is ignored.\n\nThe pamlimits module does report configuration problems found in its configuration file and\nerrors via syslog(3).\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "These are some example lines which might be specified in /etc/security/limits.conf.\n\n*               soft    core            0\nroot            hard    core            100000\n*               hard    nofile          512\n@student        hard    nproc           20\n@faculty        soft    nproc           20\n@faculty        hard    nproc           50\nftp             hard    nproc           0\n@student        -       maxlogins       4\n@student        -       nonewprivs      1\n:123            hard    cpu             5000\n@500:           soft    cpu             10000\n600:700         hard    locks           10\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pamlimits(8), pam.d(5), pam(7), getrlimit(2), getrlimit(3p)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "pamlimits was initially written by Cristian Gafton <gafton@redhat.com>\n\nLinux-PAM                                    05/07/2023                               LIMITS.CONF(5)",
            "subsections": []
        }
    },
    "summary": "limits.conf - configuration file for the pamlimits module",
    "flags": [],
    "examples": [
        "These are some example lines which might be specified in /etc/security/limits.conf.",
        "*               soft    core            0",
        "root            hard    core            100000",
        "*               hard    nofile          512",
        "@student        hard    nproc           20",
        "@faculty        soft    nproc           20",
        "@faculty        hard    nproc           50",
        "ftp             hard    nproc           0",
        "@student        -       maxlogins       4",
        "@student        -       nonewprivs      1",
        ":123            hard    cpu             5000",
        "@500:           soft    cpu             10000",
        "600:700         hard    locks           10"
    ],
    "see_also": [
        {
            "name": "pamlimits",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/pamlimits/8/json"
        },
        {
            "name": "pam.d",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.d/5/json"
        },
        {
            "name": "pam",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pam/7/json"
        },
        {
            "name": "getrlimit",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/getrlimit/2/json"
        },
        {
            "name": "getrlimit",
            "section": "3p",
            "url": "https://www.chedong.com/phpMan.php/man/getrlimit/3p/json"
        }
    ]
}