Skip to content
CloudScope

  • AWS
  • GCP
  • Ansible
  • Azure
  • Contact
  • Privacy Policy
  • About us
gcloud acclount login
GCP

Connect to Account Using gcloud CLI

CloudScope February 19, 2023March 14, 2023 gcloud auth login, gcloud gcp, gcp

Prerequisite: Install gcloud cli

How to authenticate gcp account using gcloud cli

Login in to the account using the below cli command, this command will trigger a browser based authentication

gcloud auth login

After authenticating to the account, let’s connect to the project that we need to work in

gcloud config set project-name

Now we are set with both account and project, but how to confirm this
Yes, below command will help us with the details, this command will list out [default] configuration and project

gcloud config list

Output:-

[accessibility]
screen_reader = False
[core]
account = cloud.scope@company.com
disable_usage_reporting = True
project = first-project

Your active configuration is: [default]

Now we are set with the account and project name, let’s try to list down the virtual machines running in our project.

gcloud compute instances list

How to save multiple accounts configuration?

Assume we are supporting multiple accounts, so we want to login other accounts as well and should be listed under our list with the default configuration

To achieve this, we can create a new configuration for each account and then switch between them.

syntax : gcloud config configurations create/delete/describe/activate/list

Below command will help us to create new configuration

gcloud config configurations create configuration_name

example – gcloud config configurations create my-client

After creating new configuration, Login to the account using auth login and then set the project name
gcloud auth login
gcloud config set project-name

After adding the other configuration, run the below command to see all the accounts added in your configuration

gcloud config configurations list

Now we have more than one accounts listed, but at a time only one account can be active, IS_ACTIVE is the column name where we can see which account is currently active in the form of True or False
Bang! We successfully added other account, but wait how can we activate other account

Below command will help us to activate the configuration

gcloud config configurations activate configuration_name

example:- gcloud config configurations activate default

Read More

Most used gsutil commands for Google Cloud Storage

How to create GCP Account for free

  • gsutil for GCP Cloud Storage
  • How to install netcat nc on linux using yum

You May Also Like

gcp account

Create GCP account for free

CloudScope March 14, 2023March 14, 2023 0
gcloud

How to install gcloud cli on Windows

CloudScope February 16, 2023February 16, 2023
gsutil

gsutil for GCP Cloud Storage

CloudScope February 16, 2023February 17, 2023
No comments to show.
Copyright © 2025 CloudScope. All rights reserved.
Theme: ColorMag by ThemeGrill. Powered by WordPress.