SSH Keys

What are SSH Keys

SSH (Secure Shell) keys are cryptographic keys used to securely connect to a server without needing to enter a password. They consist of a pair of keys: a public key and a private key.

Algorithms

Different algorithms can be used to generate SSH keys. Each has its own strengths and weaknesses, depending on the level of security and compatibility needed.

Choosing the Right Algorithm

  • RSA: Choose if you need broad compatibility, especially with older systems.

  • ED25519: Recommended for most users due to its security and efficiency.

  • ECDSA: Consider if you need high security with smaller key sizes for specialized environments.

How to Generate an SSH Key

  1. Open a terminal.

  2. Generate the key:

    • For ED25519 (recommended):

      ssh-keygen -t ed25519 -C "your_email@example.com"
  3. Follow the prompts:

    • When asked where to save the key, press Enter to accept the default location unless you need to save it elsewhere.

    • Set a passphrase if you want extra security.

  4. Final Steps:

    • Your public and private keys are now generated.

    • You can add it to your Git platforms (GitHub, Gitlab, etc.)

Last updated