需要修改的三个文件 etcemqx.conf etcpluginsemqx_auth_mnesia.conf etcacl.conf
1.首先进入emqx.conf找到allow_anonymous改为false allow_anonymous = false
2.去后台开启emqx_auth_mnesia插件,然后进入emqx_auth_mnesia.conf添加下面的信息
应用的账号密码
auth.client.1.clientid = admin auth.client.1.password = your_own_password
后台登录账号密码
auth.user.1.username = admin auth.user.1.password = your_own_password
3.进入acl.conf添加下面信息 {allow, {user, "admin"}, subscribe, ["$SYS/#"]}.
4.重启emqx emqx restart