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.
RSA
ECDSA with NIST curves
Generate the key pair
Enter the following command in your CLI shell:
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.
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.Use the FluidStack Dashboard
Open the FluidStack Dashboard.
- From the left sidebar of the Dashboard, select SSH Keys.
- Click the Add SSH key button in the upper-right corner. A dialog will appear.
- In the dialog’s Name field, input a unique name for this SSH key.
- Paste your public key in the field labeled Public SSH key.
- Click Confirm.
Use the FluidStack API
Add an SSH key by using the Add an SSH key endpoint.
Tip
Make sure to replace the<api-key>
value with your API key, the <public-key>
value with your public key, and the name
of my_ssh_key
with the unique SSH key name you’d like to use.If your POST request is successful, the endpoint responds with a JSON object that echoes the name
and public_key
that you sent:
View existing SSH keys
Use the FluidStack Dashboard
Open the FluidStack Dashboard.
From the left sidebar of the Dashboard, select SSH Keys.
Use the FluidStack API
View SSH keys that have been added to your FluidStack account by using the List SSH keys endpoint:
If your GET request is successful, the endpoint responds with a JSON array of objects. Each object in the JSON array represents an SSH key, including its name
and public_key
:
Delete an SSH key
Warning
Deleting an SSH key removes the ability to authenticate to instances with that key.
Use the FluidStack Dashboard
Open the FluidStack Dashboard.
- From the left sidebar of the Dashboard, select SSH Keys.
- Click the red
delete
button next to the SSH key you want to delete.
Use the FluidStack API
Delete an SSH key by using the Delete an SSH key endpoint. Replace the text {ssh_key_name}
with the name of the key you want to delete:
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.
Examples: