1

Well I am new in MongoDB. Just started using 2 tutorials from tutorialspoint and w3resource. I am really enjoying learning it. I think it is really the future of database management. However I have faced some problems and I want to clear my conceptions on those issues. Here is the first question of the stack of noted questions. Any help will be highly appreciated.

I use Ubuntu 14.04 LTS (32bit machine and O/S). My MongoDB version is 2.6.11. I use terminal to toy with MongoDB. According to MongoDB website I start the server mongod using this command...

$sudo service mongod start

Now to start the server with authentication enabled what should be the command? I tried using

$sudo service mongod --auth start

but it doesn't work.

1
  • What does "it doesn't work" mean? It doesn't start? It starts without authentication? We need more details. Commented Nov 14, 2015 at 15:40

2 Answers 2

1

Regarding the issue described in above mentioned post I suggest you to check authentication options into mongodb configuration file.

# Turn on/off security.  Off is currently the default
#noauth = true
auth = true

And after it initialize mongod service using auth mode.

sudo mongod --auth --dbpath /var/lib/mongodb

Auth configuration option should be set to true and accordingly mongo service will start in authentication mode.

0

As per the description i can understand that you installed mongoDB using rpm package, for this you can find the cnf file in /etc/mongod.conf open this file as root user

vi /etc/mongod.cnf

un comment the auth line

auth = true

save and exit, now you can start the service as

sudo service mongod start

but before enabling the auth make sure you have one admin user who has all the roles to perform the administration works

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.