SSH Keys
Upload and manage SSH keys for secure, passwordless access to your instances.
SSH Keys
SSH keys provide secure, passwordless authentication to your cloud instances. Instead of typing a password every time you connect, your SSH key pair handles authentication automatically — it is both more secure and more convenient.
Why Use SSH Keys
| Feature | Password Auth | SSH Key Auth |
|---|---|---|
| Security | Vulnerable to brute-force attacks | Virtually impossible to brute-force |
| Convenience | Type password every time | Automatic authentication |
| Automation | Hard to use in scripts | Works seamlessly in scripts and CI/CD |
| Multi-user | Shared passwords are risky | Each user has their own key |
Password authentication is disabled by default on most instance images. SSH keys are the recommended and default method for instance access.
Supported Formats
| Format | Algorithm | Recommended |
|---|---|---|
ssh-ed25519 | Ed25519 | Yes — fastest, most secure |
ssh-rsa | RSA (2048+ bit) | Yes — widest compatibility |
ecdsa-sha2-nistp256 | ECDSA (P-256) | Supported |
ecdsa-sha2-nistp384 | ECDSA (P-384) | Supported |
ecdsa-sha2-nistp521 | ECDSA (P-521) | Supported |
We recommend ed25519 keys for new setups. They are shorter, faster, and considered more secure than RSA. Use RSA if you need compatibility with older systems.
Generating an SSH Key
If you do not already have an SSH key, generate one on your local machine.
Ed25519 (Recommended)
ssh-keygen -t ed25519 -C "your-email@example.com"RSA (Compatibility)
ssh-keygen -t rsa -b 4096 -C "your-email@example.com"When prompted:
- File location — Press Enter to accept the default (
~/.ssh/id_ed25519or~/.ssh/id_rsa) - Passphrase — Enter a passphrase for additional security (recommended) or press Enter for no passphrase
This creates two files:
| File | Purpose |
|---|---|
~/.ssh/id_ed25519 | Private key — never share this |
~/.ssh/id_ed25519.pub | Public key — upload this to HUC |
Viewing Your Public Key
cat ~/.ssh/id_ed25519.pubOutput looks like:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... your-email@example.comNever share your private key. Only the .pub (public key) file should be uploaded to HUC or shared with anyone.
Uploading a Key to HUC
- Navigate to your cloud dashboard → SSH Keys
- Click Add SSH Key
- Paste the contents of your public key file (
~/.ssh/id_ed25519.pub) - Give the key a recognizable name (e.g.,
work-laptop,ci-deploy) - Click Save
Your key is now available for selection when creating new instances.
Selecting Keys During Instance Creation
When creating a new cloud instance:
- In the Authentication section, select one or more SSH keys from your uploaded keys
- The selected keys are injected into the instance's
~/.ssh/authorized_keysfile on first boot - You can select multiple keys to grant access to several users or machines
You can select multiple SSH keys during instance creation. All selected keys will be added to the root user's authorized_keys file, allowing multiple people or machines to access the instance.
Connecting to Your Instance
Once your instance is running with your SSH key configured:
# Connect as root (default)
ssh root@your-instance-ip
# Connect with a specific key file
ssh -i ~/.ssh/id_ed25519 root@your-instance-ipIf you set a passphrase on your key, you will be prompted to enter it. Use ssh-agent to avoid entering it repeatedly:
# Start the SSH agent
eval "$(ssh-agent -s)"
# Add your key to the agent
ssh-add ~/.ssh/id_ed25519Managing SSH Keys
Viewing Your Keys
Navigate to the cloud dashboard → SSH Keys to see all uploaded keys with their:
- Name
- Fingerprint
- Date added
Deleting a Key
- Navigate to SSH Keys
- Click Delete on the key you want to remove
- Confirm the deletion
Deleting an SSH key from the dashboard does not remove it from existing instances. It only prevents the key from being selected for future instance creation. To revoke access on an existing instance, remove the key from ~/.ssh/authorized_keys manually.
Adding Keys to Existing Instances
If you need to add an SSH key to an instance that is already running:
# From a machine that already has access
ssh root@your-instance-ip
# Add the new public key
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... user@machine" >> ~/.ssh/authorized_keysOr copy it directly from your local machine:
ssh-copy-id -i ~/.ssh/id_ed25519.pub root@your-instance-ipBest Practices
- Use Ed25519 keys — Shorter, faster, and more secure than RSA.
- Set a passphrase — Protects your private key if your machine is compromised.
- Use ssh-agent — Avoid typing your passphrase repeatedly.
- One key per machine — Generate a unique key for each device. If a device is lost, revoke only that key.
- Name keys descriptively — Use names like
work-macbook,ci-server, orhome-desktopso you can identify them later. - Audit regularly — Review your uploaded keys and remove any that are no longer in use.
- Never share private keys — If multiple people need access, each person should upload their own public key.
Troubleshooting
Permission Denied (publickey)
ssh -v root@your-instance-ipCommon causes:
- Wrong key — Ensure the correct public key was selected during instance creation
- File permissions — Private key must be readable only by you:
chmod 600 ~/.ssh/id_ed25519 - SSH agent — If using an agent, verify the key is loaded:
ssh-add -l
Fix Permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pubNext Steps
- Deploy a Cloud Compute instance with your SSH key
- Configure Networking with firewalls to restrict SSH access
- Review Images & Templates for available operating systems
- Learn about Security & Compliance for data protection