1MOSQUITTO_PASSWD(1)                Commands                MOSQUITTO_PASSWD(1)
2
3
4

NAME

6       mosquitto_passwd - manage password files for mosquitto
7

SYNOPSIS

9       mosquitto_passwd [-H hash] [-c | -D] passwordfile username
10
11       mosquitto_passwd [-H hash] -b passwordfile username password
12
13       mosquitto_passwd -U passwordfile
14

DESCRIPTION

16       mosquitto_passwd is a tool for managing password files for the
17       mosquitto MQTT broker.
18
19       Usernames must not contain ":". Passwords are stored in a similar
20       format to crypt(3).
21

OPTIONS

23       -b
24           Run in batch mode. This allows the password to be provided at the
25           command line which can be convenient but should be used with care
26           because the password will be visible on the command line and in
27           command history.
28
29       -c
30           Create a new password file. If the file already exists, it will be
31           overwritten.
32
33       -D
34           Delete the specified user from the password file.
35
36       -H
37           Choose the hash to use. Can be one of sha512-pbkdf2 or sha512.
38           Defaults to sha512-pbkdf2. The sha512 option is provided for
39           creating password files for use with Mosquitto 1.6 and earlier.
40
41       -U
42           This option can be used to upgrade/convert a password file with
43           plain text passwords into one using hashed passwords. It will
44           modify the specified file. It does not detect whether passwords are
45           already hashed, so using it on a password file that already
46           contains hashed passwords will generate new hashes based on the old
47           hashes and render the password file unusable.
48
49       passwordfile
50           The password file to modify.
51
52       username
53           The username to add/update/delete.
54
55       password
56           The password to use when in batch mode.
57

EXIT STATUS

59       mosquitto_sub returns zero on success, or non-zero on error. If the
60       connection is refused by the broker at the MQTT level, then the exit
61       code is the CONNACK reason code. If another error occurs, the exit code
62       is a libmosquitto return value.
63
64       MQTT v3.1.1 CONNACK codes:
65
660 Success
67
681 Connection refused: Bad protocol version
69
702 Connection refused: Identifier rejected
71
723 Connection refused: Server unavailable
73
744 Connection refused: Bad username/password
75
765 Connection refused: Not authorized
77
78       MQTT v5 CONNACK codes:
79
800 Success
81
82128 Unspecified error
83
84129 Malformed packet
85
86130 Protocol error
87
88131 Implementation specific error
89
90132 Unsupported protocol version
91
92133 Client ID not valid
93
94134 Bad username or password
95
96135 Not authorized
97
98136 Server unavailable
99
100137 Server busy
101
102138 Banned
103
104139 Server shutting down
105
106140 Bad authentication method
107
108141 Keep alive timeout
109
110142 Session taken over
111
112143 Topic filter invalid
113
114144 Topic name invalid
115
116147 Receive maximum exceeded
117
118148 Topic alias invalid
119
120149 Packet too large
121
122148 Message rate too high
123
124151 Quota exceeded
125
126152 Administrative action
127
128153 Payload format invalid
129
130154 Retain not supported
131
132155 QoS not supported
133
134156 Use another server
135
136157 Server moved
137
138158 Shared subscriptions not supported
139
140159 Connection rate exceeded
141
142160 Maximum connect time
143
144161 Subscription IDs not supported
145
146162 Wildcard subscriptions not supported
147

EXAMPLES

149       Add a user to a new password file:
150
151       •   mosquitto_passwd -c /etc/mosquitto/passwd ral
152
153       Delete a user from a password file
154
155       •   mosquitto_passwd -D /etc/mosquitto/passwd ral
156

BUGS

158       mosquitto bug information can be found at
159       https://github.com/eclipse/mosquitto/issues
160

SEE ALSO

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

AUTHOR

165       Roger Light <roger@atchoo.org>
166
167
168
169Mosquitto Project                 11/17/2021               MOSQUITTO_PASSWD(1)
Impressum