Visual Studio Code extension for connecting to GCP virtual machine instances via Remote SSH.
- Lightweight, automated connection to GCP instances with
Connect
action - Directly compatible with the Remote SSH extension
- Linux/macOS system with
ssh-keygen
configured - Git
- Python
- Google Cloud Platform SDK with
gcloud
command - Remote SSH extension
- Ensure your current GCP project is set with
gcloud config set project [PROJECTNAME]
- Open the command pallete (
Cmd+Shift+P
) and selectGoogle Cloud Platform - Connect via Remote SSH
- Select
Connect
to create an SSH connection with a GCP instance, enter- the GCP project name configured in
1.
- a SSH key username
- the IP address of the VM instance you are connecting to (Console->Resources->VM instances on GCP)
- the name of your SSH keyfile (project name by default)
- the GCP project name configured in
- Enter a password for the SSH key-pair as prompted in the VS Code integrated terminal
- Connect to the newly added host via
Remote SSH
extension (name is IP address)
Change the location of your SSH directory with ChangeSSHDirectory
action.
The extension launches script.sh
from this repo in the integrated terminal. This creates a SSH key-pair via ssh-keygen
, adds it to your GCP project globally with gcloud compute project-info add-metadata
, and configures with Remote SSH manually by editing to the ~/.ssh/config
file used by the extension.
- Won't work with Windows
- Make sure the location of your SSH keys is set before connecting (most commonly
~/.ssh
)