Google Cloud Provider (GCP)
Install Google Cloud Cli​
Windows OS​
Run in Powershell
(New-Object Net.WebClient).DownloadFile("https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe", "$env:Temp\GoogleCloudSDKInstaller.exe")
& $env:Temp\GoogleCloudSDKInstaller.exe
Linux / Other OS​
Login​
Console Login​
gcloud init # Login window open in browser
gcloud init --console-only # `--console-only` flag to prevent the command from launching a browser-based authorization flow, if required
Login using Service Account​
- Create the service Account
- Open the Service account and navigate to
KEYS
tab and clickAddKey
->Create new key
option. - Select
Json
/P12
formate and clickcreate
button. It will downloadserviceaccount.json
file.
# Login
gcloud auth activate-service-account --key-file serviceaccount.json
# List
gcloud auth list
tip
Before access any service in GCP, please enable the appropriate API and provide the required permission to service account
SSH Config​
Copy the SSH Key from GCP -> Compute Engine -> Settings -> Metadata -> SSH Keys
. If there no key available, generate new one with the below command and add the public key into SSH Keys.
Generate SSH key
ssh-keygen -t rsa -f ~/.ssh/<ssh-file-name> -C <UserName> -b 2048 # Linux
ssh-keygen -t rsa -f ./<ssh-file-name> -C <UserName> -b 2048 # Windows