Skip to main content

Creating an SSH Key

You’ll need to have an SSH key in order to create a virtual machine. If you already have one, you can ignore this.

MacOS and Linux​

  1. Open Terminal.
  2. Paste the text below.
$ ssh-keygen -t ed25519

This creates a new SSH key.

Generating public/private ALGORITHM key pair.

When you're prompted to "Enter a file in which to save the key", you can press Enter to accept the default file location. Please note that if you created SSH keys previously, ssh-keygen may ask you to rewrite another key, in which case we recommend creating a custom-named SSH key. To do so, type the default file location and replace id_ssh_keyname with your custom key name.

Your public key will end up in .ssh/id_ed25519.pub. You will need the contents of this file when you make a VM.

If you want to use the ssh-agent or want further details please visit this site.

Windows​

Windows 10 (build 1809) and later ship with OpenSSH, so you can use the same ssh-keygen command from PowerShell or Command Prompt.

  1. Open PowerShell or Command Prompt.
  2. Run:
ssh-keygen -t ed25519
  1. When prompted for "Enter a file in which to save the key", press Enter to accept the default location (C:\Users\<your-username>\.ssh\id_ed25519). If a key already exists at that path, either overwrite it or specify a custom file name.
  2. Optionally enter a passphrase, or press Enter twice to skip.

Your public key will be saved at C:\Users\<your-username>\.ssh\id_ed25519.pub. You can print its contents with:

type $env:USERPROFILE\.ssh\id_ed25519.pub

You will need the contents of this file when you make a VM.

If your version of Windows does not include OpenSSH, install it from Settings → Apps → Optional features → Add a feature → OpenSSH Client, or use PuTTYgen as an alternative.