# 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):

     ```mathematica
     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.)

\ <br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.mikaelsamvelian.com/macos-setup/ssh-keys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
