SSH key pair generator
What is an Ssh Key Pair Generator?
SSH keys let you log in to servers and push to Git hosts without passwords. You keep the private key on your computer and copy the public key to the server or service. This tool generates an RSA SSH key pair in OpenSSH format locally in your browser.
How to use it
- Choose the key size, 4096 bits recommended for RSA, and an optional comment such as your email.
- Generate the key pair.
- Save the private key as
~/.ssh/id_rsaand the public key as~/.ssh/id_rsa.pub. - Set permissions:
chmod 600 ~/.ssh/id_rsa. - Add the public key to the server's
~/.ssh/authorized_keysor to GitHub or GitLab under SSH keys.
Key formats
The public key is one line: ssh-rsa AAAAB3NzaC1yc2E... [email protected]. The private key begins with -----BEGIN OPENSSH PRIVATE KEY----- or, in older PEM format, -----BEGIN RSA PRIVATE KEY-----. Both work with OpenSSH.
The command-line way
ssh-keygen -t ed25519 -C '[email protected]'creates a modern Ed25519 key, recommended for new keys.ssh-keygen -t rsa -b 4096creates an RSA key for older systems.ssh-copy-id user@serverinstalls the public key on a server.
Security best practices
- Protect the private key with a passphrase and use
ssh-agentso you only type it once per session. - Never share or upload the private key. Only the .pub file is shared.
- Use a separate key per device so one lost laptop can be revoked without affecting others.
- For long-term or high-value keys, generating them with
ssh-keygenon your own machine is the safest option.
Frequently Asked Questions
Which file do I give to the server?
The public key, ending in .pub. The private key never leaves your computer.
Should I use RSA or Ed25519?
Ed25519 is recommended for new keys because it is fast and secure with short keys. Use RSA with 4096 bits only where Ed25519 is not supported.
Why does SSH say my private key permissions are too open?
SSH refuses private keys readable by other users. Run chmod 600 on the key file.
How do I add my key to GitHub?
Copy the contents of the .pub file and paste it under Settings, SSH and GPG keys, New SSH key.