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
1,137 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,230 points

Related Questions In GCP

0 votes
1 answer

Can a GCP service account with owner for a project grant rights to user account?

A service account is intended to perform ...READ MORE

answered Apr 6, 2022 in GCP by Korak
• 5,820 points
541 views
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,350 points
2,930 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
165,057 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,020 points
5,886 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,230 points
2,922 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,230 points

edited Jun 16, 2023 by Khan Sarfaraz 1,262 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,230 points
2,774 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP