pam_console_apply(8)

πŸ“¦ version 1.5.1, in centos-stream 9

πŸ’… pam_console_apply (8) β€” System Administrator's Manual ✨

okay bestie, heads up: this whole page is from the System Administrator's Manual, and honestly? it's giving "small helper binary with a lot of opinions about who gets to touch your devices." let's get into it πŸŽ€


🌸 NAME 🌸

pam_console_apply β€” set or revoke permissions for users at the system console πŸ’–


✨ SYNOPSIS ✨

pam_console_apply [-f <fstab file>] [-c <console.perms file>] [-r] [-t
<tty>] [-s] [-d] [<device file> ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so pam_console_apply is a little helper executable that sets or resets permissions on device nodes. that's literally its whole job, and it does it well πŸ’…

here's the vibe: if /var/run/console.lock exists, pam_console_apply will grant permissions to the user listed in there. if the lock file does not exist, permissions get reset according to the defaults set in console.perms files β€” which are normally configured so that root owns the devices. no lock, no special user, root takes the wheel πŸ‘‘

and when it's initializing its configuration? the order matters, so listen up: it first parses /etc/security/console.perms, and then it searches for files ending with the .perms suffix in the /etc/security/console.perms.d directory. those files are parsed in lexical order in the "C" locale 🌈. permission rules are appended to a global list (so nothing gets overwritten there), but console and device class definitions override previous definitions of the same class. iykyk 🧚


πŸŽ€ ARGUMENTS πŸŽ€

  • -c β€” load a different console.perms file than the default one πŸ—‚οΈ
  • -f β€” load a different fstab file than the default one (/etc/fstab) πŸ“œ
  • -r β€” signals pam_console_apply to reset permissions. the default behavior is to set permissions so that the user listed in /var/run/console.lock has access to the devices β€” and to reset permissions if no such file exists πŸ”„
  • -t β€” use <tty> to match the console class in the console.perms file. the default is tty0 πŸ–₯️
  • -s β€” write error messages to the system log instead of stderr πŸ“
  • -d β€” log/display messages useful for debugging πŸ›

the optional <device file> arguments constrain what files should be affected by pam_console_apply. if you don't specify them, permissions are changed on all files specified in the console.perms file. no cap, all of them 😭


πŸ’œ FILES πŸ’œ

/var/run/console.lock
/etc/security/console.perms
/etc/security/console.perms.d/50-default.perms

these are the little icons of the operation, bestie β€” know them, love them 🫢


🌟 SEE ALSO 🌟

go read those too, they're literally the extended lore πŸ“š


πŸ’€ BUGS πŸ’€

"Let's hope not" β€” the manpage's words, not mine, and honestly iconic 😭. but if you do find any, please report them via the "Bug Track" link at http://bugzilla.redhat.com/bugzilla/ πŸ”₯


πŸ‘‘ AUTHORS πŸ‘‘

Nalin Dahyabhai <nalin@redhat.com>, using code shamelessly stolen from parts of pam_console. the audacity, the confidence, we respect it πŸ’…

Support of console.perms.d and other improvements by Tomas Mraz <tmraz@redhat.com>. king behavior πŸ‘‘


one tiny reminder bestie: this is a permissions tool for device nodes, so please don't go feral with it πŸ™ˆ

that's the whole page! brought to you by Red Hat, dated 2005/5/2 β€” a certified classic, still slaying in pam_console_apply(8) form πŸ“βœ¨ bye bestie, go set some permissions responsibly πŸŽ€

πŸ“¦ where this page comes from