Emq restrict anonymous user access, open user password authentication

problem:

Just build emq service is enabled by default anonymous user access, so the environment is very unsafe, just know ip address can be connected, it is strongly recommended to enable user authentication, password!

Resolution process

1. Modify the configuration file

vim /etc/emqx/emqx.conf
modified to true to false
allow_anonymous to false =

Emq restrict anonymous user access, open user password authentication

2. Restart Service

systemctl stop emqx
systemctl start emqx

3. Import plug-in module

cd /usr/lib/emqx/bin
sh emqx_ctl plugins load emqx_auth_username

Emq restrict anonymous user access, open user password authentication

4. Set the account password

emqx_ctl users add admin public

Emq restrict anonymous user access, open user password authentication

Reference Documents

The official document:
https://docs.emqx.io/broker/v3/cn/commands.html#status

Guess you like

Origin blog.51cto.com/13760351/2466367