Compute Engine provides tools to manage your SSH keys and help you connect to either Linux and Windows Server instances.
This page explains the most basic ways to connect to your Compute Engine instances. Alternatively, you can learn how to connect to instances using third-party tools or connect to instances that have no external IP addresses.
To learn how to use IAM roles to manage user access to your Linux instances, see Managing Instance Access using OS Login.
Connecting to Linux instances
You can connect to Linux instances through either the
Google Cloud Platform Console or the
gcloud command-line tool.
Compute Engine generates an SSH key for you and stores
it in one of the following locations:
- By default, Compute Engine adds the generated key to project or instance metadata.
- If your account is configured to use OS Login, Compute Engine stores the generated key with your user account.
- In the Cloud Platform Console, go to the VM Instances page.
In the list of virtual machine instances, click SSH in the row of
the instance that you want to connect to.
gcloud compute ssh command to connect
to instances that you have permission to access:
gcloud compute ssh [INSTANCE_NAME]
[INSTANCE_NAME] is the name of the instance.
After you connect, you can use the terminal to run commands on your Linux
instance. When you are done, use the
exit command to disconnect from the
Connecting to Windows instances
You can use RDP to connect to a Windows instance and start a remote desktop session. This process allows you to interact with the Windows desktop remotely.
If you run into issues logging in to your instance using RDP, you might
not have a firewall rule that allows RDP traffic on port 3389 (
instructions on how to add a firewall rule, see
Adding a firewall rule.
- Go to the VM instances page in the in the GCP Console.
- Click the RDP button next to the instance that you want to connect to. A new browser window opens with the Chrome RDP for Google Compute Engine extension.
- Enter your username and password. If this is your first time connecting to this instance, or if you have forgotten your password, read the documentation for Creating passwords for Windows instances.
- Click OK to connect.
Connect through an RDP client
- Install an RDP client. If you don't have a preference, install the Chrome RDP for Google Compute Engine extension.
- Find the external IP for your Windows instance. Go to the
VM instances page
in the GCP Console or run
gcloud compute instances listto see a list of your instances with their External IP values.
- In your RDP client, specify the external IP address for your instance as the IP address to connect to. For example, in the Chrome RDP extension, you would enter the IP address in the following format:
Enter your log-in information and leave the Domain field blank. If this is your first time connecting to this instance, or if you have forgotten your password, read the documentation for Creating passwords for Windows instances.
- Learn how to manage access to instances for multiple users across a project or organization.
- Learn how to connect to instances using third-party tools.
- Learn how to connect to instances that have no external IP addresses.
- Learn how to manage instance access manually by adding and removing SSH keys in metadata, which is an alternative to granting access through IAM roles.
- Learn how to transfer files to Linux instances.