Activating the User Authentication¶
Single System and Replica Set Primary¶
The user authentication of MongoDB is disabled by default. Activate the user authentication to enhance the security.
Execute the following shell script as administrator:
/opt/seal/seal-mongodb/secure-mongo.sh
Secondary Members of the Replica Set¶
-
Copy the key file created by
secure-mongo.shon the replica set primary/opt/seal/etc/mongod.keyfileinto the same directory on your current member of the replica set:
/opt/seal/etc -
Add the following lines to the
/opt/seal/etc/mongod.conffile:security: authorization: enabled keyFile: /opt/seal/etc/mongod.keyfile -
Restart MongoDB:
sudo systemctl restart mongod -
Proceed with step 1 on the next member of the replica set.