MQTT之mosquitto_passwd命令使用
来源:互联网 发布:适合程序员看的电影 编辑:程序博客网 时间:2024/05/29 18:30
可以使用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/passwdral
Delete a user from a password file
mosquitto_passwd
-D
/etc/mosquitto/passwdral
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命令使用
- MQTT的学习研究(二)moquette-mqtt 的使用之mqtt broker的启动
- MQTT的学习研究(三)moquette-mqtt 的使用之mqtt服务发布主题信息
- MQTT的学习研究(2)moquette-mqtt 的使用之mqtt broker的启动
- MQTT的学习研究(3)moquette-mqtt 的使用之mqtt服务发布主题信息
- MQTT协议之Mosquitto安装和使用
- MQTT协议之moquette 安装使用
- MQTT协议之Apache Apollo 安装使用
- MQTT协议之Apache Apollo 安装使用
- MQTT协议之moquette 安装使用
- MQTT 使用
- MQTT协议之使用Future模式订阅及发布(使用fusesource mqtt-client实现)
- MQTT协议之使用Future模式订阅及发布(使用fusesource mqtt-client实现)
- MQTT的学习研究(四)moquette-mqtt 的使用之mqtt Blocking API客户端订阅并接收主题信息
- MQTT的学习研究(4)moquette-mqtt 的使用之mqtt Blocking API客户端订阅并接收主题信息
- MQTT协议之订阅及发布(使用paho-mqtt-client或mqttv3实现)
- MQTT协议之订阅及发布(使用paho-mqtt-client或mqttv3实现)
- MQTT的学习之Mosquitto简要教程(安装&使用)
- 中国数据科学家年薪有多少?
- python爬虫实战(2)——爬取腾讯新闻
- HDU4429
- why静态变量只能被初始化一次?
- java原子变量的理解
- MQTT之mosquitto_passwd命令使用
- Geometric.Glovius.Pro.v4.4.0.454.Win32_64 2CD
- 在linux上安装redis(一)
- 如何在线编辑修改PDF文件中的背景颜色
- dom4j 为生成 XML 的文件添加 xmlns(命名空间) 属性
- 如何实现同一份报表,不同人看不同数据
- const与volatile
- IOS 代理的使用
- 项目配置在tomcat下访问不到