設(shè)置用戶(hù)為超級(jí)管理員:
rabbitmqctl set_user_tags senge administrator
設(shè)置權(quán)限:
rabbitmqctl set_permissions -p / 863343061631859 ".*" ".*" ".*"
# 創(chuàng)建新用戶(hù)
rabbitmqctl add_user <username> <password>
# 設(shè)置用戶(hù)權(quán)限
rabbitmqctl set_user_tags <username> <tag>
# 設(shè)置用戶(hù)權(quán)限為管理員
rabbitmqctl set_user_tags <username> administrator
# 設(shè)置用戶(hù)權(quán)限為監(jiān)控者
rabbitmqctl set_user_tags <username> monitoring
# 設(shè)置用戶(hù)權(quán)限為策略制定者
rabbitmqctl set_user_tags <username> policymaker
# 列出所有用戶(hù)
rabbitmqctl list_users
# 設(shè)置用戶(hù)權(quán)限允許MQTT訪(fǎng)問(wèn)
rabbitmqctl set_user_tags username mqtt
# 如果需要設(shè)置虛擬主機(jī)權(quán)限
rabbitmqctl set_permissions -p / virtualhost username ".*" ".*" ".*"