mosquitto_passwd.1.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <?xml-stylesheet type="text/xsl" href="manpage.xsl"?>
  3. <refentry xml:id="mosquitto_passwd" xmlns:xlink="http://www.w3.org/1999/xlink">
  4. <refmeta>
  5. <refentrytitle>mosquitto_passwd</refentrytitle>
  6. <manvolnum>1</manvolnum>
  7. <refmiscinfo class="source">Mosquitto Project</refmiscinfo>
  8. <refmiscinfo class="manual">Commands</refmiscinfo>
  9. </refmeta>
  10. <refnamediv>
  11. <refname>mosquitto_passwd</refname>
  12. <refpurpose>manage password files for mosquitto</refpurpose>
  13. </refnamediv>
  14. <refsynopsisdiv>
  15. <cmdsynopsis>
  16. <command>mosquitto_passwd</command>
  17. <group>
  18. <arg choice='plain'><option>-H</option> <replaceable>hash</replaceable></arg>
  19. </group>
  20. <group>
  21. <arg choice='plain'><option>-c</option></arg>
  22. <arg choice='plain'><option>-D</option></arg>
  23. </group>
  24. <arg choice='plain'><replaceable>passwordfile</replaceable></arg>
  25. <arg choice='plain'><replaceable>username</replaceable></arg>
  26. </cmdsynopsis>
  27. <cmdsynopsis>
  28. <command>mosquitto_passwd</command>
  29. <group>
  30. <arg choice='plain'><option>-H</option> <replaceable>hash</replaceable></arg>
  31. </group>
  32. <arg choice='plain'><option>-b</option></arg>
  33. <arg choice='plain'><replaceable>passwordfile</replaceable></arg>
  34. <arg choice='plain'><replaceable>username</replaceable></arg>
  35. <arg choice='plain'><replaceable>password</replaceable></arg>
  36. </cmdsynopsis>
  37. <cmdsynopsis>
  38. <command>mosquitto_passwd</command>
  39. <arg choice='plain'><option>-U</option></arg>
  40. <arg choice='plain'><replaceable>passwordfile</replaceable></arg>
  41. </cmdsynopsis>
  42. </refsynopsisdiv>
  43. <refsect1>
  44. <title>Description</title>
  45. <para><command>mosquitto_passwd</command> is a tool for managing
  46. password files for the mosquitto MQTT broker.</para>
  47. <para>Usernames must not contain ":". Passwords are stored in a similar
  48. format to
  49. <citerefentry><refentrytitle><link xlink:href="https://linux.die.net/man/3/crypt">crypt</link></refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
  50. </refsect1>
  51. <refsect1>
  52. <title>Options</title>
  53. <variablelist>
  54. <varlistentry>
  55. <term><option>-b</option></term>
  56. <listitem>
  57. <para>Run in batch mode. This allows the password to be
  58. provided at the command line which can be convenient
  59. but should be used with care because the password will
  60. be visible on the command line and in command
  61. history.</para>
  62. </listitem>
  63. </varlistentry>
  64. <varlistentry>
  65. <term><option>-c</option></term>
  66. <listitem>
  67. <para>Create a new password file. If the file already
  68. exists, it will be overwritten.</para>
  69. </listitem>
  70. </varlistentry>
  71. <varlistentry>
  72. <term><option>-D</option></term>
  73. <listitem>
  74. <para>Delete the specified user from the password
  75. file.</para>
  76. </listitem>
  77. </varlistentry>
  78. <varlistentry>
  79. <term><option>-H</option></term>
  80. <listitem>
  81. <para>Choose the hash to use. Can be one of
  82. <replaceable>sha512-pbkdf2</replaceable> or
  83. <replaceable>sha512</replaceable>. Defaults to
  84. <replaceable>sha512-pbkdf2</replaceable>. The
  85. <replaceable>sha512</replaceable> option is provided for
  86. creating password files for use with Mosquitto 1.6
  87. and earlier.</para>
  88. </listitem>
  89. </varlistentry>
  90. <varlistentry>
  91. <term><option>-U</option></term>
  92. <listitem>
  93. <para>This option can be used to upgrade/convert a password
  94. file with plain text passwords into one using hashed
  95. passwords. It will modify the specified file. It does
  96. not detect whether passwords are already hashed, so
  97. using it on a password file that already contains
  98. hashed passwords will generate new hashes based on the
  99. old hashes and render the password file
  100. unusable.</para>
  101. </listitem>
  102. </varlistentry>
  103. <varlistentry>
  104. <term><option>passwordfile</option></term>
  105. <listitem>
  106. <para>The password file to modify.</para>
  107. </listitem>
  108. </varlistentry>
  109. <varlistentry>
  110. <term><option>username</option></term>
  111. <listitem>
  112. <para>The username to add/update/delete.</para>
  113. </listitem>
  114. </varlistentry>
  115. <varlistentry>
  116. <term><option>password</option></term>
  117. <listitem>
  118. <para>The password to use when in batch mode.</para>
  119. </listitem>
  120. </varlistentry>
  121. </variablelist>
  122. </refsect1>
  123. <refsect1>
  124. <title>Exit Status</title>
  125. <para>
  126. mosquitto_sub returns zero on success, or non-zero on error. If
  127. the connection is refused by the broker at the MQTT level, then
  128. the exit code is the CONNACK reason code. If another error
  129. occurs, the exit code is a libmosquitto return value.
  130. </para>
  131. <para>MQTT v3.1.1 CONNACK codes:</para>
  132. <itemizedlist mark="circle">
  133. <listitem><para><option>0</option> Success</para></listitem>
  134. <listitem><para><option>1</option> Connection refused: Bad protocol version</para></listitem>
  135. <listitem><para><option>2</option> Connection refused: Identifier rejected</para></listitem>
  136. <listitem><para><option>3</option> Connection refused: Server unavailable</para></listitem>
  137. <listitem><para><option>4</option> Connection refused: Bad username/password</para></listitem>
  138. <listitem><para><option>5</option> Connection refused: Not authorized</para></listitem>
  139. </itemizedlist>
  140. <para>MQTT v5 CONNACK codes:</para>
  141. <itemizedlist>
  142. <listitem><para><option>0</option> Success</para></listitem>
  143. <listitem><para><option>128</option> Unspecified error</para></listitem>
  144. <listitem><para><option>129</option> Malformed packet</para></listitem>
  145. <listitem><para><option>130</option> Protocol error</para></listitem>
  146. <listitem><para><option>131</option> Implementation specific error</para></listitem>
  147. <listitem><para><option>132</option> Unsupported protocol version</para></listitem>
  148. <listitem><para><option>133</option> Client ID not valid</para></listitem>
  149. <listitem><para><option>134</option> Bad username or password</para></listitem>
  150. <listitem><para><option>135</option> Not authorized</para></listitem>
  151. <listitem><para><option>136</option> Server unavailable</para></listitem>
  152. <listitem><para><option>137</option> Server busy</para></listitem>
  153. <listitem><para><option>138</option> Banned</para></listitem>
  154. <listitem><para><option>139</option> Server shutting down</para></listitem>
  155. <listitem><para><option>140</option> Bad authentication method</para></listitem>
  156. <listitem><para><option>141</option> Keep alive timeout</para></listitem>
  157. <listitem><para><option>142</option> Session taken over</para></listitem>
  158. <listitem><para><option>143</option> Topic filter invalid</para></listitem>
  159. <listitem><para><option>144</option> Topic name invalid</para></listitem>
  160. <listitem><para><option>147</option> Receive maximum exceeded</para></listitem>
  161. <listitem><para><option>148</option> Topic alias invalid</para></listitem>
  162. <listitem><para><option>149</option> Packet too large</para></listitem>
  163. <listitem><para><option>148</option> Message rate too high</para></listitem>
  164. <listitem><para><option>151</option> Quota exceeded</para></listitem>
  165. <listitem><para><option>152</option> Administrative action</para></listitem>
  166. <listitem><para><option>153</option> Payload format invalid</para></listitem>
  167. <listitem><para><option>154</option> Retain not supported</para></listitem>
  168. <listitem><para><option>155</option> QoS not supported</para></listitem>
  169. <listitem><para><option>156</option> Use another server</para></listitem>
  170. <listitem><para><option>157</option> Server moved</para></listitem>
  171. <listitem><para><option>158</option> Shared subscriptions not supported</para></listitem>
  172. <listitem><para><option>159</option> Connection rate exceeded</para></listitem>
  173. <listitem><para><option>160</option> Maximum connect time</para></listitem>
  174. <listitem><para><option>161</option> Subscription IDs not supported</para></listitem>
  175. <listitem><para><option>162</option> Wildcard subscriptions not supported</para></listitem>
  176. </itemizedlist>
  177. </refsect1>
  178. <refsect1>
  179. <title>Examples</title>
  180. <para>Add a user to a new password file:</para>
  181. <itemizedlist mark="circle">
  182. <listitem><para>mosquitto_passwd <literal>-c</literal> /etc/mosquitto/passwd <literal>ral</literal></para></listitem>
  183. </itemizedlist>
  184. <para>Delete a user from a password file</para>
  185. <itemizedlist mark="circle">
  186. <listitem><para>mosquitto_passwd <literal>-D</literal> /etc/mosquitto/passwd <literal>ral</literal></para></listitem>
  187. </itemizedlist>
  188. </refsect1>
  189. <refsect1>
  190. <title>Bugs</title>
  191. <para><command>mosquitto</command> bug information can be found at
  192. <ulink url="https://github.com/eclipse/mosquitto/issues"/></para>
  193. </refsect1>
  194. <refsect1>
  195. <title>See Also</title>
  196. <simplelist type="inline">
  197. <member>
  198. <citerefentry>
  199. <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle>
  200. <manvolnum>8</manvolnum>
  201. </citerefentry>
  202. </member>
  203. <member>
  204. <citerefentry>
  205. <refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle>
  206. <manvolnum>5</manvolnum>
  207. </citerefentry>
  208. </member>
  209. <member>
  210. <citerefentry>
  211. <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle>
  212. <manvolnum>7</manvolnum>
  213. </citerefentry>
  214. </member>
  215. </simplelist>
  216. </refsect1>
  217. <refsect1>
  218. <title>Author</title>
  219. <para>Roger Light <email>roger@atchoo.org</email></para>
  220. </refsect1>
  221. </refentry>