Free SSH Key Generator

An SSH key generator creates the public and private key pair you use to log in to servers and Git hosts without a password. Build the exact ssh-keygen command for your computer, or generate an Ed25519 or RSA key pair right here in your browser, then follow the steps to add it to GitHub, GitLab, a server, or ssh-agent.

1. Choose your key

Key type
Your computer

2. Recommended: run ssh-keygen

The safest key is one created on the computer that will use it. Paste this into Terminal; ssh-keygen asks for a passphrase, and the private key never leaves your machine.

ssh-keygen command
ssh-keygen -t ed25519 -C "you@example.com" -f ~/.ssh/id_ed25519

Or generate the key pair in this browser

Keys are created with your browser's built-in Web Crypto API. Nothing is uploaded, logged, or stored, and it works offline once the page has loaded.

3. Add your public key

Commands for macOS. Only the .pub file is ever shared.

GitHub or GitLab

Copy the public key
pbcopy < ~/.ssh/id_ed25519.pub
  1. GitHub: Settings, SSH and GPG keys, New SSH key. GitLab: Preferences, SSH Keys, Add new key.
  2. Paste the key, give it a title, and save.
  3. Test it with ssh -T git@github.com or ssh -T git@gitlab.com.

A server or VPS

Install the key on the server
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server

This appends the key to ~/.ssh/authorized_keys. Then log in with ssh -i ~/.ssh/id_ed25519 user@server.

ssh-agent, so you type the passphrase once

Load the key into ssh-agent
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Default choice

Ed25519

256-bit elliptic curve key. Short public key, fast, and supported by OpenSSH 6.5+, GitHub, GitLab, and current cloud hosts.

Compatibility

RSA 4096

Use for older servers, appliances, or tools that reject Ed25519. 3072 bits is the OpenSSH default; 4096 adds margin.

Deprecated

Avoid DSA and RSA under 2048

OpenSSH has removed DSA, and short RSA keys are rejected by modern servers and Git hosts.

SSH key generator FAQ

How do I generate an SSH key?

Open Terminal on macOS or Linux, or PowerShell on Windows 10 and 11, and run ssh-keygen -t ed25519 -C "you@example.com". Press Enter to accept the default file, then type a passphrase. ssh-keygen saves the private key as ~/.ssh/id_ed25519 and the public key as ~/.ssh/id_ed25519.pub.

Should I use Ed25519 or RSA?

Use Ed25519 unless a system you connect to does not support it. Ed25519 keys are shorter, faster, and secure by default. Choose RSA with 3072 or 4096 bits only for older servers, network appliances, or tools that reject Ed25519.

Is it safe to generate an SSH key online?

Generating a key on the computer that will use it with ssh-keygen is the safest option. This page's browser generator runs entirely in your browser with the Web Crypto API and never uploads the key, but anything shown on a web page is easier to leak, so prefer the ssh-keygen command for production servers and add a passphrase to any key you download.

Which SSH key do I share, public or private?

Share only the public key, the file ending in .pub. Paste it into GitHub, GitLab, or a server's authorized_keys file. The private key stays on your computer with permissions of 600 and should never be emailed, pasted into chat, or committed to Git.

Where are SSH keys stored?

By default ssh-keygen stores keys in the .ssh folder of your home directory: ~/.ssh on macOS and Linux, and C:\Users\<you>\.ssh on Windows. List them with ls ~/.ssh, and look for pairs such as id_ed25519 and id_ed25519.pub.

Related free tools

Rather skip servers and SSH entirely?

NitroClaw deploys and manages a dedicated OpenClaw AI assistant in minutes, with no SSH keys or config files.

Explore NitroClaw