Assume two users, A and B have full access to a GCP project. User A creates a VM. Once this is done , it appears user B can login into the VM and also has sudo access to the VM.
we used enable-oslogin metadata but we have issue where user a and b belong to same group, is there any other way so that i can restrict access for user B
Suspending an instance differs from stopping an instance in the following ways: Suspended instances preserve the guest OS memory, device state, and application state. Google charges for the storage necessary to save instance memory. You can only suspend an instance for up to 60 days.
Open the Service Accounts page in the GCP Console and select the required Project. Click on Create Service Account and enter a service account name and select a role with desired permissions for the service account. Note: Make a note of the email ID of the service account. Click Save.
As per docs you have 2 options.
Managing Instance Access Using OS Login, this feature gives you more granular control over which users can connect to your instances and what level of permission they have. If you remove roles/compute.osLogin
the user won't be able to access any VM in the project (docs).
To grant an user access to specific instance over SSH only you can follow the below steps (docs):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With