Restricting MongoDB access by enabling authentication - Documentation for BMC Digital Workplace Advanced 18.02

Follow this procedure for a stand-alone environment only (not when running MongoDB as a replica set).

Video demonstration

The following video (4:10) demonstrates how to restrict MongoDB access by enabling authentication and store the encrypted MongoDB password in the configuration file:

To restrict MongoDB access by enabling authentication

  1. Log on to the MongoDB shell and enter the following commands:

    use admin
    db.createUser( {	user: "siteUserAdmin",	pwd: "<siteUserAdminPassword>",	roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
    });
    use social
    db.createUser( {	user: "social_admin",	pwd: "<social_adminPassword>",	roles: [ { role: "dbOwner", db: "social" } ]
    });
  2. Enable authentication by using either of the following methods: 
    • Start the mongodprocess by using the --auth option.
    • In the mongoconfiguration, set auth = true and restart the mongo service.
  3. To connect the BMC Digital Workplace  or Smart IT social service to mongo, change config.js in Smart_IT_MyIT/social to use the following value:

  4. Restart the social service. 

You Might Also Like