# SSH Key

SSH keys are a secure way to authenticate with servers and services without using passwords. Follow these steps to generate your SSH key pair and use your public key.

***

### For MacOS and Linux Users

#### 1. Open Terminal

You can find Terminal in Applications > Utilities or by searching for it using Spotlight (Cmd + Space and type "Terminal").

#### 2. Generate SSH Key Pair:

In the Term In the Terminal window, type the following command and press Enter:&#x20;

```
ssh-keygen
```

> This command generates a new SSH key using the RSA algorithm with 4096 bits.

#### 3. Follow the prompts

* Enter file in which to save the key: Press Enter to accept the default file location ``(`/Users/your_username/.ssh/id_rsa`)``.
* Enter passphrase: Type a secure passphrase for additional security (optional, but recommended).
* Enter the same passphrase again: Re-type your passphrase.

#### 4. Verify the keys :

To check if your keys were generated successfully, type:

```
ls ~/.ssh
```

* You should see \```id_rsa` (your private key)`` and \```id_rsa.pub` (your public key)`` in the list
* Copy the SSH Public Key
* To copy the SSH public key to your clipboard, type:

```
pbcopy < ~/.ssh/id_rsa.pub
```

***

### For Windows Users

#### 1. Open Terminal

You can use PowerShell or Windows Terminal.\
To open it, press Win + S, type PowerShell or Windows Terminal, and press Enter.

#### 2. Generate SSH Key Pair

In the Terminal window, type the following command and press Enter:

```
ssh-keygen -t rsa -b 4096
```

> This command generates a new SSH key using the RSA algorithm with 4096 bits.

#### 3. Follow the Prompts

* Enter file in which to save the key (e.g., `C:\Users\your_username\.ssh\id_rsa`):
* Press Enter to accept the default file location.
* Enter passphrase (empty for no passphrase):
* Type a secure passphrase for additional security (optional, but recommended).
* Enter the same passphrase again: Re-type your passphrase to confirm.

#### 4. Verify the Keys

To check if your keys were generated successfully, type:

```
Get-ChildItem $env:USERPROFILE\'.ssh\'
```

You should see two files in the list: id\_rsa (your private key) and id\_rsa.pub (your public key).

#### 5. Copy the SSH Public Key

To copy the SSH public key to your clipboard, type:

```
Get-Content $env:USERPROFILE\.ssh\id_rsa.pub | Set-Clipboard
```

<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://docs.cloud.olakrutrim.com/basics/core-infrastructure/compute/ssh-key.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.
