Skip to main content

Posts

Showing posts with the label Mongodb on Centos7- enabling user authentication

ENABLING USER AUTHENTICATION IN MONGODB

                                            In my previous article i have explained installation of mongodb in Centos.Follow the guidelines in  http://www.goserverspace.com/2017/09/mongodb-is-nosql-database-which.html In this article Iam explaining about enabling user authentication in mongodb. we will enable authentication for users to prevent that another user without sufficient privileges is able  to see the data on the database. On our CentOS 7 server, MongoDB is running under systemd with an init script in the '/etc/init.d/' dirctory. We will edit that script to force the mongodb service to run with the '--auth' option. Go to the '/etc/init.d/' directory and edit the "mongod" file: #cd /etc/init.d/ #vim mongod On line 15 you will find the "OPTION" variable, there we will add the "mongod" option. OPTIONS=" --auth -f $CONFIGFI...