Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.
# Generate ED25519 key with comment
ssh-keygen -t ed25519 -C "[email protected]"
# Generate with custom filename
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_work -C "[email protected]"
# Generate with passphrase (recommended)
ssh-keygen -t ed25519 -C "[email protected]" -N "your-passphrase"
# Display public key
cat ~/.ssh/id_ed25519.pub
# Display fingerprint
ssh-keygen -lf ~/.ssh/id_ed25519.pub
# Output: 256 SHA256:ABC123... [email protected] (ED25519)
# Generate RSA 4096-bit key (recommended size)
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Generate RSA 2048-bit key (minimum acceptable)
ssh-keygen -t rsa -b 2048 -C "[email protected]"
# Extract public key from private key
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
# Convert to PEM format (for use with openssl)
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
# Display key fingerprint
ssh-keygen -lf ~/.ssh/id_rsa.pub
# Output: 4096 SHA256:XYZ789... [email protected] (RSA)
# Extract public key using openssl
openssl rsa -in ~/.ssh/id_rsa -pubout -out public_key.pem
# Generate ECDSA P-521 key (highest security)
ssh-keygen -t ecdsa -b 521 -C "[email protected]"
# Generate ECDSA P-384 key
ssh-keygen -t ecdsa -b 384 -C "[email protected]"
# Generate ECDSA P-256 key (most common)
ssh-keygen -t ecdsa -b 256 -C "[email protected]"
# Display fingerprint
ssh-keygen -lf ~/.ssh/id_ecdsa.pub
# Output: 521 SHA256:DEF456... [email protected] (ECDSA)
# Convert OpenSSH private key to PEM format
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
# Convert PEM private key to OpenSSH format
ssh-keygen -p -m RFC4716 -f ~/.ssh/id_rsa.pem
# Extract public key from X.509 certificate
openssl x509 -in cert.pem -noout -pubkey > pubkey.pem
# Convert X.509 public key to SSH format
ssh-keygen -i -m PKCS8 -f pubkey.pem
# Convert SSH public key to PEM format (RSA only)
ssh-keygen -e -m PEM -f ~/.ssh/id_rsa.pub > id_rsa_pub.pem
# Import PEM public key to SSH format
ssh-keygen -i -m PEM -f id_rsa_pub.pem
# Convert PuTTY .ppk to OpenSSH format (Linux/Mac with puttygen)
puttygen key.ppk -O private-openssh -o id_rsa
# Convert OpenSSH to PuTTY .ppk format
puttygen id_rsa -o key.ppk -O private
# Copy public key to remote server (easiest method)
ssh-copy-id user@hostname
# Copy specific key to remote server
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@hostname
# Copy to server running on custom port
ssh-copy-id -i ~/.ssh/id_ed25519.pub -p 2222 user@hostname
# Manual method (if ssh-copy-id not available)
cat ~/.ssh/id_ed25519.pub | ssh user@hostname "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
# Set correct permissions on remote server
ssh user@hostname "chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys"
# Test SSH connection with specific key
ssh -i ~/.ssh/id_ed25519 user@hostname
# Add key to ssh-agent (avoid repeated passphrase entry)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# List keys in ssh-agent
ssh-add -l
# Remove all keys from ssh-agent
ssh-add -D
Essential information about SSH keys, OpenSSH configuration, and secure key management.
# Generate ED25519 key (recommended)
ssh-keygen -t ed25519 -C "[email protected]"
# Generate RSA 4096-bit key
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Generate ECDSA P-256 key
ssh-keygen -t ecdsa -b 256 -C "[email protected]"
# Generate key with custom filename
ssh-keygen -t ed25519 -f ~/.ssh/custom_key
# Generate key with passphrase protection
ssh-keygen -t ed25519 -N "your_passphrase"
# Copy public key to server
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@hostname
# Display key fingerprint
ssh-keygen -lf ~/.ssh/id_ed25519.pub
# Change key passphrase
ssh-keygen -p -f ~/.ssh/id_ed25519
# Convert OpenSSH to PEM format
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
# Test SSH connection
ssh -T [email protected]
# GitHub configuration
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
# Production server
Host prod-server
HostName 192.168.1.100
User admin
Port 22
IdentityFile ~/.ssh/prod_key
ServerAliveInterval 60
ServerAliveCountMax 3
# Jump host / Bastion
Host internal-server
HostName 10.0.0.50
User developer
ProxyJump bastion.example.com
IdentityFile ~/.ssh/id_ed25519
# Global defaults
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
# Start ssh-agent
eval "$(ssh-agent -s)"
# Add key to agent
ssh-add ~/.ssh/id_ed25519
# List loaded keys
ssh-add -l
# Remove all keys from agent
ssh-add -D
# Disable password authentication
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
# Only allow public key authentication
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
# Disable root login
PermitRootLogin no
# Only allow specific users/groups
AllowUsers admin developer
AllowGroups sshusers
# Strong key exchange algorithms (ED25519/RSA)
PubkeyAcceptedKeyTypes ssh-ed25519,rsa-sha2-512,rsa-sha2-256
# Modern ciphers only
Ciphers [email protected],[email protected]
# Modern MACs
MACs [email protected],[email protected]
# Change default port (security through obscurity)
Port 2222
# Limit authentication attempts
MaxAuthTries 3
MaxSessions 5
# Connection timeout settings
ClientAliveInterval 300
ClientAliveCountMax 2
LoginGraceTime 60
# Disable empty passwords
PermitEmptyPasswords no
# Disable X11 forwarding if not needed
X11Forwarding no
# Log more information
LogLevel VERBOSE
# Restrict to IPv4 or IPv6
AddressFamily inet # or inet6
# Apply config and restart
# sudo systemctl restart sshd
sshd -t to test configuration syntax.
| Default SSH port: | 22 |
| Config location (client): | ~/.ssh/config |
| Config location (server): | /etc/ssh/sshd_config |
| Authorized keys: | ~/.ssh/authorized_keys |
| Key permissions: | 600 (private), 644 (public) |
| ~/.ssh directory: | 700 |
| Test config syntax: | sshd -t |
| Reload SSH daemon: | systemctl reload sshd |
| Algorithm | Key Size | Security Level | Performance | Key Size (bytes) | OpenSSH Support | Recommendation |
|---|---|---|---|---|---|---|
| ED25519 | 256-bit (fixed) | 128-bit (≈ RSA 3072) | Excellent | 68 bytes (pub) / 128 bytes (priv) | 6.5+ (2014) | Highly Recommended Best choice for new deployments |
| RSA 4096 | 4096-bit | 140-bit | Moderate | ~800 bytes (pub) / ~3200 bytes (priv) | All versions | Recommended Good for compatibility and long-term security |
| RSA 2048 | 2048-bit | 112-bit | Good | ~400 bytes (pub) / ~1600 bytes (priv) | All versions | Acceptable Minimum acceptable for current use |
| ECDSA P-521 | 521-bit | 256-bit | Very Good | ~170 bytes (pub) / ~350 bytes (priv) | 5.7+ (2011) | Alternative Good, but ED25519 preferred |
| ECDSA P-384 | 384-bit | 192-bit | Very Good | ~120 bytes (pub) / ~240 bytes (priv) | 5.7+ (2011) | Alternative Balanced option |
| ECDSA P-256 | 256-bit | 128-bit | Very Good | ~90 bytes (pub) / ~180 bytes (priv) | 5.7+ (2011) | Alternative Widely supported |
| RSA 1024 | 1024-bit | 80-bit | Fast | ~200 bytes (pub) / ~800 bytes (priv) | All versions | Not Recommended Insufficient security |
| DSA | 1024-bit (max) | 80-bit | Good | ~400 bytes | Disabled 7.0+ (2015) | Deprecated Do not use for new keys |
This SSH key generator is developed and maintained by Anish Nath ( @anish2good), a Security Engineer and Cryptography Expert with extensive experience in network security and cryptographic implementations. The tool has been serving the developer and DevOps community since 2018, with over 892 verified reviews averaging 4.7/5 stars.
Learn more about SSH keys and secure authentication:
Over 500,000 developers use 8gwifi.org tools monthly