R
R
Roman Gor2014-04-01 15:59:26
MongoDB
Roman Gor, 2014-04-01 15:59:26

Why does mongo allow you to login without authentication data?

I'm trying to create a super user with top privileges:

>db.system.users.find().pretty()
{
"_id" : ObjectId("533aa7175572233602378633"),
"user" : "root",
"pwd" : "06dbc97127a71ab5b359a6a6e9ff5f53",
"roles" : [
    "readWrite",
    "userAdmin",
    "dbAdmin",
    "readWriteAnyDatabase",
    "userAdminAnyDatabase",
    "dbAdminAnyDatabase"
]
}

Login options:
mongo some_db -u root -p 5415- ok!
mongo some_db -u root -p 54153- error!
mongo some_db- ok! Why does mongo allow login even in this case?
PS:
auth = trueinstalled in the config.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lega, 2014-04-01
@lega

ok! Why does mongo allow logins, even in this case?
There is a login to the console, but the data is not available, then you need to log in via db.auth()
PS: To restrict access, developers recommend using OS tools instead of password authorization.

M
mr null, 2014-04-12
@mr_null

Set the some_db base login password, so it will not even allow the super-user to log in.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question