- Google Cloud SDK
- macOS 64-bit (x86_64) reccommended
- Project ID from Project with running VM
- VPN Instance Name and Zone
- SSH Key for project
- `ssh-keygen -f ~/.ssh/
- ip address of running project
This only needs to be done once per project
gcloud compute project-info add-metadata --metadata enable-oslogin=TRUE --project=<project name>
- `gcloud compute os-login ssh-keys add --project= --key-file
- Note down the username in the
loginProfile
section - Usernames are normalized email addresses: foo.bar@gmail.com becomes foo_bar_gmail_com
- Note down the username in the
Connect using a specific key:
ssh username@ip -i ~/.ssh/<key_name>
-
list projects:
gcloud projects list
-
set default project: `gcloud config set project
-
list VM instances in default project:
gcloud compute instances list
-
stop a VM: `gcloud compute instances stop
-
tab completion supported
-
start a VM: `gcloud compute instances start
-
tab completion supported