Is there a simple method to verify a RabbitMQ user password from command line? By simple I mean:

  • without rabbitmq_management plugin enabled

  • without extra dependencies, like ruby/python/etc. libraries not usually present on a Linux machine by default.

  • I've asked the RabbitMQ team to introduce such a feature at github.com/rabbitmq/rabbitmq-server/issues/1576 . – Richlv Apr 10 '18 at 7:18
  • Actually, it looks like normal user credentials cannot even be tested with rabbitmqadmin - it fails with "Not management user". – Richlv Apr 10 '18 at 7:24
  • There is rabbitmqctl authenticate_user
  • rabbitmqadmin can be used if the user has the management tag (which can be added temporarily)
  • Alternative authN backends have more options: LDAP tooling for the LDAP backend, curl for the HTTP backend and so on.
| improve this answer | |

sudo rabbitmqctl authenticate_user <username> <password>

If the password is appropriate it shows:

Authenticating user "username"

If the password is wrong it shows the below:

Authenticating user "username"
Error: failed to authenticate user "username"
| improve this answer | |

You can attempt to login with the username/password using rabbitmqadmin, although this is not included by default when installing RabbitMQ.

IMHO the simplest thing to do is write a Python script that connects to RabbitMQ, but this requires either a) the Kombu library or equivalent, or b) writing your own minimalistic AMQP client.

| improve this answer | |
  • Thanks, but my question was is there a way to avoid both of your suggestions. – badbishop Dec 8 '15 at 15:54
  • Sure, I thought that was the case. rabbitmqadmin is not the same as rabbitmq_management plugin, so I thought it worth mentioning. AKAICT your only options are to download a program that can authenticate against AMQP, or write your own implementation of AMQP's authentication protocol: rabbitmq.com/blog/2011/02/07/… – Mike Ryan Dec 9 '15 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.