1

I search through the manual but no result.

By default we can manage all database because we run it on localhost. (am I right?)

For each database we can setup-up custom users or create global admins. But how can i login under this users? (i want to see the access difference to understand how it works)

In general I want to create system looks like MySQL. No external access to it, simple creation of users to custom db. Access only from localhost. How can I do this?

1 Answer 1

3

By default we can manage all database because we run it on localhost. (am I right?)

Yes, the 'localhost bypass' can be disabled by starting the daemon with

mongod --setParameter enableLocalhostAuthBypass=0

But how can I login under this users?

> use myDB
> db.auth( "myUser", "myPassword" )

This is assuming that you have created the user already.

Access from localhost only you would control via your firewall or starting the daemon with

mongod --bind_ip 127.0.0.1

The MongoDB documentation has a complete, albeit a bit difficult to understand documentation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.