19

I have installed & setup the Rabbitmq on Centos remote server. Later I created an file "rabbitmq.config" and added the line

[{rabbit, [{loopback_users, []}]}]

and then restarted the rabbitmq server. Again tried to login the rabbitmq management web interface from my local machine using the guest credentials, but getting

login failed

error message.What is the proper way to empty the loopback user settings for Rabbitmq in Centos.

loganathan
  • 5,838
  • 8
  • 33
  • 50

3 Answers3

44

First of all connect to your rabbitmq server machine using ssh client so as to be able to run rabbitmqctl (like puTTY) & get into the sbin directory of rabbit installation

  1. you need to create a user for any vhost on that system (here I use default vhost "/")

$ rabbitmqctl add_user yourName yourPass

  1. Set the permissions for that user for default vhost

$ rabbitmqctl set_permissions -p / yourName ".*" ".*" ".*"

  1. Set the administrator tag for this user (to enable him access the management pluggin)

$ rabbitmqctl set_user_tags yourName administrator

... and you are ready to login to your rabbitmq management gui using yourName and yourPass from any browser by pointing it to http://"*********":15672 where ***** is your server IP hope it helps...

:-)

Joshua
  • 6,320
  • 6
  • 45
  • 62
12

There is an example config file, on centos do:

cp /usr/share/doc/rabbitmq-server-3.4.2/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config

Find and remove comments (and comma):

{loopback_users, []}

Then, stop rabbitmq:

rabbitmqctl stop

Now start the server:

service rabbitmq-server start

Now user "guest" can access from anywhere.

anonimmmoo
  • 129
  • 1
  • 2
5

Since RabbitMQ 3.3.0 there you can't use default guest/guest credentials except via localhost, (see release notes for 3.3.0 for details).

As a possible solution you can (and probably should) create custom secured user to be used for monitoring, management, etc.

Also you can use proxy setup.

P.S.:

if you enabled loopback_users check that proper config loaded (for running NODENAME), it is well-formed (has valid syntax and ended with .), management plugin activated and started and no firewall blocking rules exists.

P.P.S.:

Check that default user is guest, it exists and has default (guest) password. If you use some library to access to RabbitMQ, check that it has the same defaults as remote (guest:guest) or specify them explicitly.

pinepain
  • 12,453
  • 3
  • 60
  • 65
  • He has created the rabbitmq.config file: "If you wish to allow the guest user to connect from a remote host, you should set the loopback_users configuration item to []" http://www.rabbitmq.com/access-control.html – Gabriele Santomaggio Apr 12 '14 at 19:15
  • Yeah, I missed that point. Thanks for notice. I've updated my suggestions to check common pitfalls. – pinepain Apr 13 '14 at 12:27