PAM_SETQUOTA(8)

๐Ÿ’– PAM_SETQUOTA(8) ๐Ÿ’–

okay bestie, sit down, hydrate, because we're talking about pam_setquota โ€” straight out of the Linux-PAM Manual. it's a PAM module that sets or modifies disk quotas on session start, and honestly? it's giving โœจcentralized-user-database-realnessโœจ. no cap. let's get into it ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

pam_setquota โ€” a PAM module to set or modify disk quotas on session start ๐ŸŽ€


โœจ SYNOPSIS โœจ

pam_setquota.so [fs=/home] [overwrite=0] [debug=0] [startuid=1000]
                [enduid=0] [bsoftlimit=19000] [bhardlimit=20000]
                [isoftlimit=3000] [ihardlimit=4000]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so pam_setquota is a PAM module that sets or modifies a disk quota at session start. that's the whole vibe. ๐Ÿซถ

and the reason it's iconic? it makes quotas usable with central user databases, like MySQL or LDAP. yeah. your fancy central auth situation can have quotas too. we love to see it. ๐Ÿ’…


๐Ÿ’œ OPTIONS ๐Ÿ’œ

  • fs=/home โ€” the device file or mountpoint that the policy applies to. defaults to the filesystem containing the user's home directory. ๐Ÿ 
  • overwrite=0 โ€” overwrite an existing quota. but listen: enabling this will remove the ability for the admin to manually configure different quotas for users for a filesystem with edquota(8). defaults to 0.
โš ๏ธ bestie that's a real tradeoff, not a vibe. turn it on and you're handing the keys to this module. ๐Ÿšจ
  • debug=0 โ€” enable debugging. a value of 1 outputs the old and new quota on a device. a value of 2 also prints out the matched and found filesystems should fs be unset. defaults to 0. ๐Ÿ”
  • startuid=1000 โ€” describes the start of the UID range the policy is applied to. defaults to UID_MIN from login.defs, or the uidmin value defined at compile-time if UID_MIN is undefined. ๐ŸŽฏ
  • enduid=0 โ€” describes the end of the UID range the policy is applied to. setting enduid=0 results in an open-ended UID range (i.e. all uids greater than startuid are included). defaults to 0. ๐ŸŒˆ
  • bsoftlimit=19000 โ€” soft limit for disk quota blocks, as defined by quotactl(2). note: bsoftlimit and bhardlimit must be set at the same time! โš ๏ธ
  • bhardlimit=20000 โ€” hard limit for disk quota blocks, as defined by quotactl(2). note: bsoftlimit and bhardlimit must be set at the same time! โš ๏ธ
  • isoftlimit=3000 โ€” soft limit for inodes, as defined by quotactl(2). note: isoftlimit and ihardlimit must be set at the same time! โš ๏ธ
  • ihardlimit=4000 โ€” hard limit for inodes, as defined by quotactl(2). note: isoftlimit and ihardlimit must be set at the same time! โš ๏ธ

๐ŸŽ€ MODULE TYPES PROVIDED ๐ŸŽ€

only the session module type is provided. that's it. one type. she's focused. ๐Ÿ’…


๐Ÿ’€ RETURN VALUES ๐Ÿ’€

  • PAM_SUCCESS โ€” the quota was set successfully. slay! ๐ŸŽ‰
  • PAM_IGNORE โ€” no action was taken, because either the UID of the user was outside of the specified range, a quota already existed and overwrite=1 was not configured, or no limits were configured at all. ๐Ÿ™ˆ
  • PAM_USER_UNKNOWN โ€” the user was not found. ๐Ÿ˜ญ
  • PAM_PERM_DENIED โ€” this one's a whole list, buckle up:
    • /proc/mounts could not be opened.
    • the filesystem or device specified was not found.
    • the limits for the user could not be retrieved. see syslog for more information.
    • the limits for the user could not be set. see syslog for more information.
    • either isoftlimit/ihardlimit or bsoftlimit/bhardlimit were not set at the same time.

๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

a single invocation of pam_setquota applies a specific policy to a UID range. applying different policies to specific UID ranges is done by invoking pam_setquota more than once. the last matching entry defines the resulting quota. ๐Ÿ‘‘

session  required   pam_setquota.so bsoftlimit=1000 bhardlimit=2000 isoftlimit=1000 ihardlimit=2000 startuid=1000 enduid=0 fs=/home
session  required   pam_setquota.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=2001 enduid=3000 fs=/dev/sda1
session  required   pam_setquota.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=3001 enduid=4000 fs=/dev/sda1 overwrite=1
the way that third line just rolls in with overwrite=1 and takes overโ€ฆ main character energy fr fr. ๐Ÿซถ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

pam.conf(5), pam.d(5), pam(8)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

pam_setquota was originally written by Ruslan Savchenko <savrus@mexmat.net>. ๐ŸŽ€

further modifications were made by Shane Tzen <shane@ict.usc.edu>, Sven Hartge <sven@svenhartge.de> and Keller Fuchs <kellerfuchs@hashbang.sh>. ๐Ÿ’–


and that's the page, bestie!! ๐Ÿฆ‹ this whole thing came to you from Linux-PAM, dated 09/27/2026, filed under PAM_SETQUOTA(8) โ€” go set some quotas, you absolute icon. periodt. ๐Ÿ’…โœจ๐ŸŒธ

๐Ÿ“ฆ where this page comes from