Atlas Auth Commands
“This brief tutorial will explore the commands we can use to connect the Atlas CLI with your MongoDB Atlas deployment.
It is good to perform authentication to your development machines and restrict other addresses outside your network from accessing your cluster.
This ensures that you have sufficient security measures to protect your data.”
Atlas CLI Installation
Before you can use the Atlas commands on your machine, you need to ensure the MongoDB Atlas tools are installed on your machine.
This tutorial will install the Atlas CLI tools on the Debian system. However, you can check the MongoDB documentation for installation instructions on other systems.
Start by updating the system repositories:
Install GNUPG package.
Import MongoDB public GPG key with the command:
Create a repository file for MongoDB with the command:
Refresh the system packages:
Install MongoDB Atlas and Atlas CLI.
Verify the installation has been completed successfully and run the command below to show the current Atlas version.
The command above should return the output as shown:
Atlas Auth Options
To perform authentication to your Atlas account, we use the atlas auth command. The command syntax is as shown:
The command supports the following flags.
Atlas Auth Subcommands
The atlas auth commands support the following subcommands:
To connect your atlas CLI with your Atlas Account, run the command:
The command will generate a verification to connect to your CLI.
To log out, use the command:
To check the currently logged-in user:
To register with the atlas:
This post discusses the various commands and subcommands you can use to interact with your MongoDB Atlas cluster from the command line. We discussed topics such as login commands, authentication commands, and more. Feel free to check the docs for more information.