PAM_UMASK(8)
๐ PAM_UMASK(8) ๐
okay bestie, welcome to the Linux-PAM Manual entry for pam_umask โ yes that's the whole manual name, we're fancy here โจ
๐ธ NAME ๐ธ
pam_umask โ a PAM module that sets the file mode creation mask. that's it, that's the girl ๐
๐ฆ SYNOPSIS ๐ฆ
pam_umask.so [debug] [silent] [usergroups] [nousergroups] [umask=mask]
โจ DESCRIPTION โจ
so pam_umask is a PAM module whose whole personality is setting the file mode creation mask of the current environment. and why do we care?? because the umask literally decides the default permissions that get handed to every newly created file. main character behavior fr fr ๐
now here's the part where it gets detective-y. the module goes looking for the umask value in these places, in this exact order:
- a
umask=entry in the user's GECOS field (more on that in a sec, bestie, don't worry) - the
umask=argument - the
UMASKentry from/etc/login.defs - the
UMASK=entry from/etc/default/login
so like. it checks them in that order and that's the vibe check that matters. ๐
now, about that GECOS field โ it gets split on comma ',' characters, and your entries have to live in its 'other' (sub-)field, which is the 5th field within the GECOS field. you could set that, for example, with chfn --other. and listen, besides the umask= entry, this module also recognizes two more little icons:
- the
pri=entry, which sets the nice priority value for the session - the
ulimit=entry, which sets the maximum size of files the processes in the session can create
the way it just knows three things at once?? obsessed ๐ญ
๐ OPTIONS ๐
debugโ print debug information. little peek behind the curtain, we love to see it ๐silentโ don't print informative messages. she's quiet, she's mysterious, she's giving less-is-more ๐ซถusergroupsโ if the user is not root and the username is the same as the primary group name, then the umask group bits get set to be the same as the owner bits. examples so you get it:022->002,077->007โจnousergroupsโ literally the direct opposite of theusergroupsoption above โ๏ธ which is useful whenpam_umaskwas compiled withusergroupsenabled by default and you wanna turn it off at runtime. no cap, sometimes you just need the off switch.umask=maskโ sets the calling process's file mode creation mask (umask) tomask & 0777. and the value is interpreted as Octal, so don't come at it with decimal, she will not be doing that ๐ซ
๐ MODULE TYPES PROVIDED ๐
only the session type is provided. one type, one vibe, absolutely slaying it. ๐
๐ RETURN VALUES ๐
PAM_SUCCESSโ the new umask was set successfully. we ate and left no crumbs ๐ฅPAM_BUF_ERRโ memory buffer error ๐ญPAM_CONV_ERRโ the conversation method supplied by the application failed to obtain the username. rude of it tbhPAM_INCOMPLETEโ the conversation method supplied by the application returnedPAM_CONV_AGAIN. it's giving "not yet bestie"PAM_SERVICE_ERRโ no username was given. ๐PAM_USER_UNKNOWNโ user not known. who is she?? nobody knows her ๐
๐ EXAMPLES ๐
wanna set the user specific umask at login? add this exact line to /etc/pam.d/login and watch the magic happen:
session optional pam_umask.so umask=0022
๐ SEE ALSO ๐
pam.conf(5), pam.d(5), pam(8) โ go read your sisters, bestie, iykyk ๐
๐ AUTHOR ๐
pam_umask was written by Thorsten Kukuk <kukuk@thkukuk.de>. thank you for your service king ๐ซก
and that's the whole page!! Linux-PAM, 09/27/2026 โ periodt, go set your umask responsibly babes ๐โจ๐๐ฆ๐ธ
๐ฆ where this page comes from
- arch rolling: pam 1.7.3-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms