USERDBPW(8)

πŸ“¦
version 0.72.6 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute

πŸ’– USERDBPW(8) β€” bestie, we're making encrypted passwords πŸ’–

okay so welcome to USERDBPW(8), the little tool that creates an encrypted password for you without anyone peeking. it's from Double Precision, Inc. and it is, genuinely, a whole vibe. let's go 🫢


✨ NAME ✨

userdbpw β€” create an encrypted password ✨


🌸 SYNOPSIS 🌸

userdbpw [[-md5] | [-hmac-md5] | [-hmac-sha1]] |userdb {name} set
               {field}

πŸ¦‹ DESCRIPTION πŸ¦‹

So like. userdbpw enables secure entry of encrypted passwords into /etc/courier/userdb. it's giving ✨security✨, it's giving main character energy.

Here's the whole thing: userdbpw reads a single line of text on standard input, encrypts it, and prints the encrypted result to standard output. that's it. that's the job. πŸ’…

If standard input is attached to a terminal device, userdbpw explicitly issues a "Password: " prompt on standard error, and turns off echo while the password is entered. so nobody's reading over your shoulder, we love that for you πŸ™ˆ

The -md5 option is available on systems that use MD5-hashed passwords (such as systems that use the current version of the PAM library for authenticating, with MD5 passwords enabled). This option creates an MD5 password hash, instead of using the traditional crypt() function.

-hmac-md5 and -hmac-sha1 options are available only if the userdb library is installed by an application that uses a challenge/response authentication mechanism. -hmac-md5 creates an intermediate HMAC context using the MD5 hash function. -hmac-sha1 uses the SHA1 hash function instead. Whether either HMAC function is actually available depends on the actual application that installs the userdb library. iykyk 🧚

⚠️ okay bestie, listen up, this part is IMPORTANT. Note that even though the result of HMAC hashing looks like an encrypted password, it's really not. HMAC-based challenge/response authentication mechanisms require the cleartext password to be available as cleartext. Computing an intermediate HMAC context does scramble the cleartext password, however if its compromised, it WILL be possible for an attacker to succesfully authenticate. Therefore, applications that use challenge/response authentication will store intermediate HMAC contexts in the "pw" fields in the userdb database, which will be compiled into the userdbshadow.dat database, which has group and world permissions turned off. The userdb library also requires that the cleartext userdb source for the userdb.dat and userdbshadow.dat databases is also stored with the group and world permissions turned off.

πŸ’« HOW YOU ACTUALLY USE IT πŸ’«

userdbpw is usually used together in a pipe with userdb, which reads from standard input. For example:

userdbpw -md5 | userdb users/john set systempw

or:

userdbpw -hmac-md5 | userdb users/john set hmac-md5pw

These commands set the systempw field in the record for the user john in /etc/courier/userdb/users file, and the hmac-md5pw field. Don't forget to run makeuserdb for the change to take effect. πŸŽ€

The following command does the same thing:

userdb users/john set systempw=SECRETPASSWORD

However, this command passes the secret password as an argument to the userdb command, which can be viewed by anyone who happens to run ps(1) at the same time. Not the vibe. Not it at all. Using userdbpw allows the secret password to be specified in a way that cannot be easily viewed by ps(1). slay πŸ’…βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ“ NOTES πŸ“

  1. userdb(8) [set $man.base.url.for.relative.links]/userdb.html
  2. makeuserdb(8) [set $man.base.url.for.relative.links]/makeuserdb.html

and that's the whole page bestie, you ate that πŸ“πŸ’œ this masterpiece was brought to you by Double Precision, Inc., dated 10/28/2020, and it's filed under USERDBPW(8) forever and ever. mwah πŸ’‹πŸŒˆβ­

πŸ“¦ where this page comes from