Logging into a remote server with a password is convenient, but passwords can be guessed, phished, and leaked. SSH key authentication replaces the password with a cryptographic key pair: you keep a private key on your own machine, and you place the matching public key on the server. When you connect, the server challenges you to prove you hold the private key, without the private key ever leaving your device. The SSH Key Generator creates such a pair in your browser, with the public key in OpenSSH format ready to add to a server, and the private key in PEM format ready to save as your identity file. The keys are generated locally, so the private key is never uploaded or stored by this site.
What Is the SSH Key Generator?
The SSH Key Generator is a free browser-based tool that generates RSA key pairs for SSH authentication using the Web Cryptography API. The keys are generated with the RSASSA-PKCS1-v1_5 algorithm and SHA-256, for signing and verification, which is how SSH proves identity: the client signs a challenge with the private key, and the server verifies the signature with the public key. You choose a key size of 2048 bits, labeled recommended, or 4096 bits, labeled slower and stronger. Generation can take a few seconds, especially at 4096 bits, and the tool shows a Generating message and disables the button while it works.
The public key is exported in OpenSSH format, the single-line format that begins with ssh-rsa followed by Base64 data and an optional comment. That line is what you append to the authorized_keys file on a server, typically at the path shown in the tool, in the .ssh directory of the account you log into. The tool builds the OpenSSH blob from the key parameters, encoding the algorithm name, exponent, and modulus in the SSH wire format. An optional comment field lets you add a label such as an email address, which is appended to the public key line to help you identify the key later. The private key is exported as PEM text in PKCS8 format, labeled PRIVATE KEY, and is offered for download as a file named id_rsa, the conventional name for an SSH private key file, while the public key downloads as id_rsa.pub.
The tool includes an honest note about a limitation of browser key generation: some servers and newer OpenSSH versions prefer Ed25519 keys, which browsers cannot generate with WebCrypto. If your server or policy requires Ed25519, you will need to generate the key with a command-line tool on your own machine instead. For servers that accept RSA keys, the keys produced here are standard and usable.
How to Use the SSH Key Generator
- Choose the key size. Select 2048 bits for general use, or 4096 bits for a stronger key if you can accept slower generation. Check whether your server or organization has a required minimum size.
- Add an optional comment. Enter a comment such as your email address or a label like laptop-2026 in the Comment field. The comment is appended to the public key line only, to help you recognize the key later. Leave it empty if you prefer no comment.
- Click Generate SSH Key Pair. Press the button and wait for generation to finish. The button shows a Generating message and is disabled during the process.
- Copy or download the public key. Use Copy Public Key or Download id_rsa.pub to obtain the single-line OpenSSH public key. This is the key you place on servers.
- Add the public key to the server. On the server, append the public key line to the authorized_keys file in the .ssh directory of the account you use, creating the directory and file if needed, and setting restrictive permissions on them according to your server documentation.
- Save the private key securely. Use Copy Private Key or Download id_rsa to save the PEM private key. Store it in your .ssh directory with private permissions, readable only by you. Never share it, email it, or commit it to a repository.
- Test the connection. Try logging in with the key. If the server still asks for a password, check the authorized_keys contents, file permissions, and server configuration, and confirm the key was added to the correct account.
Key Features of the SSH Key Generator
- RSA keys for SSH signing. Keys are generated with RSASSA-PKCS1-v1_5 and SHA-256 for sign and verify operations, matching how SSH authentication proves possession of the private key.
- OpenSSH public key format. The public key is a single line starting with ssh-rsa, ready to append to authorized_keys without conversion.
- PEM private key. The private key is exported as PKCS8 PEM text, downloadable as id_rsa, the conventional SSH private key filename.
- Optional comment. A comment field lets you label the key with an email address or device name, making it easier to manage multiple keys on a server.
- Two key sizes. Choose 2048 bits or 4096 bits, with clear labels about the speed and strength trade-off.
- Separate controls for each key. Each key has its own copy and download buttons, reducing the chance of mixing up the public and private keys.
- Local generation. Keys are created in the browser and never leave it. The private key is never uploaded or stored by the site.
- Honest Ed25519 note. The tool states plainly that Ed25519 keys cannot be generated in the browser, so you are not misled into thinking an RSA key satisfies a requirement for Ed25519.
Practical Use Cases With Concrete Examples
Setting up passwordless login to a virtual private server. You rent a server and want to stop typing a password for every login. Generate a key pair, add the public key to the server authorized_keys file, save the private key on your laptop, and connect with the key. You can then disable password authentication on the server for stronger security, following your server documentation.
Accessing a code hosting account. Many code hosting services accept SSH keys for repository access. Generate a pair, add the public key to your account settings on the service, and use the private key for cloning and pushing over SSH, without entering a password for each operation.
Managing multiple devices. Generate a separate key pair for each device you use, with a comment naming the device. If a laptop is lost, you can remove only that device public key from the server, without affecting keys from your other devices.
Automating deployments and backups. A deployment script or backup job that needs to connect to a server can use an SSH key instead of a stored password. The private key file is read by the automation, and the public key on the server grants access only to the holder of that key.
Learning SSH authentication. A learner can generate a pair, inspect the public key line and the PEM private key, and practice adding the public key to a test server, gaining hands-on familiarity without installing command-line tools first.
Replacing a compromised key. If a private key may have been exposed, generate a new pair, add the new public key, verify the new key works, and then remove the old public key from the server. The old private key becomes useless once its public key is removed.
Tips and Best Practices
- Protect the private key file. Set the file so only you can read it. On Unix-like systems, that typically means restrictive permissions on the .ssh directory and the private key file. Never make the private key readable by others.
- Use one key pair per device. Separate keys make revocation simple. If one device is lost or sold, remove only its public key from your servers and accounts.
- Label keys with comments. A comment such as an email address or device name helps you identify keys months later when a server authorized_keys file contains several entries.
- Never share the private key. No server, support agent, or colleague ever needs your private key. Share only the public key line. A request for a private key is a serious warning sign.
- Back up the private key securely. If the only copy is lost, you lose key-based access to servers that accept only that key. Keep an encrypted backup in a safe place, and protect it as carefully as the original.
- Remove keys you no longer use. Periodically review authorized_keys files and account key lists, and remove keys for devices you no longer own or accounts you no longer use.
- Consider a passphrase for the private key. The PEM private key produced here is unencrypted. If your SSH client supports it, you can add a passphrase when importing or converting the key, so the file alone is not enough to authenticate. Check your client documentation for the correct procedure.
- Check Ed25519 requirements first. If a server or policy requires Ed25519, generate the key with a local command-line tool instead, because the browser cannot create Ed25519 keys. The RSA Key Pair Generator covers general RSA encryption keys if you need those instead.
Limitations
The SSH Key Generator produces RSA keys only, and it states that limitation openly. It cannot generate Ed25519 or ECDSA keys, because WebCrypto in browsers does not support generating those key types. Some modern servers and clients prefer or require Ed25519, and for those you must use a local tool. The private key is exported without passphrase protection, so file permissions and secure storage are your responsibility. The tool does not install the public key on any server, does not test the connection, and does not configure server settings such as disabling password authentication; those steps must be done by you on the server. Key generation requires WebCrypto over HTTPS in a modern browser, and 4096-bit generation takes longer than 2048-bit generation. The tool does not manage key rotation, expiry, or revocation. Finally, the security of the key pair depends on the security of the browser and device used to generate it. A compromised device could capture the private key at creation time.
Frequently Asked Questions
Where do I put the public key on a server?
Append the single-line public key to the authorized_keys file in the .ssh directory of the account you log into on the server. Ensure the file and directory have the restrictive permissions your SSH server expects, and that the key is on a single line with no line breaks in the middle.
Can I use the same key pair on multiple servers?
Yes. The same public key can be added to many servers, and the one private key authenticates to all of them. For easier revocation, many people prefer a separate pair per device rather than per server, so losing one device affects only its key.
Why does the tool not offer Ed25519 keys?
Because the Web Cryptography API in browsers cannot generate Ed25519 keys. The tool states this limitation in its hint. If you need Ed25519, generate the key with a command-line SSH tool on your own computer.
Is the private key uploaded anywhere?
No. The keys are generated in your browser and never leave it. The only copies of the private key are the ones you create by copying or downloading it.
What should I do if my private key is exposed?
Generate a new key pair, add the new public key to every server and service that used the old one, verify the new key works, and remove the old public key everywhere. Treat the old private key as compromised from the moment of exposure.
What is the comment for?
The comment is a label appended to the public key line, often an email address or device name. It has no effect on authentication. It helps you recognize which key is which when a server or account has several keys.
Managing Many Keys Across Servers and Services
As the number of servers, services, and devices grows, key management becomes a discipline of its own. A useful practice is to keep an inventory, even a simple one, recording each key pair, its comment, the device it lives on, the servers and services where its public key is installed, and the date it was created. That inventory turns a lost-device incident from a frantic search into a checklist: remove the public key from each listed location, generate a replacement, and install the new key. It also makes periodic review possible: keys for devices that no longer exist, employees who have left, or services that have been retired can be identified and removed, reducing the attack surface. On each server, keep the authorized keys file tidy, with one key per line and comments that match the inventory, and avoid copying the same public key to servers where it is not needed. For teams, agree on who may add keys to shared servers, require that additions be recorded in the inventory, and review the file on a schedule. Good key hygiene is unglamorous work, but it is what prevents a forgotten key from becoming an open door months after it should have been closed.
Related Tools
Related tools include the RSA Key Pair Generator for general RSA encryption keys, the Secret Key Generator for random symmetric keys, the Password Generator for strong passwords to protect key files, the Hash Checker for verifying file integrity, and the API Key Generator for service credentials. Browse the full collection from the homepage.