An SSH key generator that writes OpenSSH files
SSH keys let you log in to servers and push to Git hosts without typing a password. This ssh key generator creates a new key pair and writes it in the same formats as ssh-keygen: an OPENSSH PRIVATE KEY file and a one-line public key you can paste into GitHub, GitLab, Bitbucket or a server's ~/.ssh/authorized_keys. It is useful on machines where you cannot install OpenSSH, or when you need a throwaway key for a CI job or a test container.
What the output contains
Each run produces three things, labeled with the file names OpenSSH looks for by default:
- The private key, in the
openssh-key-v1format that starts with-----BEGIN OPENSSH PRIVATE KEY-----. It is not passphrase-protected. - The public key line, such as
ssh-ed25519 AAAA… you@laptop: the key type, the Base64 key blob and your comment. - The fingerprint, in the
SHA256:…form thatssh-keygen -lfprints and that GitHub shows in your account settings.
Example
An Ed25519 key with the comment you@laptop (private key shortened):
# ~/.ssh/id_ed25519 (private key — keep secret, chmod 600)
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
…
-----END OPENSSH PRIVATE KEY-----
# ~/.ssh/id_ed25519.pub (public key — add to authorized_keys, GitHub, GitLab…)
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDVLx4wxzOkI+wWkAGxpqgChUGw22RaCWyUBThEt/7CS you@laptop
# Fingerprint: SHA256:5oly3l8NHsMS29xBH+5F1h0XzIqVJzUiv5GZhLvO1i8
Choosing a key type
- Ed25519: short keys, fast, and the default recommendation of current OpenSSH releases. Supported by GitHub, GitLab and any server running OpenSSH 6.5 or later.
- RSA 3072 or 4096: choose it for old servers or network devices that do not support Ed25519. The public line starts with
ssh-rsa, and modern OpenSSH signs with SHA-2 (rsa-sha2-256 or rsa-sha2-512) automatically. - ECDSA P-256, P-384, P-521: the
ecdsa-sha2-nistp*key types. Some compliance profiles require NIST curves, which is the main reason to pick them.
Installing the key
- Save the private key and restrict it:
chmod 600 ~/.ssh/id_ed25519. OpenSSH refuses keys that other users can read. - Save the public line to
~/.ssh/id_ed25519.pub. - Add a passphrase if you want one:
ssh-keygen -p -f ~/.ssh/id_ed25519. - Append the public line to
~/.ssh/authorized_keyson the server, or paste it into your Git host's SSH keys page.
Common errors and fixes
- "UNPROTECTED PRIVATE KEY FILE!": the file permissions are too open. Run the chmod command above.
- "invalid format" or "error in libcrypto": the file lost its final newline or gained Windows line endings while copying. Save it with Unix line endings and a trailing newline.
- Permission denied (publickey): the public key is not in
authorized_keys, or the server does not accept the key type. Compare fingerprints withssh-keygen -lf. - Ed25519 not available: some older browsers lack Ed25519 in WebCrypto. Update the browser or choose ECDSA P-256.
SSH keys vs PEM keys
OpenSSH files are not interchangeable with PEM keys used by TLS and JWT libraries. For a PEM or JWK key pair use the RSA key generator or the ECDSA key generator. To get a certificate for HTTPS, start with the CSR generator.
Privacy
The key pair is generated with WebCrypto and encoded into OpenSSH format by code running in your browser. Nothing is uploaded or stored, and the key is lost when you leave the page, so save both files first.