emq知识点

1  配置用户名

默认是可以匿名登录(与mosquitto相同)

## Allow Anonymous authentication
mqtt.allow_anonymous = true

etc/plugins/emq_auth_username.conf 中配置默认用户:

auth.user.$N.username = admin
auth.user.$N.password = public


启用 emq_auth_username 插件:
./bin/emqttd_ctl plugins load emq_auth_username

使用 ./bin/emqttd_ctl users 命令添加用户:
$ ./bin/emqttd_ctl users add <Username> <Password>
如何停用  emq_auth_username插件??可以尝试18083页面上看看,单纯的修改配置
mqtt.allow_anonymous = ture不行,还是需要账号密码登录
2 SSL登录验证

生成的证书测试结果
1 修改配置文件 emq.conf
证书路径



使用证书的cn做为username

客户端连接    8883端口

2  开启数据库插件

前提是有数据库存在



原文地址:https://www.cnblogs.com/myfrank/p/8394515.html