给用户打标
set_user_tags 可以将用户设定为管理员
代码语言:javascript复制[root@h101 ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
test []
[root@h101 ~]# rabbitmqctl set_user_tags test administrator
Setting tags for user "test" to [administrator] ...
[root@h101 ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
test [administrator]
[root@h101 ~]#
回收标记
代码语言:javascript复制[root@h101 ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
test [administrator]
[root@h101 ~]# rabbitmqctl set_user_tags test
Setting tags for user "test" to [] ...
[root@h101 ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
test []
[root@h101 ~]#
代码语言:javascript复制Note: 可以一次设定多个标记,此命令只会以最新一次的设定为准,之前的设置会被覆盖,所以要作好记录,以便恢复
[root@h101 ~]# rabbitmqctl set_user_tags test ui,ii,uiui
Setting tags for user "test" to ['ui,ii,uiui'] ...
[root@h101 ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
test [ui,ii,uiui]
[root@h101 ~]#
删除用户
代码语言:javascript复制[root@h101 ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
test []
[root@h101 ~]# rabbitmqctl delete_user test
Deleting user "test" ...
[root@h101 ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
[root@h101 ~]#