按照说明把操作写下来,下面的内容操作没有通过,请读者自行试验 !
1、在mosquitto.cong中间中加入
#加入访问控制列表文件Acls
acl_file /MosquittoTest/aclfile.example
2、修改aclfile.example内容,加入用户的权限
# This affects access control for clients with no username. topic read $SYS/# # This only affects clients with username "roger". #user roger #topic foo/bar user dissun topic dissun/topic # This affects all clients. pattern write $SYS/broker/connection/%c/state
3、CMD启动mosquitto。