使用的是3.2.6版本
1.首先/usr/local/emqtt/emqx/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
2.在后台页面,启动emqx_auth_username这个插件
3.搜了好多资料,都是在/usr/local/emqtt/emqx/etc/plugins/emqx_auth_username.conf中添加用户名和密码,最终结果都是emqx启动失败。。。3.1版本之后,应该使用下面的命令进行添加
./bin/emqx_ctl users add admin admin111
会返回OK