mosquitto_passwd.1 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. '\" t
  2. .\" Title: mosquitto_passwd
  3. .\" Author: [see the "Author" section]
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 10/27/2021
  6. .\" Manual: Commands
  7. .\" Source: Mosquitto Project
  8. .\" Language: English
  9. .\"
  10. .TH "MOSQUITTO_PASSWD" "1" "10/27/2021" "Mosquitto Project" "Commands"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. mosquitto_passwd \- manage password files for mosquitto
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBmosquitto_passwd\fR\ 'u
  34. \fBmosquitto_passwd\fR [\fB\-H\fR\ \fIhash\fR] [\fB\-c\fR | \fB\-D\fR] \fIpasswordfile\fR \fIusername\fR
  35. .HP \w'\fBmosquitto_passwd\fR\ 'u
  36. \fBmosquitto_passwd\fR [\fB\-H\fR\ \fIhash\fR] \fB\-b\fR \fIpasswordfile\fR \fIusername\fR \fIpassword\fR
  37. .HP \w'\fBmosquitto_passwd\fR\ 'u
  38. \fBmosquitto_passwd\fR \fB\-U\fR \fIpasswordfile\fR
  39. .SH "DESCRIPTION"
  40. .PP
  41. \fBmosquitto_passwd\fR
  42. is a tool for managing password files for the mosquitto MQTT broker\&.
  43. .PP
  44. Usernames must not contain ":"\&. Passwords are stored in a similar format to
  45. \fBcrypt\fR(3)\&.
  46. .SH "OPTIONS"
  47. .PP
  48. \fB\-b\fR
  49. .RS 4
  50. 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\&.
  51. .RE
  52. .PP
  53. \fB\-c\fR
  54. .RS 4
  55. Create a new password file\&. If the file already exists, it will be overwritten\&.
  56. .RE
  57. .PP
  58. \fB\-D\fR
  59. .RS 4
  60. Delete the specified user from the password file\&.
  61. .RE
  62. .PP
  63. \fB\-H\fR
  64. .RS 4
  65. Choose the hash to use\&. Can be one of
  66. \fIsha512\-pbkdf2\fR
  67. or
  68. \fIsha512\fR\&. Defaults to
  69. \fIsha512\-pbkdf2\fR\&. The
  70. \fIsha512\fR
  71. option is provided for creating password files for use with Mosquitto 1\&.6 and earlier\&.
  72. .RE
  73. .PP
  74. \fB\-U\fR
  75. .RS 4
  76. 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\&.
  77. .RE
  78. .PP
  79. \fBpasswordfile\fR
  80. .RS 4
  81. The password file to modify\&.
  82. .RE
  83. .PP
  84. \fBusername\fR
  85. .RS 4
  86. The username to add/update/delete\&.
  87. .RE
  88. .PP
  89. \fBpassword\fR
  90. .RS 4
  91. The password to use when in batch mode\&.
  92. .RE
  93. .SH "EXIT STATUS"
  94. .PP
  95. mosquitto_sub returns zero on success, or non\-zero on error\&. If the connection is refused by the broker at the MQTT level, then the exit code is the CONNACK reason code\&. If another error occurs, the exit code is a libmosquitto return value\&.
  96. .PP
  97. MQTT v3\&.1\&.1 CONNACK codes:
  98. .sp
  99. .RS 4
  100. .ie n \{\
  101. \h'-04'\(bu\h'+03'\c
  102. .\}
  103. .el \{\
  104. .sp -1
  105. .IP \(bu 2.3
  106. .\}
  107. \fB0\fR
  108. Success
  109. .RE
  110. .sp
  111. .RS 4
  112. .ie n \{\
  113. \h'-04'\(bu\h'+03'\c
  114. .\}
  115. .el \{\
  116. .sp -1
  117. .IP \(bu 2.3
  118. .\}
  119. \fB1\fR
  120. Connection refused: Bad protocol version
  121. .RE
  122. .sp
  123. .RS 4
  124. .ie n \{\
  125. \h'-04'\(bu\h'+03'\c
  126. .\}
  127. .el \{\
  128. .sp -1
  129. .IP \(bu 2.3
  130. .\}
  131. \fB2\fR
  132. Connection refused: Identifier rejected
  133. .RE
  134. .sp
  135. .RS 4
  136. .ie n \{\
  137. \h'-04'\(bu\h'+03'\c
  138. .\}
  139. .el \{\
  140. .sp -1
  141. .IP \(bu 2.3
  142. .\}
  143. \fB3\fR
  144. Connection refused: Server unavailable
  145. .RE
  146. .sp
  147. .RS 4
  148. .ie n \{\
  149. \h'-04'\(bu\h'+03'\c
  150. .\}
  151. .el \{\
  152. .sp -1
  153. .IP \(bu 2.3
  154. .\}
  155. \fB4\fR
  156. Connection refused: Bad username/password
  157. .RE
  158. .sp
  159. .RS 4
  160. .ie n \{\
  161. \h'-04'\(bu\h'+03'\c
  162. .\}
  163. .el \{\
  164. .sp -1
  165. .IP \(bu 2.3
  166. .\}
  167. \fB5\fR
  168. Connection refused: Not authorized
  169. .RE
  170. .PP
  171. MQTT v5 CONNACK codes:
  172. .sp
  173. .RS 4
  174. .ie n \{\
  175. \h'-04'\(bu\h'+03'\c
  176. .\}
  177. .el \{\
  178. .sp -1
  179. .IP \(bu 2.3
  180. .\}
  181. \fB0\fR
  182. Success
  183. .RE
  184. .sp
  185. .RS 4
  186. .ie n \{\
  187. \h'-04'\(bu\h'+03'\c
  188. .\}
  189. .el \{\
  190. .sp -1
  191. .IP \(bu 2.3
  192. .\}
  193. \fB128\fR
  194. Unspecified error
  195. .RE
  196. .sp
  197. .RS 4
  198. .ie n \{\
  199. \h'-04'\(bu\h'+03'\c
  200. .\}
  201. .el \{\
  202. .sp -1
  203. .IP \(bu 2.3
  204. .\}
  205. \fB129\fR
  206. Malformed packet
  207. .RE
  208. .sp
  209. .RS 4
  210. .ie n \{\
  211. \h'-04'\(bu\h'+03'\c
  212. .\}
  213. .el \{\
  214. .sp -1
  215. .IP \(bu 2.3
  216. .\}
  217. \fB130\fR
  218. Protocol error
  219. .RE
  220. .sp
  221. .RS 4
  222. .ie n \{\
  223. \h'-04'\(bu\h'+03'\c
  224. .\}
  225. .el \{\
  226. .sp -1
  227. .IP \(bu 2.3
  228. .\}
  229. \fB131\fR
  230. Implementation specific error
  231. .RE
  232. .sp
  233. .RS 4
  234. .ie n \{\
  235. \h'-04'\(bu\h'+03'\c
  236. .\}
  237. .el \{\
  238. .sp -1
  239. .IP \(bu 2.3
  240. .\}
  241. \fB132\fR
  242. Unsupported protocol version
  243. .RE
  244. .sp
  245. .RS 4
  246. .ie n \{\
  247. \h'-04'\(bu\h'+03'\c
  248. .\}
  249. .el \{\
  250. .sp -1
  251. .IP \(bu 2.3
  252. .\}
  253. \fB133\fR
  254. Client ID not valid
  255. .RE
  256. .sp
  257. .RS 4
  258. .ie n \{\
  259. \h'-04'\(bu\h'+03'\c
  260. .\}
  261. .el \{\
  262. .sp -1
  263. .IP \(bu 2.3
  264. .\}
  265. \fB134\fR
  266. Bad username or password
  267. .RE
  268. .sp
  269. .RS 4
  270. .ie n \{\
  271. \h'-04'\(bu\h'+03'\c
  272. .\}
  273. .el \{\
  274. .sp -1
  275. .IP \(bu 2.3
  276. .\}
  277. \fB135\fR
  278. Not authorized
  279. .RE
  280. .sp
  281. .RS 4
  282. .ie n \{\
  283. \h'-04'\(bu\h'+03'\c
  284. .\}
  285. .el \{\
  286. .sp -1
  287. .IP \(bu 2.3
  288. .\}
  289. \fB136\fR
  290. Server unavailable
  291. .RE
  292. .sp
  293. .RS 4
  294. .ie n \{\
  295. \h'-04'\(bu\h'+03'\c
  296. .\}
  297. .el \{\
  298. .sp -1
  299. .IP \(bu 2.3
  300. .\}
  301. \fB137\fR
  302. Server busy
  303. .RE
  304. .sp
  305. .RS 4
  306. .ie n \{\
  307. \h'-04'\(bu\h'+03'\c
  308. .\}
  309. .el \{\
  310. .sp -1
  311. .IP \(bu 2.3
  312. .\}
  313. \fB138\fR
  314. Banned
  315. .RE
  316. .sp
  317. .RS 4
  318. .ie n \{\
  319. \h'-04'\(bu\h'+03'\c
  320. .\}
  321. .el \{\
  322. .sp -1
  323. .IP \(bu 2.3
  324. .\}
  325. \fB139\fR
  326. Server shutting down
  327. .RE
  328. .sp
  329. .RS 4
  330. .ie n \{\
  331. \h'-04'\(bu\h'+03'\c
  332. .\}
  333. .el \{\
  334. .sp -1
  335. .IP \(bu 2.3
  336. .\}
  337. \fB140\fR
  338. Bad authentication method
  339. .RE
  340. .sp
  341. .RS 4
  342. .ie n \{\
  343. \h'-04'\(bu\h'+03'\c
  344. .\}
  345. .el \{\
  346. .sp -1
  347. .IP \(bu 2.3
  348. .\}
  349. \fB141\fR
  350. Keep alive timeout
  351. .RE
  352. .sp
  353. .RS 4
  354. .ie n \{\
  355. \h'-04'\(bu\h'+03'\c
  356. .\}
  357. .el \{\
  358. .sp -1
  359. .IP \(bu 2.3
  360. .\}
  361. \fB142\fR
  362. Session taken over
  363. .RE
  364. .sp
  365. .RS 4
  366. .ie n \{\
  367. \h'-04'\(bu\h'+03'\c
  368. .\}
  369. .el \{\
  370. .sp -1
  371. .IP \(bu 2.3
  372. .\}
  373. \fB143\fR
  374. Topic filter invalid
  375. .RE
  376. .sp
  377. .RS 4
  378. .ie n \{\
  379. \h'-04'\(bu\h'+03'\c
  380. .\}
  381. .el \{\
  382. .sp -1
  383. .IP \(bu 2.3
  384. .\}
  385. \fB144\fR
  386. Topic name invalid
  387. .RE
  388. .sp
  389. .RS 4
  390. .ie n \{\
  391. \h'-04'\(bu\h'+03'\c
  392. .\}
  393. .el \{\
  394. .sp -1
  395. .IP \(bu 2.3
  396. .\}
  397. \fB147\fR
  398. Receive maximum exceeded
  399. .RE
  400. .sp
  401. .RS 4
  402. .ie n \{\
  403. \h'-04'\(bu\h'+03'\c
  404. .\}
  405. .el \{\
  406. .sp -1
  407. .IP \(bu 2.3
  408. .\}
  409. \fB148\fR
  410. Topic alias invalid
  411. .RE
  412. .sp
  413. .RS 4
  414. .ie n \{\
  415. \h'-04'\(bu\h'+03'\c
  416. .\}
  417. .el \{\
  418. .sp -1
  419. .IP \(bu 2.3
  420. .\}
  421. \fB149\fR
  422. Packet too large
  423. .RE
  424. .sp
  425. .RS 4
  426. .ie n \{\
  427. \h'-04'\(bu\h'+03'\c
  428. .\}
  429. .el \{\
  430. .sp -1
  431. .IP \(bu 2.3
  432. .\}
  433. \fB148\fR
  434. Message rate too high
  435. .RE
  436. .sp
  437. .RS 4
  438. .ie n \{\
  439. \h'-04'\(bu\h'+03'\c
  440. .\}
  441. .el \{\
  442. .sp -1
  443. .IP \(bu 2.3
  444. .\}
  445. \fB151\fR
  446. Quota exceeded
  447. .RE
  448. .sp
  449. .RS 4
  450. .ie n \{\
  451. \h'-04'\(bu\h'+03'\c
  452. .\}
  453. .el \{\
  454. .sp -1
  455. .IP \(bu 2.3
  456. .\}
  457. \fB152\fR
  458. Administrative action
  459. .RE
  460. .sp
  461. .RS 4
  462. .ie n \{\
  463. \h'-04'\(bu\h'+03'\c
  464. .\}
  465. .el \{\
  466. .sp -1
  467. .IP \(bu 2.3
  468. .\}
  469. \fB153\fR
  470. Payload format invalid
  471. .RE
  472. .sp
  473. .RS 4
  474. .ie n \{\
  475. \h'-04'\(bu\h'+03'\c
  476. .\}
  477. .el \{\
  478. .sp -1
  479. .IP \(bu 2.3
  480. .\}
  481. \fB154\fR
  482. Retain not supported
  483. .RE
  484. .sp
  485. .RS 4
  486. .ie n \{\
  487. \h'-04'\(bu\h'+03'\c
  488. .\}
  489. .el \{\
  490. .sp -1
  491. .IP \(bu 2.3
  492. .\}
  493. \fB155\fR
  494. QoS not supported
  495. .RE
  496. .sp
  497. .RS 4
  498. .ie n \{\
  499. \h'-04'\(bu\h'+03'\c
  500. .\}
  501. .el \{\
  502. .sp -1
  503. .IP \(bu 2.3
  504. .\}
  505. \fB156\fR
  506. Use another server
  507. .RE
  508. .sp
  509. .RS 4
  510. .ie n \{\
  511. \h'-04'\(bu\h'+03'\c
  512. .\}
  513. .el \{\
  514. .sp -1
  515. .IP \(bu 2.3
  516. .\}
  517. \fB157\fR
  518. Server moved
  519. .RE
  520. .sp
  521. .RS 4
  522. .ie n \{\
  523. \h'-04'\(bu\h'+03'\c
  524. .\}
  525. .el \{\
  526. .sp -1
  527. .IP \(bu 2.3
  528. .\}
  529. \fB158\fR
  530. Shared subscriptions not supported
  531. .RE
  532. .sp
  533. .RS 4
  534. .ie n \{\
  535. \h'-04'\(bu\h'+03'\c
  536. .\}
  537. .el \{\
  538. .sp -1
  539. .IP \(bu 2.3
  540. .\}
  541. \fB159\fR
  542. Connection rate exceeded
  543. .RE
  544. .sp
  545. .RS 4
  546. .ie n \{\
  547. \h'-04'\(bu\h'+03'\c
  548. .\}
  549. .el \{\
  550. .sp -1
  551. .IP \(bu 2.3
  552. .\}
  553. \fB160\fR
  554. Maximum connect time
  555. .RE
  556. .sp
  557. .RS 4
  558. .ie n \{\
  559. \h'-04'\(bu\h'+03'\c
  560. .\}
  561. .el \{\
  562. .sp -1
  563. .IP \(bu 2.3
  564. .\}
  565. \fB161\fR
  566. Subscription IDs not supported
  567. .RE
  568. .sp
  569. .RS 4
  570. .ie n \{\
  571. \h'-04'\(bu\h'+03'\c
  572. .\}
  573. .el \{\
  574. .sp -1
  575. .IP \(bu 2.3
  576. .\}
  577. \fB162\fR
  578. Wildcard subscriptions not supported
  579. .RE
  580. .SH "EXAMPLES"
  581. .PP
  582. Add a user to a new password file:
  583. .sp
  584. .RS 4
  585. .ie n \{\
  586. \h'-04'\(bu\h'+03'\c
  587. .\}
  588. .el \{\
  589. .sp -1
  590. .IP \(bu 2.3
  591. .\}
  592. mosquitto_passwd
  593. \-c
  594. /etc/mosquitto/passwd
  595. ral
  596. .RE
  597. .PP
  598. Delete a user from a password file
  599. .sp
  600. .RS 4
  601. .ie n \{\
  602. \h'-04'\(bu\h'+03'\c
  603. .\}
  604. .el \{\
  605. .sp -1
  606. .IP \(bu 2.3
  607. .\}
  608. mosquitto_passwd
  609. \-D
  610. /etc/mosquitto/passwd
  611. ral
  612. .RE
  613. .SH "BUGS"
  614. .PP
  615. \fBmosquitto\fR
  616. bug information can be found at
  617. \m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[]
  618. .SH "SEE ALSO"
  619. \fBmosquitto\fR(8), \fBmosquitto.conf\fR(5), \fBmqtt\fR(7)
  620. .SH "AUTHOR"
  621. .PP
  622. Roger Light
  623. <roger@atchoo\&.org>