- Add a new user to a password file (will prompt to enter the password):
mosquitto_passwd path/to/password_file username
- Create the password file if it doesn't already exist:
mosquitto_passwd -c path/to/password_file username
- Delete the specified username instead:
mosquitto_passwd -D path/to/password_file username
- Upgrade an old plain-text password file to a hashed password file:
mosquitto_passwd -U path/to/password_file
mosquitto_passwd [-c | -D] passwordfile username
mosquitto_passwd -b passwordfile username password
mosquitto_passwd -U passwordfile
mosquitto_passwd is a tool for managing password files for the mosquitto MQTT broker.
Usernames must not contain ":". Passwords are stored in a similar format to crypt(3).
Run in batch mode. This allows the password to be provided at the command line which can be convenient but should be used with care because the password will be visible on the command line and in command history.
Create a new password file. If the file already exists, it will be overwritten.
Delete the specified user from the password file.
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. It 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.
The password file to modify.
The username to add/update/delete.
The password to use when in batch mode.
Add a user to a new password file:
- mosquitto_passwd -c /etc/mosquitto/passwd ral
Delete a user from a password file
- mosquitto_passwd -D /etc/mosquitto/passwd ral
mosquitto bug information can be found at https://github.com/eclipse/mosquitto/issues
mosquitto(8), mosquitto.conf(5), mqtt(7)
Roger Light <firstname.lastname@example.org>