GCP : The user account authentication flow no longer works as of Febuary 1, 2023.

GCP @ Freshers.in

Since the user account authentication flow has changed, you should go ahead with the Cloud SDK installation to authenticate and use gsutil. The Cloud SDK includes the gsutil command-line tool and other utilities like gcloud and bq. To install Cloud SDK on Ubuntu, follow these steps:

  1. Update and install necessary packages:
sudo apt-get update && sudo apt-get install curl apt-transport-https ca-certificates gnupg
  1. Add the Cloud SDK distribution URI as a package source:
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
  1. Import the Google Cloud public key:
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
  1. Update and install the Cloud SDK:
sudo apt-get update && sudo apt-get install google-cloud-sdk
  1. Optionally, you can also install any additional components you may need, such as google-cloud-sdk-app-engine-python, google-cloud-sdk-datastore-emulator, etc.
  2. After installing the Cloud SDK, run the following command to authenticate
gcloud auth login

This will open a new browser window (or provide a URL to copy-paste into a browser) where you can log in with your Google account. After successful authentication, you can use gsutil and other Cloud SDK tools with your account.

For more information on installing Cloud SDK on other platforms or using alternative methods, refer to the official documentation: https://cloud.google.com/sdk/docs/install

Additionally, remember to periodically update the Cloud SDK to get the latest features and bug fixes:

gcloud components update
Author: user

Leave a Reply