博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
EMQTT的ACL鉴权(topic权限控制)
阅读量:4287 次
发布时间:2019-05-27

本文共 661 字,大约阅读时间需要 2 分钟。

摘要:emqtt docker生产环境下,需要对特定的用户开发指定的主题订阅和发布权限,这时通过配置ACL的方式可以实现该场景下的功能需求

环境说明:

       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/

你可能感兴趣的文章
python正则表达式模块re
查看>>
python爬虫总结
查看>>
python网络编程基础--http
查看>>
python 构造http请求对象-Request对象
查看>>
解决Ubuntu16.04更新源时显示“暂时不能解析域名”问题
查看>>
Ubuntu16.04运行清空文件命令时提示权限不够解决方法
查看>>
shell脚本编写笔记
查看>>
rpm、dpkg、yum、apt比较
查看>>
expect详解
查看>>
Ubuntu16.04实现定时免密远程拷贝脚本
查看>>
Ubuntu 16.04安装Docker
查看>>
Docker报错:Temporary failure in name resolution&Proxy Authentication Required
查看>>
mySQL常用操作及基础知识
查看>>
Ubuntu16.04安装python3.6
查看>>
linux安装Anaconda
查看>>
Ubunu16.04安装CPU版本Tensorflow
查看>>
conda常用命令和基础知识整理
查看>>
ImportError: libgfortran.so.4: cannot open shared object file: No such file or directory
查看>>
Django搭建网站笔记
查看>>
Pandas常用操作总结
查看>>