Free · Private · Client-side
SSH Key Generation
SSH keys should always be generated locally on your machine. This page provides guidance and terminal commands for secure key generation — it intentionally generates nothing in the browser.
Generated values never leave this device.Ed25519 (recommended)
Ed25519 is a modern, secure algorithm. It's faster and has smaller keys than RSA while providing equivalent security.
Generate Ed25519 key pair
ssh-keygen -t ed25519 -C "[email protected]"With custom filename
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_ed25519_githubWithout passphrase (not recommended)
ssh-keygen -t ed25519 -C "[email protected]" -N ""RSA (legacy compatibility)
Use RSA if you need compatibility with older systems. Always use at least 4096 bits.
Generate RSA 4096-bit key pair
ssh-keygen -t rsa -b 4096 -C "[email protected]"With stronger key derivation
ssh-keygen -t rsa -b 4096 -o -a 100 -C "[email protected]"View & copy public key
View Ed25519 public key
cat ~/.ssh/id_ed25519.pubView RSA public key
cat ~/.ssh/id_rsa.pubCopy to clipboard (macOS)
pbcopy < ~/.ssh/id_ed25519.pubCopy to clipboard (Linux)
xclip -sel clip < ~/.ssh/id_ed25519.pubExample output
Your public key will look similar to this (this is an example, not a real key):
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl [email protected]Add to SSH agent
Start SSH agent
eval $(ssh-agent -s)Add key to agent
ssh-add ~/.ssh/id_ed25519Add to macOS Keychain
ssh-add --apple-use-keychain ~/.ssh/id_ed25519SSH key best practices
- Always use a strong passphrase to protect your private key
- Use Ed25519 for new keys unless legacy compatibility is required
- Keep your private key permissions at 600 (
chmod 600 ~/.ssh/id_ed25519) - Use different keys for different services when possible
- Rotate keys periodically and remove unused public keys from servers
- Never share your private key or store it in version control
SSH config example
# GitHub
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_github
AddKeysToAgent yes
# Work server
Host work
HostName server.company.com
User deploy
IdentityFile ~/.ssh/id_ed25519_work
Port 22