PAM_TTY_AUDIT(8)

💅 pam_tty_audit — the manual, bestie edition 💅

okay so this is pam_tty_audit(8), living in the Linux-PAM Manual, and it's genuinely one of those little modules that has main character energy once you know what it does. let's get into it 🫶


✨ NAME ✨

pam_tty_audit — turn TTY auditing on or off for the users you pick, no cap.


✨ SYNOPSIS ✨

pam_tty_audit.so [disable=patterns] [enable=patterns]

✨ DESCRIPTION ✨

so the pam_tty_audit PAM module is the one that flips TTY auditing on and off. that's the whole job. that's the vibe. 🌸

and here's the thing — by default the kernel does not audit input on any TTY. like, it's just not watching. so if you want receipts, you have to ask for them, bestie.


✨ OPTIONS ✨

  • disable=patterns — for every user matching patterns, TTY auditing gets disabled. this one overrides any earlier enable option that matched the same user name on the command line. (peep the NOTES section for the whole story on what patterns can be 👀)
  • enable=patterns — for every user matching patterns, TTY auditing gets enabled. and yes, this overrides any earlier disable option that matched the same user name on the command line. (again, NOTES has the patterns lore 💖)
  • open_only — sets the TTY audit flag when the session opens, but does not restore it when the session closes. you literally need this for some services that don't fork() to run the authenticated session — think sudo. she's specific but she's necessary, periodt.
  • log_passwd — logs keystrokes when ECHO mode is off but ICANON mode is active. that's the exact mode the tty gets put into during password entry. by default, passwords are not logged. heads up though: this option may not be available on older kernels (3.9?). 💀

✨ MODULE TYPES PROVIDED ✨

only the session type is supported. that's it. one type. she's focused. 💅


✨ RETURN VALUES ✨

  • PAM_SESSION_ERR — error reading or modifying the TTY audit flag. go check the system log for the details, bestie, it'll spill the tea there.
  • PAM_SUCCESS — success. slay. ✨

✨ NOTES ✨

when TTY auditing is enabled, it is inherited by all processes started by that user. read that again. 😭

in particular, daemons restarted by a user will still have TTY auditing enabled, and they'll audit TTY input even by other users unless auditing for those users is explicitly disabled. so yeah. therefore, it is recommended to use disable=* as the first option for most daemons using PAM. do it. for me. 🫶

to view the data that was logged by the kernel to audit, use this command:

aureport --tty

now, the patterns — they're comma separated lists of glob patterns, or ranges of uids. a range is specified as min_uid:max_uid where one of these values can be empty:

  • if min_uid is empty, only the user with the uid max_uid will be matched.
  • if max_uid is empty, users with the uid greater than or equal to min_uid will be matched.

and a lil warning that is lowkey important:

please note that passwords in some circumstances may be logged by TTY auditing even if the log_passwd is not used. for example, all input to an ssh session will be logged — even if there is a password being typed into some software running at the remote host — because only the local TTY state affects the local TTY auditing. it's giving "not my problem, that's the remote host's business." 🙈

✨ EXAMPLES ✨

audit all administrative actions. iconic behavior:

session   required pam_tty_audit.so disable=* enable=root

✨ SEE ALSO ✨

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

go read those too, iykyk 🦋


✨ AUTHOR ✨

pam_tty_audit was written by Miloslav Trmač <mitr@redhat.com>. the log_passwd option was added by Richard Guy Briggs <rgb@redhat.com>. legends only. 👑


and that's the whole page, bestie!! this was the Linux-PAM version, dated 09/27/2026 — love that for us. go audit responsibly 💖✨🎀

📦 where this page comes from