MKPASSWD(1)

๐Ÿ“ฆ
version 5.6.6 ยท 6 versions
, in arch rolling, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– MKPASSWD ๐Ÿ’–

okay bestie, so this is the mkpasswd(1) page from your Debian GNU/Linux manual, section 1 โ€” and the vibe is: it's an Overfeatured front end to crypt(3). yes, that's literally what the NAME says. it said it, not me. ๐Ÿ™ˆ


โœจ SYNOPSIS โœจ

mkpasswd PASSWORD [SALT]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so here's the whole deal, and honestly it's giving minimal. mkpasswd takes your password and encrypts it using the crypt(3) libc function โ€” with the salt you hand it. that's it. that's the job. ๐Ÿ’…


๐ŸŽ€ OPTIONS ๐ŸŽ€

this is where the "overfeatured" part comes in, and I mean... the man page said it first:

  • -S STRING, --salt=STRING โ€” use STRING as the salt. but listen, if that string starts with $, it gets yeeted straight to crypt(3) with zero checks. no screening, no vibes check, just straight through. ๐Ÿซถ
  • -R NUMBER, --rounds=NUMBER โ€” use NUMBER rounds. now, this argument gets ignored if the method you picked doesn't do variable rounds โ€” so don't get attached. for the OpenBSD Blowfish method, this number is the logarithm of the number of rounds. and btw, the behavior is undefined if you use this without --method. undefined bestie. not a joke. ๐Ÿ˜ญ
  • -m TYPE, --method=TYPE โ€” compute the password with the TYPE method. if TYPE is help, you get the whole list of available methods printed out โ€” cute, a menu. and if TYPE begins and ends with $ characters, then the string is passed to crypt_gensalt(3) as-is. ๐Ÿ’ซ
  • -5 โ€” literally just like saying --method=md5crypt. a lil shortcut. iconic. โญ
  • -P NUM, --password-fd=NUM โ€” read the password from file descriptor NUM instead of using getpass(3). and here's the tea: if that file descriptor is not connected to a tty, then nothing but the hashed password gets printed on stdout. clean output, no extra chatter. ๐Ÿคซ
  • -s, --stdin โ€” exactly like --password-fd=0. same energy, shorter to type. โœจ

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

  • MKPASSWD_OPTIONS โ€” a list of options that gets evaluated before the ones you type on the command line. so yeah, it goes first. ๐Ÿ‘‘

๐Ÿ’€ BUGS ๐Ÿ’€

okay we have to be honest here, this is the part where we hold hands:

if you use the --stdin option, then passwords containing some control characters may not be read correctly. so like... be careful. ๐Ÿฅฒ

and also, and I quote: this program suffers of a bad case of featuritis. the man page said it. the man page is not wrong. not me being shady, I'm just the messenger. ๐Ÿ“


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

go read these, they're the extended universe:

passwd(1), passwd(5), crypt(3), crypt(5), crypt_gensalt(3), getpass(3).


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

mkpasswd and this man page were written by Marco d'Itri <md@linux.it>, and they're licensed under the terms of the GNU General Public License, version 2 or later. slay, honestly. ๐Ÿ’œ


and that's a wrap, bestie!! ๐ŸŽ€ this page was brought to you by Marco d'Itri, dated 2019-12-30, from the MKPASSWD(1) manual page โ€” go forth and hash responsibly, mwah ๐Ÿ’…โœจ