Accessing instances with SSH

Table of contents

Generate a SSH key pair

To generate a key pair, use the following command on the computer you wish to connect from:

ssh-keygen
-t
rsa
-b
4096
-f
key.pem
This will generate a private key named key.pem and a public key named key.pem.pub in the current folder.

GCP does not offer any SSH key pair generator. You need to use ssh-keygen tool locally.

You can use your Cloud provider tools to generate a key pair:

You will then need to import your public key and use your private key to connect to your Virtual Device.

Import a SSH key pair

Web UI

Cloud provider tools

It is possible to use the SSH Key Management feature to import your public key to an instance.

You can use your Cloud provider tools to import the key pair:

Connect to your Virtual Device with SSH

Use the command:

Android 9.0 and above

ssh -i {your_private_key} shell@{instance_IP}

Android 8.1 and below

ssh -i {your_private_key} shell@{instance_IP}
-o HostKeyAlgorithms=+ssh-rsa
-o PubkeyAcceptedAlgorithms=+ssh-rsa

Note

Add additional SSH keys

Most Cloud providers do not offer to add additional SSH keys after an instance has been created. However, it is now possible to add and remove SSH keys from the web UI.