gcloud init. What does this command do?The gcloud init command helps you set up your local environment by authenticating your account, selecting a default project, and configuring default settings. It does not install services, delete projects, or update the SDK.
The recommended way to install the Google Cloud SDK on Debian-based systems is to run the installation script via curl https://sdk.cloud.google.com | bash. The apt-get command requires adding Google Cloud repositories first, which is not shown here. yum is for RedHat-based systems, and pip is not used for this SDK.
gcloud init. You run gcloud auth login to authenticate. What is the expected behavior?gcloud auth login allows you to authenticate your account independently of gcloud init. However, without gcloud init, no default project or configuration is set, so you must specify projects manually in commands.
Using service account keys for automation and shared environments is a best practice because it avoids exposing personal user credentials. Running as root or sharing credentials folders risks security. The --no-launch-browser flag is useful but less secure than service accounts for shared machines.
gcloud init, you execute gcloud config set project my-project-123. What does this command do?The command gcloud config set project [PROJECT_ID] updates the default project in your current gcloud configuration. It does not create or delete projects, nor does it affect authentication status.