On this page
SSH keypairs
SSH keypairs let you log in to Linux instances securely without a password. Add your public key once, then select it whenever you create an instance.
An SSH keypair has two halves: a public key that Patrii Cloud injects into new instances, and a private key that stays on your machine and proves your identity when you connect. Only the public half is ever stored on the platform.
You can import a public key you already use, or have Patrii Cloud generate a fresh pair for you, in which case you download the private key once, because it is not kept for you. Each keypair is identified by a name and a fingerprint.
Key concepts
Public key — The half injected into instances; safe to share and store.
Private key — The secret half you keep; it proves your identity at login.
Fingerprint — A short hash that uniquely identifies a keypair.
Import — Register a public key you already have.
Generate — Have the platform create a new pair and hand you the private key once.
Before you start
- An SSH key on your machine, or the willingness to generate one.
- A terminal with an SSH client to connect afterward.
Step by step
- Open Keypairs
Go to Compute > Keypairs to see the keys in your project.
Screenshot — The Keypairs listThe Keypairs list - Import or generate
- Choose Import to paste an existing public key and give it a name, or
- Choose Create to generate a brand-new pair.
Screenshot — The import dialog with the name and public-key fieldsThe import dialog with the name and public-key fields - Save the private key
If you generated a pair, download the private key now and store it safely; it is shown only once.
- Use it at launch
Select the keypair when you create an instance so its public key is injected at boot.
- Connect
Connect over SSH using the matching private key.
Examples
ssh-keygen -t ed25519 -f ~/.ssh/patrii-key # paste the contents of ~/.ssh/patrii-key.pub when importing
patrii keypair import my-key \ --public-key ~/.ssh/patrii-key.pub
resource "patrii_keypair" "deploy" {
name = "my-key"
public_key = file("~/.ssh/patrii-key.pub")
}ssh -i ~/.ssh/patrii-key ubuntu@<floating-ip>
Limits & specifications
What you can do with keypairs:
| Action | What it does |
|---|---|
Import | Register an existing public key by name. |
Create | Generate a new pair and download the private key once. |
Copy public key | Copy the stored public key to reuse elsewhere. |
Delete | Remove a keypair; existing instances keep the key already injected. |
Best practices
- Prefer importing a key you generated locally, so the private key never leaves your machine.
- Use a modern key type such as ed25519.
- Protect your private key with a passphrase and correct file permissions.
- Use distinct keypairs per person or purpose so you can revoke one without affecting others.
FAQ
I lost the private key I generated in the console.
If I delete a keypair, am I locked out of my server?
Can I use one keypair for many instances?
Learn more
Everything you can do here in the console is also available through the Patrii Cloud API for automation and scripting.