2

I had finished installing RabbitMQ (my first time dealing with it) on a CentOS 7 installation and was trying to log into the web management console but to no avail.

I had created an admin user and set administrator tags for the user since it seemed that it was highly discouraged to use the guest user for logging into the web management console remotely.

I knew the credentials were correct but the login page kept telling me "Login Failed" while the logs showed:

2020-02-19 09:56:27.069 [warning] <0.622.0> HTTP access denied: user 'rbt_admn' - invalid credentials

Googling only seemed to give results for people facing similar problems but who were mostly trying to login with guest or had incompatibility issues but I was sure none of those were the problem for me.

After a sleepless night of troubleshooting, I was able to solve it. So I'll post my solution below in case this is of use to someone in the future.

Steve S
  • 509
  • 1
  • 11
  • 24

1 Answers1

1

I came accross the command rabbitmqctl authenticate_user.

So I tried it with the user account:

rabbitmqctl authenticate_user rbt_admn

Entered the correct password only for it to report

Error: failed to authenticate user "rbt_admn"

I tried it a couple of more times just to be sure and then it occurred to me. My password had dollar signs. As in something like (but not) "P4$$w0rd" So I deleted the user

rabbitmqctl delete_user rbt_admn

Recreated the user again with a different password and mercifully it worked.

I'm not sure why this happened but I think the dollar signs caused bash (maybe? I am not well versed in shell scripting) to feed and have rabbitmqctl store something different from my intended password.

If someone can explain why this happened they are more than welcome to do so.

Steve S
  • 509
  • 1
  • 11
  • 24
  • 1
    Yes. If you ran something like `rabbitmqctl add_user user P4$$w0rd` the shell would substitute the current shell PID for `$$`, so the password would be something like `P41234w0rd`. To avoid this, you should use single quotes in POSIX shells: `rabbitmqctl add_user user 'P4$$w0rd'` – Luke Bakken Feb 20 '20 at 16:41
  • 1
    Man, I didn't know this. Thanks a lot. You would think that something like this would be touted as part of best practice along with login as a sudoer account instead of root in order to avoid shooting yourself in the foot, but this is the first I am hearing of it. Thank you very much. – Steve S Feb 21 '20 at 08:55
  • 1
    No worries! I'm sure there are quick guides online for POSIX shell quoting rules. At least those rules make sense, as opposed to `cmd.exe` on Windows. – Luke Bakken Feb 21 '20 at 19:20
  • I am having the same issue but my password is admin123. but tried it with single quotes but its not still working – Nithin Varghese Jul 22 '22 at 07:41