Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli ops-manager security enable

On this page

  • Syntax
  • Options
  • Output
  • Example

The security enable command enables an authentication mechanism for the specified Ops Manager clusters in the given project. You can also enable authentication through the Ops Manager UI.

Note

After you enable an authentication mechanism with MongoDB CLI, the Security page of the Ops Manager UI shows no users for Backup Auth and Montoring Auth because these users are deprecated for new projects.

mongocli ops-manager security enable [MONGODB-CR|SCRAM-SHA-256]
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]

Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no

A successful security enable command returns an in-progress status message with a link to your Ops Manager topology page.

The example below uses the mongocli ops-manager security enable command to enable SCRAM-SHA-256 on a project specified in the configuration file.

The command uses the default profile to access Ops Manager.

mongocli ops-manager security enable SCRAM-SHA-256

You can also enable multiple authentication mechanisms with a single mongocli command. The following examples enables MONGODB-CR and SCRAM-SHA-256 on a project with the default profile.

mongocli cloud-manager security enable MONGODB-CR SCRAM-SHA-256

Back

Security