'RabbitMQ set_permissions syntax

I've installed rabbitmq and it's running.

I've successfully add_user as well as add_vhost. But in the next step of the documentation it says to set_permissions and I'm failing.

I get Error: could not recognise command when I enter the following:

$ sudo rabbitmqctl set_permissions -p myvhost myuser ".*" ".*" ".*"

(this is copy and pasted verbatim from the documentation so it seems a bit ridiculous that it doesn't work.. And 'recognise' being misspelled in the error msg isn't helping)

My question is what does ".*" ".*" ".*" mean/stand for?



Solution 1:[1]

From the documentation

set_permissions [-p vhostpath] {user} {conf} {write} {read}

vhostpath - The name of the virtual host to which to grant the user access, defaulting to /.

user - The name of the user to grant access to the specified virtual host.

conf - A regular expression matching resource names for which the user is granted configure permissions.

write - A regular expression matching resource names for which the user is granted write permissions.

read - A regular expression matching resource names for which the user is granted read permissions.

To answer your question specifically, ".*" ".*" ".*" is a set of three regular expressions (applying to configure, write, and read) which will match all the permissions available (. will match any character, * will match any number of the preceding character)

Solution 2:[2]

.* means you have full permissions ^$ means you don't have any permissons

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Community
Solution 2 chen Augustin