# SSH Key Pair

An SSH (Secure Shell) key pair is used for identity authentication and encrypted communication, consisting of a public key and a private key. The public key can be used to encrypt messages that **only** the private key can decrypt. This property is employed as a way of authenticating using the key pair. Your SSH key pair contains several public keys that can be placed on your server to access it securely.

## Supported Formats <a href="#supported-formats" id="supported-formats"></a>

SSH keys are typically stored in the \~/.ssh/ directory.

<table><thead><tr><th width="196">Format</th><th width="265">Start With</th><th>Minimum Length</th></tr></thead><tbody><tr><td><strong>RSA</strong></td><td>ssh-rsa</td><td>2048 bits</td></tr><tr><td><strong>ED25519</strong></td><td>ssh-ed25519</td><td>256 bits</td></tr><tr><td><strong>ECDSA</strong></td><td>ecdsa-sha2-nistp</td><td>256 bits</td></tr></tbody></table>

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">Provide your public key. Be careful not to use your private key.</mark>
* <mark style="color:blue;">You're recommended to use</mark> <mark style="color:blue;">**RSA**</mark> <mark style="color:blue;">or</mark> <mark style="color:blue;">**ED25519**</mark> <mark style="color:blue;">keys, as they have good compatibility and security.</mark>
  {% endhint %}

## Example <a href="#example" id="example"></a>

Here we take RSA format as an example.

### Public key <a href="#public-key" id="public-key"></a>

```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDx6VN...
```

### Private key <a href="#private-key" id="private-key"></a>

```
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,5764636E65726F726974686D616E6F6E
...
-----END RSA PRIVATE KEY-----
```

## Limit <a href="#limit" id="limit"></a>

You can add up to 5 public SSH keys to create an SSH key pair.


---

# 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://docs.console.zenlayer.com/welcome/elastic-compute/security/ssh-key-pair.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.
