本文共 661 字,大约阅读时间需要 2 分钟。
环境说明:
1.linux系统下,centos 7环境
2.使用docker运行emqtt服务器,参照:
3.进入docker方式,参照:
关闭匿名认证
etc/emqx.conf 配置启用匿名认证:
## Allow anonymous authentication by default if no auth plugins loaded.## Notice: Disable the option in production deployment!#### Value: true | false
allow_anonymous = false # 生产环境关闭匿名认证
默认访问控制设置
EMQ X 消息服务器默认访问控制,在 etc/emqx.conf 中设置:
## Allow or deny if no ACL rules matched.#### Value: allow | deny
acl_nomatch = allow
## Default ACL File.#### Value: File Name
acl_file = etc/acl.conf
例:
描述:只提供给ehz001 发布和订阅/_IOT/开头的topic的权限,
其他的用户不能订阅和发布任何主题
修改配置文件后,重启docker,使之生效
如有描述不明或者相关技术问题,欢迎给博主留言
转载地址:http://qwagi.baihongyu.com/