SSH Key Management

    Secure passwordless authentication for your cloud instances

    Overview

    SSH keys provide a more secure authentication method than passwords. They allow passwordless login to your instances while being much harder to compromise than traditional passwords.

    Why Use SSH Keys?

    Security

    More secure than passwords, immune to brute force attacks

    Convenience

    No need to remember or type passwords

    Automation

    Enable automated deployments and scripts

    Key Management

    Easy to rotate and revoke access

    Generating SSH Keys

    On Linux/Mac

    Open a terminal and run:

    ssh-keygen -t ed25519 -C "your_email@example.com"

    For older systems that don't support Ed25519:

    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

    Follow the prompts to save the key (default location is fine) and optionally set a passphrase for extra security.

    On Windows

    Windows 10/11: Use PowerShell or Windows Terminal:

    ssh-keygen -t ed25519 -C "your_email@example.com"

    Older Windows: Use PuTTYgen to generate keys.

    Adding SSH Keys to Control Panel

    Step 1: Copy Your Public Key

    # Linux/Mac
    cat ~/.ssh/id_ed25519.pub
    
    # Windows (PowerShell)
    Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub

    Step 2: Import to Cloud Panel

    1. Log into the Cloud Control Panel
    2. Go to Compute → Key Pairs
    3. Click Import Public Key
    4. Give your key a name
    5. Paste your public key into the text field
    6. Click Import Public Key

    Using SSH Keys When Creating Instances

    When launching a new instance:

    1. Complete the instance details (name, flavor, image)
    2. In the Key Pair section, select your imported key
    3. Launch the instance

    The selected SSH key will be automatically added to the instance, allowing you to log in without a password.

    Connecting with SSH Keys

    Once your key is configured, connect to your instance:

    ssh root@your-instance-ip

    Or for distributions that use a different default user:

    # Ubuntu
    ssh ubuntu@your-instance-ip
    
    # Debian
    ssh debian@your-instance-ip
    
    # CentOS/Rocky/Alma
    ssh centos@your-instance-ip

    Adding Keys to Existing Instances

    To add an SSH key to an existing instance:

    mkdir -p ~/.ssh
    chmod 700 ~/.ssh
    nano ~/.ssh/authorized_keys

    Paste your public key on a new line, then save and set permissions:

    chmod 600 ~/.ssh/authorized_keys

    Troubleshooting

    Permission Denied

    If you get "Permission denied", check:

    • Correct username for your OS (root, ubuntu, debian, etc.)
    • SSH key file permissions are correct (600 for private key)
    • Using the correct private key file
    • Public key is properly added to authorized_keys

    Specifying a Key File

    If your key is not in the default location:

    ssh -i /path/to/private_key user@instance-ip

    Best Practice

    Always use SSH keys instead of passwords for cloud instances. They provide better security and are essential for automation. Consider using a passphrase on your private key for an additional layer of security.