This method for gsutil to access Google Cloud Storage bucket with shared Service account with private key as JSON
Sample JSON Structure
{
  "type": "service_account",
  "project_id": "xxx",
  "private_key_id": "xxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\name-----END PRIVATE KEY-----\n",
  "client_email": "xxx@xxx.iam.gserviceaccount.com",
  "client_id": "xxx",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/xxx.iam.gserviceaccount.com"
}
- Using 
gsutil config -eto set method to authentication - Choose 
oAuth2and provided full path of service account JSON file - Then you can access with 
gsutil ls gs://{bucket-name} 
    
Top comments (0)