How to use SSH keys

Connect to an instance using an SSH key

You must provide an SSH key when you create a GPU instance with FluidStack. Once the instance is running, that SSH key is used to authenticate for remote command-line access to the instance.

Generate a public/private key pair

Note

We support OpenSSH public key formats:

  • ssh-rsa
  • ssh-dss (DSA)
  • ssh-ed25519
  • ecdsa keys with NIST curves (ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521)

If you already have a public/private key pair of a supported format, you can use that pair instead of generating a new one.

Follow the steps below to generate a key pair with a command-line tool called ssh-keygen. This tool is pre-installed on nearly all operating systems.

Use any supported format for your key pair. The tabs below contain instructions for generating a key pair with either the RSA algorithm or ECDSA algorithm.

1

Generate the key pair

Enter the following command in your CLI shell:

$ssh-keygen

If prompted to enter a filename, press Enter to save the key pair to the default location (~/.ssh/). When prompted to enter a passphrase, you can optionally do so to increase security.


2

Confirm that your key pair was created

Enter the following command to confirm that your key pair was created:

$ls ~/.ssh

In the output, you should see id_rsa (the file that contains your private key) and id_rsa.pub (the file that contains your public key).


3

View your public key

Open the id_rsa.pub file in a plaintext editor, or enter the command below to output it to your terminal:

$cat ~/.ssh/id_rsa.pub
Warning

With any public/private key pair that you generate, your public key can be shared freely. Your private key should be just that—private! Take care not to share it with others, or in public repositories such as in GitHub.

Add an SSH key

Use your public key to add an SSH key to your FluidStack account. If you don’t have a public key, see: Generate a public/private key pair.

Tip
In this context, ‘adding an SSH key’ means ‘storing a copy of your public key on your FluidStack account.’ The stored SSH key is identical to your public key.

View existing SSH keys

Delete an SSH key

Warning

Deleting an SSH key removes the ability to authenticate to instances with that key.

Connect to an instance with an SSH key

Use your private key to authenticate when connecting to a running instance via SSH. The instance has an SSH key associated with it, provided when that instance was created. The private key must correspond to that SSH key.

Connect to your instance with SSH
$ssh -i <path_to_your_private_key> <username>@<ip_address>

Examples:

$ssh -i ~/.ssh/id_rsa ubuntu@192.0.2.0