9

I have install MongoDB 3.0.1 in a server (Ubuntu14.04). I need to enable remote authentication for my MongoDB, so that it can only be seen by registered user. Once installed Mongo, I have run these commands:

> use admin
switched to db products
> db.createUser({user: "userAdmin", pwd: "admin1234", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]})

This is my /etc/mongod.conf":

dbpath = /var/lib/mongodb
logpath = /var/log/mongodb/mongod.log
logappend = true
port = 27017
bind_ip = 127.0.0.1,SERVER_IP
auth = true

If I try to connect with RoboMongo, I get this message

YES - Connected to SERVER_IP
NO - Authorization failed

If I try to access it from my browser (http://SERVER_IP:3000/products) I get this message:

null

If I change the configuration file this "auth = false" from the browser I can see this (which is correct)

[]

But I can not login, someone can help me?

Manu
  • 652
  • 3
  • 11
  • 22
  • Tools like RoboMongo still need to be updated to the latest version of whatever driver they run on, in order to be compatible with changes in MongoDB 3.0. You'll have to wait until RoboMongo is updated. – wdberkeley Mar 19 '15 at 18:17
  • FYI, this is being addressed for the Robomongo 0.9.0 release: https://github.com/paralect/robomongo/issues/766 – Stennie Mar 20 '15 at 02:42
  • Looks like the 0.9.0 release is not going to happen soon: https://github.com/paralect/robomongo/milestones/Robomongo%200.9.0 .. – Romain Sep 03 '15 at 14:02
  • And if someone is facing issues deciphering the connection string, check my answer here: http://stackoverflow.com/a/35935789/1578274 – Vaibhav Mar 11 '16 at 09:02

2 Answers2

12

Via Robomongo.org homepage:

Note: We are working on an update with MongoDB 3.0 compatibility for the upcoming Robomongo 0.9.x release series.

Robomongo is currently on version 0.8.5 which only supports MongoDB 2.2

Matt Jensen
  • 1,495
  • 17
  • 21
  • Despite the older shell, Robomongo 0.8.x supports auth up until MongoDB 2.6. MongoDB 3.0 adds a new SCRAM-SHA-1 auth which definitely isn't supported yet. – Stennie Mar 23 '15 at 02:26
3

mongo 2.6 uses MONGODB-CR auth protocol and 3.0 uses MONGODB-SHA-1 by default. the work around would be to create your databes with a server running auth and version 2.6 then upgrade to 3.0 because both authMechanism can co-exist. Any user created with MONGODB-CR will continue to use that authentication as long as you do not run a authSchemaUpgrdae after you have upgraded to 3.0.

PS. robomongo and older versions of drivers uses MONGODB-CR.

Dwayne Mcnab
  • 131
  • 1
  • 1