日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > c/c++ >内容正文

c/c++

MQTT之mosquitto_passwd命令使用

發布時間:2025/3/21 c/c++ 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MQTT之mosquitto_passwd命令使用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

可以使用mosquitto自帶的mosquitto_passwd命令生成密碼文件。

????? mosquitto_passwd -c [最終生成的password_file文件]? [用戶名] 。

??????#:?mosquitto_passwd -c?passwd.conf? jinhe_sub?

????? 輸入命令后,控制臺會提示輸入新建用戶的密碼,連續輸入兩次密碼后,則會生成一個passwd.conf文件。

???? 注意,mosquitto_passwd -c命令每次都只會生成只包含一個用戶的文件,如果你想在passwd.conf中存放多個用戶, 可以使用mosquitto_passwd -b 命令。

????mosquitto_passwd -b [最終生成的password_file文件]? [用戶名]? [密碼]。

????mosquitto_passwd -b命令必須在控制臺輸入明文的密碼,且每次只是在passwd.conf中新增一個用戶,不會覆蓋之前已生成的用戶。

?? 同時也可以使用mosquitto_passwd -D命令刪除一個用戶。


更具體如下:

Name

mosquitto_passwd — manage password files for mosquitto

Synopsis

mosquitto_passwd?[?-c?|?-D?]?passwordfile?username

mosquitto_passwd?-b?passwordfile?username?password

mosquitto_passwd?-U?passwordfile

Description

mosquitto_passwd?is a tool for managing password files the mosquitto MQTT broker.

Usernames must not contain ":". Passwords are stored in a similar format to?crypt(3).

Options

-b

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.

-c

Create a new password file. If the file already exists, it will be overwritten.

-D

Delete the specified user from the password file.

-U

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.

passwordfile

The password file to modify.

username

The username to add/update/delete.

password

The password to use when in batch mode.

Examples

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

Bugs

mosquitto?bug information can be found at?https://github.com/eclipse/mosquitto/issues

See Also

mosquitto(8)?,?mosquitto.conf(5)?,?mqtt(7)

Author

Roger Light?<roger@atchoo.org>


總結

以上是生活随笔為你收集整理的MQTT之mosquitto_passwd命令使用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。