Use rabbitmqctl add_user <username> <password> to create a new user.
Click to reveal answer
beginner
How do you set permissions for a user in RabbitMQ?
Use rabbitmqctl set_permissions -p <vhost> <username> <conf> <write> <read> to set permissions for a user on a virtual host.
Click to reveal answer
beginner
What are the three types of permissions you can set for a RabbitMQ user?
The three permissions are: 1. Configure (conf) - controls what resources the user can declare. 2. Write - controls what resources the user can publish to. 3. Read - controls what resources the user can consume from.
Click to reveal answer
beginner
How do you delete a user in RabbitMQ?
Use rabbitmqctl delete_user <username> to remove a user.
Click to reveal answer
beginner
What is a virtual host (vhost) in RabbitMQ and why is it important for permissions?
A virtual host is like a separate workspace or namespace in RabbitMQ. Permissions are set per user per vhost to control access to resources within that workspace.
Click to reveal answer
Which command sets permissions for a user in RabbitMQ?
Arabbitmqctl delete_user
Brabbitmqctl add_user
Crabbitmqctl set_permissions
Drabbitmqctl list_users
✗ Incorrect
The set_permissions command is used to assign permissions to a user on a specific virtual host.
What does the 'read' permission allow a RabbitMQ user to do?
ADeclare resources
BPublish messages
CDelete users
DConsume messages
✗ Incorrect
The 'read' permission allows a user to consume messages from queues.
How do you remove a user from RabbitMQ?
Arabbitmqctl delete_user
Brabbitmqctl remove_user
Crabbitmqctl revoke_user
Drabbitmqctl clear_user
✗ Incorrect
The correct command to delete a user is rabbitmqctl delete_user <username>.
What is the purpose of a virtual host (vhost) in RabbitMQ?
ATo store messages permanently
BTo separate different environments or projects
CTo create users
DTo monitor server health
✗ Incorrect
A virtual host separates different environments or projects, allowing isolated resource management and permissions.
Which permission controls what resources a user can declare in RabbitMQ?
AConfigure
BRead
CWrite
DAdmin
✗ Incorrect
The 'configure' permission controls what resources a user can declare or create.
Explain how to create a user and assign permissions in RabbitMQ.
Think about the two main commands for user management and permissions.
You got /5 concepts.
Describe the role of virtual hosts in RabbitMQ user permission management.
Consider why you might want to separate access for different teams or apps.
You got /4 concepts.
Practice
(1/5)
1. What is the primary purpose of RabbitMQ user management?
easy
A. To monitor message queue performance
B. To configure network settings for RabbitMQ
C. To control who can access RabbitMQ and what they can do
D. To backup RabbitMQ data automatically
Solution
Step 1: Understand user management role
User management in RabbitMQ controls access by defining users who can connect.
Step 2: Understand permission role
Permissions define what actions users can perform on queues and exchanges.
Final Answer:
To control who can access RabbitMQ and what they can do -> Option C
Quick Check:
User management = Access control [OK]
Hint: User management = who can do what in RabbitMQ [OK]
Common Mistakes:
Confusing user management with monitoring
Thinking permissions configure network
Assuming user management handles backups
2. Which command correctly adds a new user named alice with password secret123 in RabbitMQ?
easy
A. rabbitmqctl new_user alice secret123
B. rabbitmqctl add_user alice secret123
C. rabbitmqctl user_add alice secret123
D. rabbitmqctl create_user alice secret123
Solution
Step 1: Recall RabbitMQ user creation syntax
The correct command to add a user is rabbitmqctl add_user username password.
Step 2: Match command with options
Only rabbitmqctl add_user alice secret123 matches the correct syntax exactly.
Final Answer:
rabbitmqctl add_user alice secret123 -> Option B
Quick Check:
add_user command adds user [OK]
Hint: Use add_user to create users, not create_user [OK]
Common Mistakes:
Using create_user instead of add_user
Swapping username and password order
Using commands that don't exist
3. What will be the output of the following command if user bob has permissions to configure and write to all queues but no read permission?
rabbitmqctl list_user_permissions bob
medium
A. Config: .* Write: .* Read: ""
B. Config: "" Write: "" Read: ""
C. Config: .* Write: .* Read: .*
D. Config: .* Write: "" Read: .*
Solution
Step 1: Understand permission patterns
Permissions use regex patterns: .* means all, "" means none.
Step 2: Match permissions to output
Bob has configure and write permissions to all queues, so those are .*. No read permission means empty string "".
Final Answer:
Config: .* Write: .* Read: "" -> Option A
Quick Check:
Permissions regex = C [OK]
Hint: Empty quotes mean no permission, .* means full permission [OK]
Common Mistakes:
Assuming missing permission shows as .*
Confusing read and write permissions
Misreading empty string as no permission
4. You run rabbitmqctl set_permissions -p / myuser ".*" ".*" ".*" but get an error saying user myuser does not exist. What is the most likely fix?
medium
A. Restart RabbitMQ server before setting permissions
B. Change the virtual host name from / to default
C. Remove the -p option from the command
D. Create the user first using rabbitmqctl add_user myuser password
Solution
Step 1: Understand error cause
Setting permissions requires the user to exist first; error means user missing.
Step 2: Fix by creating user
Use rabbitmqctl add_user myuser password to create the user before setting permissions.
Final Answer:
Create the user first using rabbitmqctl add_user myuser password -> Option D
Quick Check:
User must exist before permissions [OK]
Hint: Add user before setting permissions [OK]
Common Mistakes:
Trying to set permissions on non-existent user
Changing virtual host unnecessarily
Restarting server without fixing user
5. You want to create a user carol who can only read from queues in the virtual host vhost1. Which sequence of commands correctly achieves this?
hard
A. rabbitmqctl add_user carol pass123 rabbitmqctl set_permissions -p vhost1 carol "" "" ".*"
B. rabbitmqctl add_user carol pass123 rabbitmqctl set_permissions -p vhost1 carol ".*" ".*" ".*"
C. rabbitmqctl add_user carol pass123 rabbitmqctl set_permissions -p vhost1 carol ".*" "" ""
D. rabbitmqctl add_user carol pass123 rabbitmqctl set_permissions -p vhost1 carol "" ".*" ""
Solution
Step 1: Create user carol
Use rabbitmqctl add_user carol pass123 to add the user.
Step 2: Set read-only permissions
Set configure and write permissions to empty string "", and read permission to ".*" for all queues in vhost1.
Final Answer:
rabbitmqctl add_user carol pass123 rabbitmqctl set_permissions -p vhost1 carol "" "" ".*" -> Option A
Quick Check:
Read-only = config "", write "", read ".*" [OK]
Hint: Set empty config/write, full read permission for read-only user [OK]
Common Mistakes:
Giving full permissions instead of read-only
Mixing up permission order (config, write, read)
Forgetting to specify virtual host
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.