PKTTYAGENT(1)

๐Ÿ“ฆ
version 128 ยท 4 versions
, in alpine 3.24, arch rolling, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

โœจ PKTTYAGENT(1) โœจ

okay so bestie, welcome to pkttyagent(1) from the pkttyagent manual, section 1 ๐Ÿ’– this is the whole vibe, let's go.


๐ŸŒธ NAME ๐ŸŒธ

pkttyagent โ€” your textual authentication helper, aka the little terminal bestie that handles auth for you ๐Ÿซถ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

pkttyagent [--version] [--help]

pkttyagent [--process { pid | pid,pid-start-time } |
           --system-bus-name busname] [--notify-fd fd] [--fallback]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

pkttyagent is what you run when you want to start a textual authentication agent for a subject. And who's the subject, you ask? Whoever you point at with either --process or --system-bus-name. If you don't pass either of those, no stress โ€” it just uses the parent process. easy ๐Ÿ’ซ

Now, if you wanna get notified when the authentication agent has been registered, you've got two options (not like, bad options, good options):

  • listen for the Changed D-Bus signal, or
  • use --notify-fd and hand over the number of a file descriptor that was passed to the program.

That file descriptor? It gets closed once the authentication agent has been successfully registered. so that's your lil "we're in, bestie" ping โœจ

And if you use --fallback, the textual authentication agent will not replace an existing authentication agent. it knows how to share the aux, iconic behavior tbh ๐Ÿ‘‘


๐Ÿ”ฅ RETURN VALUE ๐Ÿ”ฅ

Let's talk outcomes, because we love a clear signal:

  • If the authentication agent could not be registered, pkttyagent exits with an exit code of 127. Diagnostic messages get printed on standard error. ๐Ÿ’€
  • If one or more of the options you passed are malformed, pkttyagent exits with an exit code of 126. And if stdin is a tty, then this manual page is also shown. (yes bestie, the manpage itself is the error message, we love a self-aware king ๐Ÿ˜ญ)
  • If the authentication agent was successfully registered, pkttyagent will keep running, interacting with the user as needed. When its services are no longer needed, the process can be killed. slay, then bye ๐Ÿ‘‹

โญ NOTES โญ

okay this part is important, listen up:

Since process identifiers can be recycled, the caller should always use pid,pid-start-time when using the --process option.

The value of pid-start-time can be determined by consulting e.g. the proc(5) file system, depending on the operating system. And if you only pass pid to the --process option, then pkttyagent will look up the start time itself โ€” but note that this may be racy. ngl, don't do that to yourself ๐Ÿ™ˆ


๐ŸŒˆ OPTIONS ๐ŸŒˆ

  • --version โ€” the version flag, sitting right there in the first synopsis line ๐Ÿ’…
  • --help โ€” the help flag, right next to it, equally iconic ๐ŸŽ€
  • --process { pid | pid,pid-start-time } โ€” pick your subject by process. you can give just a pid, or go the safe route with pid,pid-start-time (see the NOTES above, bestie, it's giving responsible ๐Ÿ”ฅ)
  • --system-bus-name busname โ€” pick your subject by system bus name instead โœจ
  • --notify-fd fd โ€” pass the number of a file descriptor that was passed to the program; it gets closed once the authentication agent is successfully registered ๐Ÿฆ‹
  • --fallback โ€” makes it so the textual authentication agent will not replace an existing authentication agent ๐Ÿ™Œ

๐Ÿ’œ AUTHOR ๐Ÿ’œ

Written by David Zeuthen <davidz@redhat.com> with a lot of help from many others. group project, and they ate ๐Ÿซถ


๐Ÿ“ BUGS ๐Ÿ“

Please send bug reports to either the distribution or the polkit-devel mailing list, see:

https://github.com/polkit-org/polkit#bugs-and-development

๐Ÿงš SEE ALSO ๐Ÿงš

polkit(8), polkitd(8), pkaction(1), pkcheck(1), pkexec(1)


that's the whole page bestie, you're so welcome ๐Ÿ’– this came to you from polkit, dated May 2009, living under the name PKTTYAGENT(1). go forth and authenticate, main character ๐ŸŒŸ