How to activate a GCP service account for other users in Linux.

First generate a key for the service account. Save as key.json.

Login to the server as that user and copy the key there. Activate the service account.

<pre lang="bash">
$ gcloud auth activate-service-account [ACCOUNT] --key-file=key.json

Once authenticated, you should be able to check if service account is active.

<pre lang="bash">
$ gcloud config list

A better option without needing a key.

<pre lang="bash">
gcloud config set core/account service-account@project-id.iam.gserviceaccount.com