[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fcd1bc8a01f5 rabbitmq:3.12-management "docker-entrypoint.s…"2 hours ago Up 2 hours 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, :::5672->5672/tcp, 15671/tcp, 15691-15692/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp, :::15672->15672/tcp rabbitmq
[root@localhost ~]# docker exec -it rabbitmq bash
root@fcd1bc8a01f5:/# rabbitmqctl list_users
Listing users...
user tags
guest [administrator]
root@fcd1bc8a01f5:/# rabbitmqctl add_user pzy 123456
Adding user "pzy"...
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
root@fcd1bc8a01f5:/# rabbitmqctl set_permissions -p / pzy ".*" ".*" ".*"
Setting permissions for user "pzy"in vhost "/"...
root@fcd1bc8a01f5:/# rabbitmqctl set_user_tags pzy administrator
Setting tags for user "pzy" to [administrator]...
root@fcd1bc8a01f5:/#