Skip to main content

SSH Keys

SSH (Secure Shell) keys are an access credential that is used in the SSH protocol used to login remotely from one system into another. Essentially, SSH keys are an authentication method used to gain access to an encrypted connection between your computer and our remote instances.

Generating a new SSH Key.

There are serveral public key algorithms for authentication keys. You can research which is best for you but we would recommend using either rsa or ed25519. Comparing SSH algorithms

Generating a new SSH Key

  1. Open your terminal on your computer
  2. ssh-keygen -t ALGORITHM -C "your_email@example.com"
    This creates a new SSH key, using the provided email as a label.
    > Generating public/private ALGORITHM key pair.
    When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
    > Enter file in which to save the key (/c/Users/you/.ssh/ALGORITHM):
  3. You will then be prompted to enter a passphrase. This is optional but recommended.
    > Enter passphrase (empty for no passphrase): [Type a passphrase]
    > Enter same passphrase again: [Type passphrase again]

Adding your SSH key to the ssh-agent

  1. In a new admin PowerShell window, make sure the ssh-agent is running.
    > Get-Service -Name ssh-agent | Set-Service -StartupType 'Manual'
    > Start-Service ssh-agent
  2. Add your SSH private key to the ssh-agent.
    > ssh-add c:/Users/YOU.ssh/ALGORITHM

Adding your SSH key to Massed Compute Account

  1. Open your terminal on your computer
  2. clip < ~/.ssh/ALGORITHM.pub
    This copies the contents of the id_ed25519.pub file to your clipboard.
    If you chose a different algorithm or file name, replace id_ed25519 in the command with the name of your private key file.
  3. Log in to your Massed Compute Account
  4. On the left menu click on Settings then select SSH Keys from the secondary navigation.
  5. Click on Add Key in the SSH Keys section.
  6. Provide a common name and paste the contents of the clipboard into the SSH Key field.

Adding your SSH Key to the instance on deployment

  1. When you deploy an instance you can select one or multiple SSH keys you want to associate with the instance.
  1. Once the Instance is Running you can then SSH into the instance using the SSH key you provided.
    ssh -i ~/.ssh/ALGORITHM Ubuntu@VM_IP
    Again, if you used a different algorithm or file name, replace id_ed25519 in the command with the name of your private key file.

To terminate your session you can type exit and hit enter in the terminal or Ctrl + D on your keyboard.

Mascot