Accessing Google cloud project with service account

0 votes
I have used the gcloud auth login for authentication, but now I want to use a more secure method with service accounts. I have stopped my instance, created a service account with Owner roles, but when I use the gcloud project list, I can only see the current project. I have multiple other projects, how can I access every project with a service account?
Oct 16 in GCP by Sam
• 4,320 points

1 answer to this question.

0 votes

In order to achieve this, you will have to activate the service account. You could use the following command:

$ gcloud auth activate-service-account --key-file=[KEY:JSON]

and then initialize the gcloud command with

$ gcloud init

Check this for more info:

answered Oct 16 by Sirajul
• 39,540 points

Related Questions In GCP

0 votes
1 answer

How to delete a project from Google Cloud Console

First of all, select the project you ...READ MORE

answered Apr 18, 2018 in GCP by kurt_cobain
• 9,260 points
+3 votes
11 answers

How do I delete my Google Cloud Platform Account?

How do I delete me cloud and ...READ MORE

answered Jan 18 in GCP by
0 votes
2 answers

How to transfer google cloud project ownership?

Go to IAM and Admin Then Select IAM Click Add Provide another user's ...READ MORE

answered Aug 20, 2018 in GCP by Priyaj
• 56,940 points
0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23 in GCP by Sirajul
• 39,540 points
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23 in GCP by Sirajul
• 39,540 points
0 votes
1 answer

How do I create a Google Cloud Platform (GCP) account?

In order to access the services provided ...READ MORE

answered Sep 20 in GCP by Sirajul
• 39,540 points