MOSQUITTO_PASSWD(1)

πŸ’… mosquitto_passwd β€” the glow-up page

okay bestie, welcome to MOSQUITTO_PASSWD(1) from the Commands girlies ✨ this is the whole manual, just... cuter. let's go.


🌸 NAME 🌸

mosquitto_passwd β€” manage password files for mosquitto πŸŽ€


✨ SYNOPSIS ✨

like, here's the whole shape of it, no cap:

mosquitto_passwd [-H hash] [-c | -D] passwordfile username

mosquitto_passwd [-H hash] -b passwordfile username password

mosquitto_passwd -U passwordfile

πŸ¦‹ DESCRIPTION πŸ¦‹

mosquitto_passwd is literally the tool for managing password files for the mosquitto MQTT broker. main character energy fr πŸ’…

okay so important thing: usernames must not contain : β€” that's the whole rule, do not test it.

Passwords are stored in a similar format to crypt(3). slay.


πŸ‘‘ OPTIONS πŸ‘‘

here come the flags, bestie, every single one:

  • -b β€” Run in batch mode. This lets you pass the password right there on the command line, which is convenient, lowkey... but be careful with it, because the password will be visible on the command line and in your command history 😭 yeah. it's giving exposed.
  • -c β€” Create a new password file. If the file already exists, it will be overwritten (brutal, but that's her πŸ’€). If the filename is specified as a dash - then the output will be to stdout. This only really makes sense with -b.
  • -D β€” Delete the specified user from the password file. bye bestie 🫢
  • -H β€” Choose the hash to use. Can be one of argon2id, sha512-pbkdf2, or sha512. Defaults to argon2id ⭐. The sha512 option is provided for creating password files for use with Mosquitto 1.6 and earlier.
  • -U β€” This option can be used to upgrade/convert a password file with plain text passwords into one using hashed passwords. It will modify the specified file. πŸ”₯
warning, babes, read this one twice πŸ™ˆ β€” -U does not detect whether passwords are already hashed, so using it on a password file that already contains hashed passwords will generate new hashes based on the old hashes and render the password file unusable. like... completely unusable. do not do that.

and the positional girlies:

  • passwordfile β€” The password file to modify.
  • username β€” The username to add/update/delete.
  • password β€” The password to use when in batch mode.

πŸ’€ EXIT STATUS πŸ’€

mosquitto_passwd returns zero on success or non-zero on error. simple as that, periodt.


🌈 EXAMPLES 🌈

these are the moments, iykyk:

Add a user to a new password file:

  • mosquitto_passwd -c /etc/mosquitto/passwd ral

Add a user to an existing password file:

  • mosquitto_passwd /etc/mosquitto/passwd ral

Add a user to an existing password file, passing the password on the command line:

  • mosquitto_passwd -b /etc/mosquitto/passwd ral z2Dr0BsvtZ

Update the password for a user in an existing password file:

  • mosquitto_passwd /etc/mosquitto/passwd ral

Add a user to an existing password file using the sha512 hash for Mosquitto 1.6 compatibility:

  • mosquitto_passwd -H sha512 /etc/mosquitto/passwd ral

Delete a user from a password file

  • mosquitto_passwd -D /etc/mosquitto/passwd ral

🧚 ENVIRONMENT VARIABLES 🧚

  • MOSQUITTO_UNSAFE_ALLOW_SYMLINKS β€” By default, sensitive file with a path including a symbolic link will be refused to be loaded. Set this environment variable to any value to allow load files through symbolic links.
bestie listen 🚨 note that making use of this variable could expose you to symlink attacks and so it should only be used in cases where you are absolutely sure this is not a risk. like absolutely absolutely.

πŸ“ BUGS πŸ“

mosquitto bug information can be found at https://github.com/eclipse-mosquitto/mosquitto/issues β€” go snitch, they're nice about it πŸ’–


⭐ SEE ALSO ⭐

mosquitto(7), mosquitto(8), mosquitto.conf(5), mqtt(7)


πŸ’œ AUTHOR πŸ’œ

Roger Light <roger@atchoo.org> β€” king behavior πŸ‘‘


and that's the whole page, bestie!! πŸŒΈπŸ¦‹πŸŽ€

mwah πŸ’‹ β€” this lil masterpiece is brought to you by the Mosquitto Project, stamped 02/09/2026, and it's MOSQUITTO_PASSWD(1) all day every day. go forth and hash responsibly ✨

πŸ“¦ where this page comes from