LoginSignup
0
0

More than 5 years have passed since last update.

※メモ Bitnami MEAN (MongoDB password reset)  

Posted at

Edit the /opt/bitnami/mongodb/mongodb.conf file and replace the following lines:

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

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true
setParameter = enableLocalhostAuthBypass=0

with:

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

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true
#setParameter = enableLocalhostAuthBypass=0

Restart the MongoDB server:

cd /opt/bitnami
sudo /opt/bitnami/ctlscript.sh restart mongodb

Create a new administrative user with a new password. Run the following commands to do so (remember to replace NEWPASSWORD with the new one you want to set):

mongo
> db = db.getSiblingDB('admin')
admin
> db.changeUserPassword("root", "NEWPASSWORD")

Revert the modifications made to /opt/bitnami/mongodb/mongodb.conf by replacing:

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

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true
#setParameter = enableLocalhostAuthBypass=0

with:

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

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true
setParameter = enableLocalhostAuthBypass=0

Restart the MongoDB server again:

cd /opt/bitnami
sudo /opt/bitnami/ctlscript.sh restart mongodb
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0