Skip to content

Connect to a VM over SSH

View as Markdown

SSH gives you a shell on your TIR Virtual Machine (VM) as root, from a terminal on your computer. It is the one way to work inside a VM.

Open the VM from Manage VMs by selecting its name. While the VM is Running, SSH Command is under Connection Details on the Overview tab. The SSH button at the top of the VM’s page gives the same command, a version with a key file, and a few commands to try once you are in.

  1. Copy SSH Command. It has this form, with the VM’s address in place of <ip-address>:

    ssh root@<ip-address>

    The address is the first one the VM has in this order: its public IP, its first reserved IP, its first VPC IP.

  2. Paste the command into a terminal and run it. If your private key is in a file other than the one SSH tries by default, name it with -i:

    ssh -i ~/.ssh/<private-key-file> root@<ip-address>

    Replace <private-key-file> with the name of the private key that matches a key attached to the VM.

  3. The first time you connect to an address, SSH asks you to accept the VM’s fingerprint. Type yes.

You now have a prompt on the VM, and every command you type runs there as root. On a GPU plan, run nvidia-smi to see the VM’s GPUs.

Running means the VM’s operating system is up. If the connection is refused right after that, give SSH a moment to start and run the command again.

What you see What to do
Connection refused or Connection timed out Check that an attached security group allows TCP port 22 from your address. See Connection timed out.
Permission denied (publickey) Sign in as root, with the private key of a key attached to the VM. See Permission denied.
WARNING: UNPROTECTED PRIVATE KEY FILE! Run chmod 400 ~/.ssh/<private-key-file>, then connect again.
Host key verification failed A different VM now answers at an address you used before. Run ssh-keygen -R <ip-address>, then connect again.
SSH Access shows Disabled It turns on once the VM has an SSH key. Attach one. See Manage SSH keys on a VM.

For other messages, see Troubleshooting TIR Virtual Machines.

With a shell open, add startup scripts to the VM so it sets itself up again on every boot. To keep the same address across a stop and a start, attach a reserved IP to the VM.