PAM_TMPDIR(8)
π PAM_TMPDIR β¨
okay so bestie, welcome to pam_tmpdir(8) β straight out of the System Manager's Manual, no less π. this one's a PAM module and it's lowkey iconic for one very specific reason, so let's get into it π«Ά
πΈ NAME πΈ
pam_tmpdir β the PAM module that makes a secure directory for users' temporary files π
π SYNOPSIS π
pam_tmpdir.so
π¦ DESCRIPTION π¦
so here's the vibe: you can plug this module into the session stack of whatever service you want, and it hands out secure, per-user directories for temporary files. that's it, that's the whole personality. per-user, secure, temporary, slay β¨
π OPTIONS π
where do the users' temp dirs actually get made? you decide, bestie. you set it with an entry in /etc/security/tmpdir.conf:
tmpdir=/path/to/tmpdir
- the default? it's
/tmp/userβ that's where it goes if you don't say otherwise π
π MODULE TYPES PROVIDED π
so like, obviously this is meant to be used with the session module type β that's its whole moment. but it also provides account, auth, and password module types too. overachiever behavior fr fr π
β RETURN VALUES β
PAM_SUCCESSβ yay!! the temporary directory was successfully created πβ¨PAM_ABORTβ uh oh. something went wrong while trying to create that temporary directory πPAM_SERVICE_ERRβ an internal error happened. not our fault, not your fault, it's just giving internal π
π EXAMPLES π
1. let users log in even if pam_tmpdir fails to create a safe tmpdir:
session optional pam_tmpdir.so
2. deny login if an error occurs while setting up the safe tmpdir:
session required pam_tmpdir.so
NOTE: this could allow for a DoS attack if a malicious user creates/tmp/userbeforepam_tmpdirdoes. so like... be aware. this is the dramatic part. π¨
π§ SEE ALSO π§
π AUTHOR π
Tollef Fog Heen <tfheen@err.no> π
πΈ COPYRIGHT πΈ
Copyright Β© 2002-2012 Tollef Fog Heen <tfheen@err.no>.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (ngl that's the standard disclaimer but the caps lock is doing a LOT here π)
and that's the whole page bestie π«Ά this came from the System Manager's Manual, dated as PAM_TMPDIR(8) β so like, go forth and make secure temp dirs. periodt π
β¨
π¦ where this page comes from
- debian trixie: libpam-tmpdir 0.11
- nixpkgs unstable: pam_tmpdir 0.11
- ubuntu questing: libpam-tmpdir 0.11
- ubuntu resolute: libpam-tmpdir 0.11build1
- ubuntu stonking: libpam-tmpdir 0.11build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms