MongoDB read-only user not authenticating

MongoDB read-only user not authenticating



I'm currently attempting to create a read-only user in MongoDB for a grader. The MongoDB instance is hosted remotely on AWS EC2, and the security groups are all set up properly.



I can SSH onto the remote machine and authenticate with the read-only account there, like so:


# On remote machine
mongo -u <read-only username> -p <read-only-pwd> <database>



However, as soon as I try to connect to that same instance from my local machine using mongo, I encounter authentication errors.


mongo


# On local machine
mongo -u <read-only username> -p <read-only pwd> <host>/<database>



What gives?



The read-only user exists on <database>, and has "read" permissions.


<database>


"read"






When you say encounter authentication errors what do you mean? Please provide error message.

– Oscar Nevarez
Sep 17 '18 at 2:21




1 Answer
1



Check that you're not trying to authenticate with the wrong machine.



I'm an idiot.



Thanks for contributing an answer to Stack Overflow!



But avoid …



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




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

Popular posts from this blog

Malaysia to Papua New Guinea by motorcycle?

.name

List of Bhojpuri films