Generate SSH Keys Online


SSH-Keygen Online Algorithm RSA DSA ECDSA
RSA Key Size 1024 2048 4096
ECDSA Key Size 256 384 521
DSA Key Size 512 576 640 704 768 832 896 960 1024 2048
Passphrase

Your Support Matters!

Instead of directly asking for donations, I'm thrilled to offer you all nine of my books for just $9 on leanpub By grabbing this bundle you not only help cover my coffee, beer, and Amazon bills but also play a crucial role in advancing and refining this project. Your contribution is indispensable, and I'm genuinely grateful for your involvement in this journey!

Any private key value that you enter or we generate is not stored on this site, this tool is provided via an HTTPS URL to ensure that private keys cannot be stolen, for extra security run this software on your network, no cloud dependency


ssh-keygen authentication key generation, management and conversion

Generate an RSA SSH keypair with a 4096 bit private key

ssh-keygen -t rsa -b 4096 -C "RSA 4096 bit Keys"

Generate an DSA SSH keypair with a 2048 bit private key

ssh-keygen -t dsa -b 1024 -C "DSA 1024 bit Keys"

Generate an ECDSA SSH keypair with a 521 bit private key

ssh-keygen -t ecdsa -b 521 -C "ECDSA 521 bit Keys"

Generate an ed25519 SSH keypair- this is a new algorithm added in OpenSSH.

ssh-keygen -t ed25519

Extracting the public key from an RSA keypair

openssl rsa -pubout -in private_key.pem -out public_key.pem

Extracting the public key from an DSA keypair

openssl dsa -pubout -in private_key.pem -out public_key.pem

Copy the public key to the server
The ssh-copy-id command
ssh-copy-id user@hostname copies the public key of your default identity (use -i identity_file for other identities) to the remote host

SSH Running on different port

ssh-copy-id -i "user@hostname -p2222"

-i switch defaults to ~/.ssh/id_rsa.pub, if you want another key, put the path of the key after

Converting keys between openssl and openssh

  • Extract Public key from the certificate

      openssl x509 -in cert.pem -noout -pubkey >pubkey.pem
      cat pubkey.pem
      -----BEGIN PUBLIC KEY-----
      MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJi
      LGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17
      AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9A
      VIS++H5Qi2r7bUFX+cqFsyUCAwEAAQ==
      -----END PUBLIC KEY-----
    
  • Use the following command to convert it to authorized_keys entry

    $ ssh-keygen -i -m PKCS8 -f pubkey.pem
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDROqW94oqVzYwW8Sa5cmIsYGxjW3gwvi6JEAMZJmWdz7tSC/eH4wKOSTA4qI52w2jyTgpIEgbkZxB8pg453XvbngfjPMhhAV0XSy3s1wUFGPWlumctOvaowxXf60y7h5zsDTSTHzO5d2agAk6Aix95c+RHFZaJz0BUhL74flCLavttQVf5yoWzJQ==