Cloudtop Home

SSH Keys

Updated March 25, 2025

SSH keys provide secure access to your instances without using passwords. They are essential for secure remote management of your cloud resources.

Understanding SSH Keys

What are SSH Keys?

  • Public/private key pair
  • Public key: Stored on the server
  • Private key: Kept secure on your local machine
  • Used for secure authentication

Key Types

  1. RSA Keys

    • Traditional and widely supported
    • Recommended size: 4096 bits
    • Example: ssh-keygen -t rsa -b 4096
  2. Ed25519 Keys

    • Modern and more secure
    • Shorter key length
    • Example: ssh-keygen -t ed25519

Features

Secure Authentication

  • No password required
  • Resistant to brute force attacks
  • Supports key rotation
# Example: SSH connection
ssh -i ~/.ssh/my_key.pem ubuntu@instance-ip

Multiple Key Support

  • Different keys for different purposes
  • Project-specific keys
  • Role-based access
# Example: Using multiple keys
ssh -i ~/.ssh/project1_key.pem ubuntu@project1-server
ssh -i ~/.ssh/project2_key.pem ubuntu@project2-server

Key Management

  • Easy addition and removal
  • Key naming and organization
  • Instance association
# Example: Adding a key to Cloudtop
Name: project1-key
Type: RSA 4096
Purpose: Production server access

Key Management

Generating Keys

  1. Using ssh-keygen

    # Generate RSA key
    ssh-keygen -t rsa -b 4096 -f ~/.ssh/my_key
    
    # Generate Ed25519 key
    ssh-keygen -t ed25519 -f ~/.ssh/my_key
    
  2. Key File Permissions

    # Set correct permissions
    chmod 600 ~/.ssh/my_key
    chmod 644 ~/.ssh/my_key.pub
    

Adding Keys to Cloudtop

  1. Generate key pair
  2. Copy public key
  3. Add to Cloudtop dashboard
  4. Associate with instances

Managing Keys

  • View all keys
  • Update key names
  • Remove unused keys
  • Associate with instances

Best Practices

Key Generation

  1. Strong Keys

    • Tip: Use 4096-bit RSA or Ed25519
    • Warning: Weak keys are vulnerable
  2. Unique Keys

    • Tip: One key per purpose
    • Warning: Reusing keys increases risk

Key Storage

  1. Local Security

    • Tip: Use SSH agent
    • Warning: Unencrypted keys are vulnerable
  2. Backup Strategy

    • Tip: Secure backup of private keys
    • Warning: Lost keys mean lost access

Key Rotation

  1. Regular Updates

    • Tip: Rotate keys every 90 days
    • Warning: Old keys may be compromised
  2. Emergency Rotation

    • Tip: Have backup keys ready
    • Warning: No access during rotation

Security Tips

Key Protection

  • Use SSH agent
  • Set correct permissions
  • Encrypt private keys
  • Use key passphrases

Access Control

  • Limit key usage
  • Monitor access patterns
  • Implement key expiration
  • Use role-based access

Monitoring

  • Track key usage
  • Review access logs
  • Set up alerts
  • Regular audits

Common Issues and Solutions

Connection Problems

  1. Permission Issues

    # Fix permissions
    chmod 600 ~/.ssh/my_key
    chmod 644 ~/.ssh/my_key.pub
    
  2. Key Format

    # Convert key format
    ssh-keygen -p -f ~/.ssh/my_key
    

Key Management Issues

  1. Lost Keys

    • Tip: Keep secure backups
    • Warning: Recovery may require support
  2. Compromised Keys

    • Tip: Immediate rotation
    • Warning: Previous access may be logged

Getting Help

Resources

  • Documentation: Detailed guides
  • Support: Technical assistance
  • Community: User forums
  • Security Team: Security concerns

Contact Information