Accessing a VM
This guide shows you how to configure SSH access and connect to your virtual machine.
Configuring a VM for SSH access
You can configure SSH access to a VM by adding SSH authorized keys (the public parts of SSH keys) to the VM specification.
Note: SSH authorized keys must be configured before the first boot, as such they can only be set on VM creation, and cannot be added later as part of an update.
These keys will be provisioned to the evroc-user account, with the public keys being added to the
~/.ssh/authorized_keys file on the VM for default evroc-user user.
You can use an existing public and private key pair, or you can create one from any linux terminal. For creating one, follow the instructions at generating a new SSH key. This will generate a private key (which will be used when you access the VM over SSH) and a public key beginning "ssh-rsa ...", This public key can then be used when constructing your resource definition below.
The supported public key types for the authorized keys are:
rsaecdsaed25519ecdsa-sha2-nistp256-cert-v01@openssh.comecdsa-sha2-nistp256ecdsa-sha2-nistp384-cert-v01@openssh.comecdsa-sha2-nistp384ecdsa-sha2-nistp521-cert-v01@openssh.comecdsa-sha2-nistp521sk-ecdsa-sha2-nistp256-cert-v01@openssh.comsk-ecdsa-sha2-nistp256@openssh.comsk-ssh-ed25519-cert-v01@openssh.comsk-ssh-ed25519@openssh.comssh-ed25519-cert-v01@openssh.comssh-ed25519ssh-rsa-cert-v01@openssh.comssh-rsassh-xmss-cert-v01@openssh.comssh-xmss@openssh.com
Note:
rsa,ecdsaanded25519are added for legacy, as they are valid public keys in some older distributions.
Accessing VMs via SSH in the evroc cloud
- Determine the public IP of the VM. You must determine that the VM is both running and has a public IP assigned. You can check this using the CLI:
evroc compute vm list
Or the API:
kubectl get evvm myvm
Sample output:
NAME READY REASON VIRTUALMACHINESTATUS IP PUBLIC IP
myvm True Ready Running 10.0.0.2 203.0.113.10
- Connect to the VM using SSH and the private key corresponding to the public key added to the VM:
ssh -i /path/to/privatekey evroc-user@<Public IP>
Sample output:
...
###########################################
# This server is running on evroc's cloud #
###########################################
>
Note: If you did not specify custom cloud-init, then your user will be called "evroc-user"
You should see a prompt confirming that you have successfully connected to the VM via SSH.
If your SSH command fails for any reason, follow the SSH troubleshooting guide.