Skip to content

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.

  1. Open a PowerShell (Administrator) and change to the following directory:

    C:\Program Files\SEAL Systems\seal-mongodb
    
  2. Execute the following script:

    .\secure-mongo.ps1
    

Secondary Members of the Replica Set

If you run PLOSSYS 5 in a cluster, execute the above step on the replica set primary. Then execute the following steps on any secondary member of the replica set:

  1. Copy the key file created by secure-mongo.ps1 on the replica set primary

    C:\ProgramData\SEAL Systems\config\mongod.keyfile
    

    into the following directory on your current member of the replica set:

    C:\ProgramData\SEAL Systems\config\
    
  2. Add the following lines to the C:\ProgramData\SEAL Systems\config\mongod.conf file:

    security:
      authorization: enabled
      keyFile: C:\ProgramData\SEAL Systems\config\mongod.keyfile
    
  3. Restart MongoDB:

    seal-mongodb
    
  4. Proceed with step 1 on the next member of the replica set.