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 ofargon2id,sha512-pbkdf2, orsha512. Defaults toargon2idβ. Thesha512option 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
- alpine 3.24: mosquitto-doc 2.1.2-r1 Β· EPL-1.0 OR EPL-2.0
- fedora 44: mosquitto 2.1.2-1.fc44 Β· EPL-2.0
- fedora 44: mosquitto 2.1.2-1.fc44 Β· EPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms