5

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.

2
  • I've asked the RabbitMQ team to introduce such a feature at github.com/rabbitmq/rabbitmq-server/issues/1576 .
    – Richlv
    Apr 10, 2018 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, 2018 at 7:24

3 Answers 3

7

sudo rabbitmqctl authenticate_user <username> <password>

If the password is appropriate it shows:

Authenticating user "username"
Success

If the password is wrong it shows the below:

Authenticating user "username"
Error: failed to authenticate user "username"
1
  • If you need to reset the password, just use rabbitmqctl change_password <username> <password> Mar 2, 2023 at 17:51
3
  • 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.
1
0

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.

2
  • Thanks, but my question was is there a way to avoid both of your suggestions.
    – badbishop
    Dec 8, 2015 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, 2015 at 7:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .