RabbitMQ default user 'guest' not working

Issue ( not really an issue :) )

After you install RabbitMQ and enable his plugin management console sudo rabbitmq-plugins enable rabbitmq_management you can connect to that management console by visiting: http://[your droplet’s IP]:15672/.However there is a problem if you don’t connect to it from localhost: http://localhost:15672/. Because as stated here :

By default, the guest user is prohibited from connecting to the broker remotely; it can only connect over a loopback interface (i.e. localhost). This applies both to AMQP 0-9-1 and to any other protocols enabled via plugins. Any other users you create will not (by default) be restricted in this way.

Fix

Create a user:

[sudo] rabbitmqctl add_user username password

Set user tags:

[sudo] rabbitmqctl set_user_tags username administrator

Add permissions:

rabbitmqctl set_permissions -p / test ".*" ".*" ".*"

Alternative fix (not recomended )

User “gust” can be removed from loopback in rabbitmq.config. However, it is danger to leave default user and default password for remote access but better also change password.

If you are using ubuntu then this file is located at /etc/rabbitmq/rabbitmq.config and add  [{rabbit, [{loopback_users, []}]}]

To check the password you will need to use:

[sudo] rabbitmqctl change_password guest NEWPASSWORD

Enjoy!

Get The Best Of All Posts Delivered To Your Inbox

Subscribe to our newsletter and stay updated.