How to generate the best SSH keys | Keystash (2024)

Back to all guides

It’s common practice for most organisations to use RSA SSH key pairs due to their compatibility across Linux distributions and cloud services. Consider this: the algorithm behind RSA was designed in 1977, at a time when computing power was not what it is today.

This is why you should consider newer SSH key types that have been designed with today's IT security risks in mind. Let's take a look at what's available:

TL;DR (too long; didn't read): We suggest using Ed25119 keys in general unless there are legacy Linux distributions and services you need to make use of. Also ensure you add some small options to key generation processes to make them extra secure. See more detail below.

RSA Keys

This is the default option for ssh-keygen on most Linux distributions and for Puttygen (the most popular Windows key generator). It is still the most widely supported key type, however this is not a reason to skip other newer key types.

The best practice for RSA keys today is to use a key size of 2048 bits or higher, however there are diminishing returns using longer keys (3072 bits and higher). Longer keys take more time to create and there are newer key types that give equivalent and usually better security while being faster to create and smaller in size.

DSA Keys

The OpenSSH server that is the most popular SSH server on Linux distros has deprecated the support of DSA keys as they are generally considered insecure due to discovered vulnerabilities. We suggest you avoid DSA keys if possible.

ECDSA Keys

ECDSA is a variant of DSA keys, however it uses Elliptic-Curve cryptography, which is a newer (at least in comparison to RSA) approach to public-key cryptography, designed in 1985 and its benefits include smaller key size and they are significantly faster to create.

Elliptic-curve cryptography keys or ECC keys provide comparable security to longer RSA key types. For example, a 256-bit ECC key would be comparable to a 3072-bit RSA key.

However, cryptography experts have shared concerns over the trustworthiness of NIST produced curves used in ECDSA and that the NSA may have implemented backdoors. This, together with the technically superior EdDSA (Ed25519) key type, we suggest you avoid ECDSA keys and consider EdDSA key types instead.

How to generate the best SSH keys | Keystash (2)

EdDSA Keys (Ed25519 & Ed448)

The Edwards-curve Digital Signature Algorithm was designed in 2011 and is highly optimised for x86-64 processors. It provides equivalent and usually better security than ECDSA and longer key length RSA keys.

Its main advantages are small key sizes, fast key generation times, high performance and is resistance against side-channel attacks.

Something to note though is its compatibility. In particular Ed25519 keys are only supported in versions of OpenSSH server 6.5 and higher. Of course, you can always upgrade the version of OpenSSH, however there may be circ*mstances where this is not possible. The following popular Linux distributions have support for Ed25519 keys out of the box:

  • Ubuntu 14.04 and higher
  • Debian 8 and higher
  • Redhat Enterprise Linux 7 and Higher (including CentOS 7, Oracle Linux 7, Scientific Linux 7)
  • RockyLinux and AlmaLinux 8 and higher
  • Amazon Linux AMI 2015.09 and higher
  • Fedora Server 21 and higher
  • Arch Linux since 2016

Note: Amazon AWS EC2 and Google GCP support Ed25519 keys, however Microsoft Azure currently does not support these keys.

Ed448 keys are similar in many ways, however they have not gained widespread adoption, in particular OpenSSH as of 2023 has not implemented this key type citing that Ed25519 already provides all the advantages of ECC keys. Additionally, vulnerabilities were found in SHA-3 in late 2022: (CVE-2022-37454). EdDSA makes the use of SHAKE256 mandatory for Ed448 keys and SHAKE256 is part of the SHA family of standards.

How to generate an EdDSA Ed25519 key

For ssh-keygen simply use the following command:

$ ssh-keygen -o -a 100 -t ed25519

The “-a 100” controls the key derivation function rounds, which controls how difficult it would be to brute force unlocking an encrypted (passphrase locked) private key. A higher number means it would be more secure but would take longer to unlock. Numbers between 80 and 200 are considered sufficiently secure with a low time to unlock.

For Puttygen simply select EdDSA and then select “Ed25519 (255 bits)” as per below:

How to generate the best SSH keys | Keystash (3)

Can Keystash help me implement secure keys?

Keystash is an end-to-end user and SSH key management platform designed to help you and your team better manage and secure SSH keys and SSH servers. Keystash supports all RSA, ECDSA and Ed25519 key types and can help your users generate and implement secure keys. Our system actively warns users when using insecure keys or bad configurations. Additionally, Keystash creates strong and secure SSH keys for your users if they don’t want to use the tools already listed above.

Keystash can help your team transition from RSA to Ed25519 SSH keys by enabling users to have two SSH keys active (RSA and Ed25519 keys) while your legacy systems are being decommissioned. You can remove all RSA keys from Keystash once all RSA only systems have been decommissioned with zero impact on your users connections as the Ed25519 keys would continue to work.

Keystash is ideally suited to bring visibility and control to your Linux environment for businesses of all sizes. Contact us if you would like assistance in setting up an Identity and Access Management and SSH Key management tool.

How to generate the best SSH keys | Keystash (2024)

FAQs

How to generate the best SSH keys | Keystash? ›

Larger bit lengths create more secure keys however they take significantly longer to generate. Keystash will create a strong key by default, so you don't have to change the default setting. You can read more about the different types of SSH keys here. Click "Create Key" and wait for the key to generate.

What is the best SSH key generator? ›

To generate a robust SSH key, you have two main options: ED25519 and RSA. Both have their advantages, but ED25519 is generally recommended for its security and performance benefits.

What is the best SSH key algorithm? ›

We strongly recommend using only the ed25519 algorithm (an ECDSA variant). It is the most secure SSH key type widely available, and is very well supported in the majority of systems. If you are using an client or server without ed25519 support, you should consider upgrading where possible.

What is the best format for SSH keys? ›

In most cases, 2048-bit keys are secure and generally recommended. If you need higher security, such as for critical infrastructure or storing sensitive data, consider using longer keys (3072 or 4096 bits). Periodically review and update key lengths as technology changes to protect against new threats.

Is ECDSA or ED25519 better? ›

EdDSA Keys (Ed25519 & Ed448)

It provides equivalent and usually better security than ECDSA and longer key length RSA keys. Its main advantages are small key sizes, fast key generation times, high performance and is resistance against side-channel attacks.

Do I need to generate a new SSH key every time? ›

If your key has a passphrase and you don't want to enter the passphrase every time you use the key, you can add your key to the SSH agent. The SSH agent manages your SSH keys and remembers your passphrase. If you don't already have an SSH key, you must generate a new SSH key to use for authentication.

What is the strongest key algorithm? ›

Strongest Data Encryption Algorithms
  • TripleDES.
  • Twofish encryption algorithm.
  • Blowfish encryption algorithm.
  • Advanced Encryption Standard (AES)
  • IDEA encryption algorithm.
  • MD5 encryption algorithm.
  • HMAC encryption algorithm.
  • RSA security.
Jan 17, 2020

What is the fastest SSH algorithm? ›

arcfour is the fastest cipher, and aes128-cbc is faster than the default aes128-ctr. Note that blowfish-cbc is not particularly fast. ssh is faster than netcat using either the aes128-cbc or arcfour ciphers.

What is the best practice for SSH key pair? ›

9 SSH Key Management Best Practices You Need to Know
  • Discovery and Inventory. ...
  • Gain Holistic Visibility. ...
  • Monitor Key Usage. ...
  • Automate Key Lifecycle Management. ...
  • Enforce Policies and Governance. ...
  • Generate Strong Keys. ...
  • Rotate Keys Regularly. ...
  • Limit Shared Private Key Usage.

How do I organize my SSH keys? ›

Managing multiple SSH keys and Git accounts
  1. Generate a unique SSH key for each use case. SSH keys should follow the following naming format: [Host]-[Use] (ie. ...
  2. Modify your SSH config file (typically ~/. ssh/config ) with the required hosts and identity files. ...
  3. Modify the Git remote urls. ...
  4. Add the SSH Key to Remote.

How to generate RSA key? ›

Generate RSA Keys
  1. Open a shell using Putty or another utility.
  2. Use commands to generate an RSA key file. Type the following command to generate RSA keys: ssh-keygen -t rsa. ...
  3. Navigate to the. rsakey. folder that you created in step 2b. ...
  4. Locate the public key beginning with. ssh. and copy the key.

How to create an ECDSA key? ›

Generate ECDSA keys
  1. Create a private key. openssl ecparam -name secp256k1 -genkey -noout -out ec-secp256k1-priv-key.pem. ...
  2. Create a public key by extracting it from the private key. openssl ec -in ec-secp256k1-priv-key.pem -pubout > ec-secp256k1-pub-key.pem.

What is the best algorithm for SSH key? ›

To ensure the utmost security and efficiency, it is crucial to use strong cryptographic algorithms for SSH key generation. The Ed25519 algorithm has gained popularity in recent years due to its superior security characteristics and computational efficiency.

What is the weakness of ECDSA? ›

We analyze a number of different weaknesses in the generation of ECDSA signatures. Incorrect range: The random number k used in ECDSA may have less bits than the size of the field elements in a signature. This weakness is quite common.

What are the disadvantages of Ed25519? ›

The only downside to Ed25519 is that it will fall to quantum computing before RSA 4096. Except nobody knows when that's gonna really happen. I've personally switched to ed25519-sk wherever I could. Same, the short key looks much nicer and both will fall to quantum anyhow.

Who should generate SSH key? ›

Typically a system administrator would first create a key using ssh-keygen and then install it as an authorized key on a server using the ssh-copy-id tool. See also the dedicated page on configuring authorized keys for OpenSSH. We recommend using passphrases for all identity keys used for interactive access.

What is the best SSH tool? ›

SSH Clients For Windows Users:
  • PuTTY. PuTTY is one of the most popular SSH clients for Windows, known for its simplicity and reliability. ...
  • Solar-PuTTY. ...
  • Bitvise SSH Client. ...
  • Terminal. ...
  • iTerm2. ...
  • Cyberduck. ...
  • OpenSSH. ...
  • Terminator.
Apr 24, 2024

Top Articles
Order Fulfillment Specialist - Nehemiah Manufacturing
What to Do if You Can’t Afford Your Car Payment - Experian
Ffxiv Act Plugin
Po Box 7250 Sioux Falls Sd
Loves Employee Pay Stub
Goodbye Horses: The Many Lives of Q Lazzarus
Soap2Day Autoplay
South Park Season 26 Kisscartoon
Slapstick Sound Effect Crossword
Rubfinder
Sinai Web Scheduler
Minn Kota Paws
Best Private Elementary Schools In Virginia
Cars For Sale Tampa Fl Craigslist
Pollen Count Los Altos
Call Follower Osrs
Ladyva Is She Married
Evil Dead Rise Showtimes Near Regal Columbiana Grande
Vcuapi
Lax Arrivals Volaris
Red Devil 9664D Snowblower Manual
Schedule 360 Albertsons
Kountry Pumpkin 29
Google Doodle Baseball 76
Pecos Valley Sunland Park Menu
Craigslist Maryland Trucks - By Owner
Barista Breast Expansion
Makemv Splunk
Kirk Franklin Mother Debra Jones Age
Is Light Raid Hard
Craigslist Fort Smith Ar Personals
Page 2383 – Christianity Today
5 Star Rated Nail Salons Near Me
The Bold and the Beautiful
Mark Ronchetti Daughters
County Cricket Championship, day one - scores, radio commentary & live text
Khatrimmaza
Scanning the Airwaves
Geology - Grand Canyon National Park (U.S. National Park Service)
Poe Flameblast
National Insider Threat Awareness Month - 2024 DCSA Conference For Insider Threat Virtual Registration Still Available
Barber Gym Quantico Hours
Hellgirl000
Leena Snoubar Net Worth
How Does The Common App Work? A Guide To The Common App
What to Do at The 2024 Charlotte International Arts Festival | Queen City Nerve
Autozone Battery Hold Down
116 Cubic Inches To Cc
Lsreg Att
Land of Samurai: One Piece’s Wano Kuni Arc Explained
Www.card-Data.com/Comerica Prepaid Balance
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 6296

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.