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:
- Update and install necessary packages:
sudo apt-get update && sudo apt-get install curl apt-transport-https ca-certificates gnupg
- 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
- 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
- Update and install the Cloud SDK:
sudo apt-get update && sudo apt-get install google-cloud-sdk
- 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. - 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