I've a server, where I use the gcloud command for monitoring purposes. Previously I used the gcloud auth login for authentication, but now I'd like to use a more secure method with service accounts. I stopped my VM, create a service account with Owner roles, but when I use the gcloud project list, I only see the currenct project. But I have 3 other projects, how can I access every project with a service account?
To achieve that, you will have to activate the service account with :
$ gcloud auth activate-service-account --key-file=[KEY:JSON]
and then initialize the gcloud command with :
$ gcloud init