To SSH into a Google Cloud Compute Engine instance, follow these steps:
- Open the Secure Shell Client
- Generate a new SSH key pair if you don’t already have one:
$ ssh-keygen -t rsa
- Add your public key to the instance:
- Go to the Google Cloud Console.
- Select your project.
- Go to the VM instances page.
- Click on the name of the instance that you want to connect to.
- Click on the Edit button at the top of the page.
- Scroll down to the “SSH keys” section.
- Add your public key to the list of authorized keys.
- Connect to the instance using the following command:
$ ssh <username>@<instance-external-ip>
Replace <username>
with the appropriate username and <instance-external-ip>
with the external IP address of the instance.