On the Server
I have the Mongod instance running on my server.
I created a User on admin, using which I created a user with readWrite
role on the database that I wanted to access.
Updated the mongo /etc/mongod.conf
file:
commented out the bind ip
uncommented auth=yes
Restarted Mongod
using sudo service mongod restart
On the Client:
The db.auth(user,pass)
command works fine on the remote server, but shows auth failure on the client (my home system).
I made sure that I was using the correct database with the use myDb
command.
PS. I am able to connect to the mongo server using the mongo xx.xx.xx.xx:27017
command. But unable to Authenticate.
Please help. Mongo v3.0.3.