checkpassword.login(8)
π checkpassword.login(8) π
okay bestie, pull up a chair, we're doing checkpassword.login from the System Manager's Manual and honestly? it's giving secure. this whole page is about checkpassword, a lil program whose entire job is checking a password, and she does it flawlessly.
β¨ NAME β¨
checkpassword β check a password π
πΈ SYNOPSIS πΈ
checkpassword prog
π¦ DESCRIPTION π¦
so here's the tea. checkpassword reads descriptor 3 all the way through end of file, and then it closes descriptor 3. done. bye. and there has to be at most 512 bytes of data before end of file β no cap, that's the cap.
the info you hand over on descriptor 3 is laid out like this, in order:
- a login name, terminated by
\0 - a password, terminated by
\0 - a timestamp, terminated by
\0 - and possibly more data after that, if you're feeling extra
and that's literally it β there are no other restrictions on the form of the login name, the password, or the timestamp. go wild, they're just bytes.
now for the exits, and bestie, pay attention because these numbers matter:
- if the password is unacceptable,
checkpasswordexits1. - if
checkpasswordis misused, it may instead exit2. - if there's a temporary problem checking the password,
checkpasswordexits111.
but if the password is acceptable? oh she's moving. checkpassword runs prog, and prog consists of one or more arguments. periodt. π
π COMPATIBLE TOOLS π
there are other tools out there offering the exact same interface as checkpassword β same energy, different girlies. and apps that use checkpassword are encouraged to take the checkpassword name as an argument, so they can vibe with all the different tools instead of being locked in. flexibility is the moment.
heads up though: these tools do not follow the getopt(3) interface. none of that. optional features are controlled through (1) the tool name and (2) environment variables. that's the whole system, iykyk.
π THE PASSWORD DATABASE π
checkpassword checks the login name and password against /etc/passwd, using the operating system's getpwnam(3) and crypt(3) functions, supplemented by getspnam. she rejects accounts with empty passwords (as she should π
) and she ignores the timestamp.
other checkpassword-compatible tools interpret login names, passwords, and timestamps differently, so don't assume everyone reads the same. here's the important part: both the login name and the password should be treated as secrets by the application calling checkpassword β the only distinction between them is for administrative convenience. that's it. the timestamp should include any other information that the password is based on; for example, the challenge in a challenge-response system such as APOP.
β οΈ WARNING:getpwnamis inherently unreliable. it fails to distinguish between temporary errors and nonexistent users. future versions ofgetpwnam(3)should returnETXTBSYto indicate temporary errors andESRCHto indicate nonexistent users. not her fault, she's just working with what she's got π
π PROCESS-STATE CHANGES π
before invoking prog, checkpassword sets up:
$USER$HOME$SHELL- its supplementary groups
- its gid
- its uid
- its working directory
other checkpassword-compatible tools may make different changes to the process state, so don't just assume. it is crucial for these effects to be documented β different applications have different requirements. no guessing, bestie. π
π SEE ALSO π
and that's the whole page, fr fr π«Ά this was checkpassword.login(8) from the System Manager's Manual, living in checkpassword.login(8) land β signed off, sealed, and absolutely iconic. now go check some passwords responsibly. mwah πβ¨
π¦ where this page comes from
- debian bookworm: fgetty 0.7-7+b2 Β· GPL-2.0-or-later
- debian trixie: fgetty 0.7-11 Β· GPL-2.0-or-later
- ubuntu jammy: fgetty 0.7-7 Β· GPL-2.0-or-later
- ubuntu noble: fgetty 0.7-9 Β· GPL-2.0-or-later
- ubuntu questing: fgetty 0.7-11
- ubuntu resolute: fgetty 0.7-12 Β· GPL-2.0-or-later
- ubuntu stonking: fgetty 0.7-12 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms