0

I'm a little confused by the mongo server setup I'm currently trying to set up. I have a regular debian webserver running appache and mysql. nothing fancy here. For a project I'm working on I would like to setup a mongodb server.

after installing mongodb I tried to connect via MongoDB Compass and it worked just fine using mongodb://domain.tld only.

For obvious reasons I'd like to have a basic user authentication on mentioned server.

here's what I did so far:

> use admin
> db.createUser({
    user: "my_username",
    pwd: "my_password",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  })

and in the /etc/mongod.conf i added:

security:
    authorization: "enabled"

after stopping, deleting /tmp/mongodb-27017.sock and starting again I was still able to connect via mongodb://domain.tld and was not asked for authentication.

Am I doing something wrong here or does mongo work on a different concept I'm missing here? Either way, I hope someone is able to help me out here. Thank you very much in advance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.