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, 2019 in GCP by Sam
• 6,260 points
394 views

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: https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account 

 https://cloud.google.com/sdk/gcloud/reference/init

Hope it helps!!

To know more about Google Cloud, join Google Cloud platform certification course today.

Thank You!

answered Oct 16, 2019 by Sirajul
• 59,090 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,390 points
1,640 views
+7 votes
12 answers

How do I delete my Google Cloud Platform Account?

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

answered Jan 18, 2019 in GCP by dodge123@yahoo.com
98,868 views
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
• 58,140 points
3,874 views
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, 2019 in GCP by Sirajul
• 59,090 points
1,175 views
0 votes
1 answer
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, 2019 in GCP by Sirajul
• 59,090 points
615 views
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, 2019 in GCP by Sirajul
• 59,090 points
1,830 views