mosquitto security policy

    mosquitto service configuration security policy

    Modify the mosquitto.conf file

    allow_anonymous=false //No anonymous allowed

    password_file /home/chc/mqtt/mosquitto-1.4.8/pwfile //username and password file

    acl_file /home/chc/mqtt/mosquitto-1.4.8/acl //Permission file

    Then execute the command to generate the user file mosquitto_password -c /home/chc/mqtt/mosquitto-1.4.8/pwfile username  

    Make a copy of the aclfile.example file cp aclfile.example acl

    Edit the acl file to add users

    user username //user

    topic # //Allow topic # is to allow all topics

    

    user username2

    topic write news/# //Allow username2 to publish new/XXX topics

 

    user username3

    topic read news/# //Allow username3 to read new/XXX topics

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326454763&siteId=291194637