SSH key generator

The SSH key generator creates a public and private key pair, Ed25519 or RSA, in the OpenSSH format, so you can log in to servers with a key instead of a password.
Key settings

The keys are generated in the browser. Please enable JavaScript.

Everything runs in your browser; nothing is sent or stored.

  • Under "Key type", choose Ed25519, or RSA with a length of 3072 or 4096 bits.
  • In the "Key comment (optional)" field, you can enter text that identifies the key, such as a username and a computer name.
  • Click "Generate a key pair", and each click generates a new key pair.
  • Under "Key pair", you see the public key, the fingerprint, a command that adds the key to the server, and the private key.
  • Copy the public key, the command, or the private key with the copy buttons below the fields.
  • The private key is created in the OpenSSH format (BEGIN OPENSSH PRIVATE KEY), which is supported by OpenSSH 6.5 and later (the ssh-keygen default since version 7.8) and by the built-in SSH client in Windows 10 and 11. To use the key in PuTTY, convert it to a .ppk file with PuTTYgen.
  • We recommend generating keys on your own computer with the command ssh-keygen -t ed25519. Keep the private key in a safe place and do not share it.

How SSH key login works

An SSH key pair consists of a public key and a private key that are linked to each other. The public key is stored on the server, in the user's ~/.ssh/authorized_keys file, and the private key stays on the computer you connect from. When you log in, your computer uses the private key to sign data that changes with every login, and the server verifies the signature with the public key, so the private key itself is never sent to the server. Unlike a password, a private key cannot be guessed, so once key-based login works, you can disable password login in the SSH server settings and block automated guessing attempts.

Ed25519 or RSA

An Ed25519 key is short and fast, and it is considered highly secure. An RSA key also works on older systems and devices that do not support Ed25519, but it is much longer and takes longer to generate. A 3072-bit RSA key provides the level of security that is standard today, and a 4096-bit RSA key adds an extra safety margin, at the cost of a slightly slower calculation on every login. You can store several public keys on the server for the same user, for example, an Ed25519 key for most computers and an RSA key for an older system.

Storing the private key

Store the private key on your computer in the ~/.ssh folder. On Linux and macOS, limit its permissions to the owner only, because the SSH client refuses to use a private key that other users can read. On Windows, the built-in SSH client reads keys from the .ssh folder in your user folder. We recommend creating a separate key pair for each computer, so if a computer is lost or stolen, you can remove only its public key from the server. A private key cannot be recovered from the public key, so if you lose the private key, create a new key pair and replace the public key on your servers.

Commands to run on the computer you connect from

  • ssh-keygen -t ed25519 -C "dana@laptop"generates an Ed25519 key pair on your computer, with a comment.
  • ssh-keygen -lf ~/.ssh/id_ed25519.pubshows the fingerprint of a public key, to compare it with the fingerprint shown in the tool.
  • ssh-keygen -y -f ~/.ssh/id_ed25519derives the public key from the private key.
  • ssh-copy-id -i ~/.ssh/id_ed25519.pub user@serveradds the public key to the authorized_keys file on the server, logging in with a password.
  • ssh -i ~/.ssh/id_ed25519 user@serverconnects to the server with a specific private key.
Did you know?

A Linux VPS comes with full root access over SSH, and you can log in with SSH keys.

Linux VPS plans

SSH key generator FAQ

Is the private key protected by a passphrase?

No. The private key is created without a passphrase, so anyone who gets the file can use it to log in to the servers where the public key is set up. To add a passphrase to the key, run the command ssh-keygen -p -f ~/.ssh/id_ed25519 on your computer and enter a new passphrase. The ssh-agent program keeps the unlocked key in memory, so you do not need to type the passphrase every time you log in.

Can I use the same public key on several servers?

Yes. You can add the same public key to several servers and for several users, and the private key lets you log in to all of them. If a private key is exposed, remove the public key line from the authorized_keys file on every server and add a new key.

Why does the server reject my login with the key?

The common reasons are permissions that are too broad on the ~/.ssh folder or on the authorized_keys file on the server, a public key that was split into several lines when it was pasted, or logging in with a different username from the one whose account holds the key. The command shown in the tool sets permissions 700 on the folder and permissions 600 on the file. The command ssh -v user@server shows the steps of the connection and the keys that were offered to the server.

How do I use the key in PuTTY?

PuTTY uses key files in the .ppk format. Save the private key to a file, open the file in PuTTYgen through the Conversions menu and the Import key option, and save it by clicking Save private key. Then select the saved file in the authentication settings of the connection in PuTTY.

Is there a limit on the key comment?

Yes. The comment can contain up to 64 characters: Latin letters, digits, spaces, and some symbols, such as @, a period, and a hyphen. Other characters, such as letters outside the English alphabet, are removed from the comment when the key is generated. The comment does not affect login, and you can change it in the public key line in the authorized_keys file.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement