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.

Tom V
15.8k7 gold badges66 silver badges87 bronze badges
asked Nov 14, 2015 at 11:55
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.

answered Nov 16, 2015 at 8:27
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

answered Nov 17, 2015 at 12:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.