Navigation

Alpha Release of MongoDB CLI

This is a pre-release early version of MongoDB CLI. Do not use MongoDB CLI to manage production environments.

mongocli cloud-manager security enable

On this page

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

Syntax

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

Note

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

Options

Option Type Description Required?
--authDB string Name of the authentication database for this user. Defaults to admin. 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 that contains the cluster to update. If omitted, uses the project ID in the profile or environment variable. no

Output

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

Examples

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

The command uses the profile named cmProfile for accessing Cloud Manager.

~ mongocli cloud-manager security enable SCRAM-SHA-256 --profile cmProfile

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 specified in the configuration file cmProfile.

~ mongocli cloud-manager security enable MONGODB-CR SCRAM-SHA-256 --profile cmProfile