Reputation: 723
I have a project on Google Cloud where in I have a few vm instances created.
I need to give someone access to only one of the instances
For now I have given them access to all the instances by adding them through IAM as
But how do I change this to give them access to only one of the instances please ?
Thanks
Upvotes: 2
Views: 3560
Reputation: 1
The best practice to grant SSH to a User on GCP is :
enable-oslogin=TRUE
Service Account User
and Compute viewer
to the userCompute OS Admin Login
or Compute OS Login
to the userUpvotes: 0
Reputation: 4324
It is possible to manually add their public SSH key to the machine: the
documentation can be found here.
You will generate a public/private key pair, format it, upload the public one to the machine and the user will be able to connect to the machine using the private one.
Then remove the Compute Engine Instance Admin role to take away her access to the other instances.
If you leave her role as default compute engine service account actor, she may assume the same rights as the service account, which by default is project editor.
The best way to limit this is create a new service account with only the scopes you wish to grant (perhaps access to Storage or some other APIs), set it as the service account for the instance and add the user as its actor. You can read more here.
Upvotes: 1