1MOSQUITTO_PASSWD(1) Commands MOSQUITTO_PASSWD(1)
2
3
4
6 mosquitto_passwd - manage password files for mosquitto
7
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
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
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
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
66 • 0 Success
67
68 • 1 Connection refused: Bad protocol version
69
70 • 2 Connection refused: Identifier rejected
71
72 • 3 Connection refused: Server unavailable
73
74 • 4 Connection refused: Bad username/password
75
76 • 5 Connection refused: Not authorized
77
78 MQTT v5 CONNACK codes:
79
80 • 0 Success
81
82 • 128 Unspecified error
83
84 • 129 Malformed packet
85
86 • 130 Protocol error
87
88 • 131 Implementation specific error
89
90 • 132 Unsupported protocol version
91
92 • 133 Client ID not valid
93
94 • 134 Bad username or password
95
96 • 135 Not authorized
97
98 • 136 Server unavailable
99
100 • 137 Server busy
101
102 • 138 Banned
103
104 • 139 Server shutting down
105
106 • 140 Bad authentication method
107
108 • 141 Keep alive timeout
109
110 • 142 Session taken over
111
112 • 143 Topic filter invalid
113
114 • 144 Topic name invalid
115
116 • 147 Receive maximum exceeded
117
118 • 148 Topic alias invalid
119
120 • 149 Packet too large
121
122 • 148 Message rate too high
123
124 • 151 Quota exceeded
125
126 • 152 Administrative action
127
128 • 153 Payload format invalid
129
130 • 154 Retain not supported
131
132 • 155 QoS not supported
133
134 • 156 Use another server
135
136 • 157 Server moved
137
138 • 158 Shared subscriptions not supported
139
140 • 159 Connection rate exceeded
141
142 • 160 Maximum connect time
143
144 • 161 Subscription IDs not supported
145
146 • 162 Wildcard subscriptions not supported
147
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
158 mosquitto bug information can be found at
159 https://github.com/eclipse/mosquitto/issues
160
162 mosquitto(8), mosquitto.conf(5), mqtt(7)
163
165 Roger Light <roger@atchoo.org>
166
167
168
169Mosquitto Project 04/03/2021 MOSQUITTO_PASSWD(1)