I have an instance of WIND Bitnami running on EC2. After significant finalization, I was able to successfully connect to the database using the local shell. I created authenticated users with all the permissions necessary to access the data, and when I run the code below, I can access the database without any problems.
sudo mongo admin -u <USERNAME-p <PASSWORD>
However, when I try to repeat this using a remote connection, I am repeatedly given the "auth failed" error from MongoDB.
mongo <HOST>:<PORT>/<DATABASE> -u <USERNAME> -p <PASSWORD>
...
This is strange because I use the same credentials as when working with the local shell. The only difference is that I include host and port information. Since then, I have also confirmed that my remote connection works if I disable the auth option in the mongodb.config file.
mongo <HOST>:<PORT>/<DATABASE>
Obviously, in production, I want to be able to authenticate. Do any of you have suggestions as to why there is a discrepancy between remote and local authentication?
source share