SSH Key Generator (RSA & ED25519)
Generate SSH key pairs for secure server authentication and development testing
Our SSH Key Generator creates cryptographically secure SSH key pairs for server authentication and secure remote access. Generate RSA keys (2048/4096-bit) or modern Ed25519 keys for passwordless SSH login, Git authentication, and automated deployments. All keys use CSPRNG (Cryptographically Secure Pseudo-Random Number Generation) for maximum security. Perfect for DevOps engineers, system administrators, developers, and anyone managing remote servers. Generate public-private key pairs instantly with optional passphrases and comments. No signup required, completely free.
Related Random Generators
Generate AES, RSA, and ChaCha20 encryption keys for data encryption.
Generate strong random passwords with customizable character sets and length.
Create API keys in multiple formats for application authentication.
Generate memorable word-based passphrases for SSH key encryption.
What is an SSH Key?
An SSH key is a cryptographic credential used for secure, passwordless authentication to remote servers. SSH keys consist of two parts: a public key (placed on servers you want to access) and a private key (kept secret on your local machine). When you connect to a server, SSH uses public-key cryptography to verify your identity without transmitting passwords over the network. This makes SSH keys more secure than password authentication and enables automated, scriptable server access.
RSA (Rivest-Shamir-Adleman) is the traditional SSH key algorithm, supporting 2048-bit and 4096-bit key sizes. RSA-2048 is widely compatible and adequate for most uses, while RSA-4096 provides maximum security for long-term keys. Ed25519 (Edwards-curve Digital Signature Algorithm) is a modern alternative offering equivalent security to RSA-4096 with much smaller key sizes (256-bit), faster performance, and resistance to side-channel attacks. Ed25519 is recommended for new installations and is supported by OpenSSH 6.5+ (2014).
SSH keys are essential for DevOps workflows, enabling automated deployments, CI/CD pipelines, Git operations, and server management. System administrators use SSH keys for managing multiple servers without password prompts. Developers use them for GitHub/GitLab authentication, remote development environments, and deploying to production servers. Organizations use SSH keys with certificate authorities for centralized access control and audit trails.
SSH Key Configuration Options
Key Type (RSA vs Ed25519)
Key Size (RSA only)
Optional Passphrase
Key Comment
Output Format
How to Generate and Use SSH Keys
[STEP 1] Choose Key Type and Size
Select Ed25519 for new installations (modern, fast, secure). Use RSA-2048 for compatibility or RSA-4096 for maximum security. Consider your target servers' OpenSSH versions (Ed25519 requires 6.5+).
[STEP 1] Add Optional Passphrase
Add a passphrase to encrypt your private key (recommended for production keys and laptops). Leave empty for automated deployments. Use a strong passphrase or generate one with our passphrase generator.
[STEP 1] Generate and Save Keys
Click generate and save both public and private keys. Private key must be kept secret (chmod 600 on Unix systems). Public key can be shared freely and is what you place on servers.
[STEP 1] Install Public Key on Server
Copy your public key to server's ~/.ssh/authorized_keys file. Use ssh-copy-id command or manually append:
cat your_key.pub >> ~/.ssh/authorized_keys
. Ensure correct permissions (chmod 700 ~/.ssh, chmod 600 authorized_keys).
[STEP 1] Configure SSH Client
Save private key to ~/.ssh/ directory (e.g., ~/.ssh/id_ed25519 or ~/.ssh/id_rsa). Set correct permissions (chmod 600). Configure ~/.ssh/config for convenience: specify Host, HostName, User, and IdentityFile path.
SSH Key Security Best Practices
- _ Use Ed25519 for new keys: Modern, secure, fast, and resistant to side-channel attacks
- _ Protect private keys: Never share private keys, use chmod 600 on Unix, store in secure locations
- _ Use passphrases for sensitive keys: Encrypt private keys with strong passphrases, especially for production access
- _ Use separate keys per purpose: Different keys for GitHub, production servers, development, and CI/CD
- _ Rotate keys regularly: Replace keys annually or after employee departures, remove old keys from authorized_keys
- _ Add comments to keys: Include email or identifier in key comments for easy identification and key management
- _ Disable password authentication: Once SSH keys are set up, disable password auth in sshd_config
- _ Use SSH agent: Use ssh-agent for passphrase caching, avoid storing passphrases in scripts
- _ Audit authorized_keys files: Regularly review and remove unused or unknown keys from servers
- _ Consider SSH certificates: For large organizations, use SSH certificate authorities for centralized key management
Technical Details: SSH Key Generation
SSH key generation uses cryptographically secure random number generation (CSPRNG) to produce public-private key pairs. Our generator simulates the key generation process used by OpenSSH's ssh-keygen utility:
// SSH Key Generation Process Input: key_type (RSA/Ed25519), key_size (2048/4096), passphrase, comment For Ed25519: 1. Generate 32 bytes of random seed using CSPRNG 2. Derive Ed25519 private key from seed 3. Compute Ed25519 public key from private key 4. Format keys in OpenSSH format 5. If passphrase provided, encrypt private key For RSA: 1. Generate two large random prime numbers (p, q) using CSPRNG 2. Compute modulus n = p × q 3. Compute public exponent e = 65537 (standard) 4. Compute private exponent d = e^-1 mod φ(n) 5. Format keys in OpenSSH or PEM format 6. If passphrase provided, encrypt private key Key Formats: - OpenSSH: -----BEGIN OPENSSH PRIVATE KEY----- - PEM: -----BEGIN RSA PRIVATE KEY----- - Public: ssh-rsa AAAA... or ssh-ed25519 AAAA... Security Properties: - Ed25519: 128-bit security level (2^128 operations to break) - RSA-2048: ~112-bit security level - RSA-4096: ~128-bit security level - All use CSPRNG for maximum randomness Note: This is a simulated generator for development/testing. For production servers, generate keys locally with ssh-keygen.
API Access for Developers
Frequently Asked Questions
Should I use RSA or Ed25519 for SSH keys? ▶
Should I use a passphrase for my SSH key? ▶
What's the difference between public and private keys? ▶
How do I install my SSH public key on a server? ▶
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
. Manually, you can append your public key to the server's ~/.ssh/authorized_keys file: cat your_key.pub | ssh user@server 'cat >> ~/.ssh/authorized_keys'
. Ensure correct permissions on the server: chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys.
Can I use the same SSH key for multiple servers? ▶
Are these keys safe for production use? ▶
ssh-keygen -t ed25519 -C "your_email@example.com"
or ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
.