Keypairs
SSH keypairs are used to securely access compute instances.
A keypair has two parts:
- Public key, uploaded to redu.cloud
- Private key, kept on your machine
Never upload or share your private key.
With an agent (MCP)
Connect the redu MCP, then just ask your agent. Your agent can run ssh-keygen locally if you do not already have a key, then call import_keypair to register the public key on redu. It can also list_keypairs to check what exists and delete_keypair to remove old ones.
Set up an SSH key for me if I do not have one, and register it on redu.1. Generate an SSH key
If you already have an SSH keypair, you can reuse it. Otherwise, generate a new one.
Linux / macOS
ssh-keygen -t ed25519 -C "you@example.com"Windows PowerShell
ssh-keygen -t ed25519 -C "you@example.com"Your public key file usually ends with .pub.
Example:
~/.ssh/id_ed25519.pub2. Add an SSH key
Go to:
Menu → Compute → Virtual Machines → SSH Keypairs
Click Add SSH key, then choose one of these modes:
| Mode | Use it when | Required input |
|---|---|---|
| Import public key | You already control the matching private key | SSH key name and the complete public key |
| Generate Keypair | You need a new keypair | SSH key name |
When importing a key, paste only the single-line public key. Public keys usually start with ssh-ed25519, ssh-rsa, or ecdsa-sha2-. Never paste a private key into the console.
When generating a keypair, redu creates an RSA key and shows the private .pem file once. Download or copy it before closing the window; it cannot be retrieved later.
The SSH keys list shows the name, fingerprint, key type, creation date, and available actions. Only public-key registrations are stored there.
Keep private keys outside the repository and restrict their filesystem permissions. Anyone with the private key may be able to access instances launched with its public key.
3. Use a keypair when creating an instance
When creating an instance:
- Enable SSH access
- Select your keypair
- Launch the instance
After the instance is ready, use the SSH command shown in the UI.
Example:
ssh -p <port> ubuntu@<host>You can copy the command from:
Compute → Virtual Machines → Actions → Copy SSH
The command uses the correct public host, mapped port, and image username. If Copy SSH is unavailable, wait until the instance is active and confirm that it has a public DNS entry.
If your private key has a passphrase, SSH will ask for it.
4. Import via API or MCP
You can also manage keypairs programmatically.
REST API
# Import a keypair
curl -X POST https://api.redu.cloud/v1/keypairs \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-keypair",
"publicKey": "ssh-ed25519 AAAA..."
}'
# List keypairs
curl https://api.redu.cloud/v1/keypairs \
-H "x-api-key: YOUR_API_KEY"
# Delete a keypair
curl -X DELETE https://api.redu.cloud/v1/keypairs/my-keypair \
-H "x-api-key: YOUR_API_KEY"MCP (Claude Code)
With the redu.cloud MCP server connected, ask Claude:
Import my SSH key, here it is: ssh-ed25519 AAAA...your agent will call import_keypair and confirm the name. You can then create instances immediately:
Create a medium Ubuntu instance using that keypair.This is the recommended flow for AI-driven deployments. The check_agent_prerequisites tool will remind you to import a keypair if none are found.
5. Delete a keypair (UI)
Only delete keypairs that are no longer needed.
Go to:
Menu → Compute → Virtual Machines → SSH Keypairs
Then:
- Open Actions for the SSH key
- Choose Delete SSH key
- Confirm the deletion
Deleting the registration prevents it from being selected for future launches. It does not remove the key from instances that were already created, so make sure those instances have another access path before deleting it.
Troubleshooting
Permission denied publickey
Check that:
- You selected the correct keypair when creating the instance
- You are using the correct username for the image, such as
ubuntu - Your security group allows SSH on port
22 - Your private key permissions are correct
chmod 600 ~/.ssh/id_ed25519Invalid public key format
The public key must be a single line starting with ssh-ed25519 or ssh-rsa.
Lost private key
Private keys cannot be recovered from redu.cloud.
Generate a new keypair and use it for new instances.