> ## Documentation Index
> Fetch the complete documentation index at: https://citodocs.prostack.host/llms.txt
> Use this file to discover all available pages before exploring further.

# Generating SSH Keys

> How to generate SSH key pairs for accessing Cito via command line or SFTP

To log into Cito via the command line, or use SFTP, you need to use an SSH key pair. This consists of two components- a **Public** and a **Private** key.

The Public key is what you add to the Cito dashboard. The Private key remains on your computer and should be kept secure.

If you already have an SSH key pair and wish to use that, you can go ahead and add it via the [Managed Keys](/deploying/ssh) page.

Below we explain how to generate a new key pair. We use the `ed25519` key type for brevity.

## On MacOS (or Linux)

Open a terminal (via Applications --> Utilities --> Terminal) and run:

```bash theme={null}
ssh-keygen -t ed25519 -C "youremail@example.com"
```

The `-C` flag is the key comment. By convention you should use your email address here, but any descriptive value is fine.

When prompted for the location to save the key, press Enter to accept the default location (`~/.ssh/id_ed25519`).

When asked for a passphrase, you can optionally set one for your key. This adds an extra layer of security. You can press Enter twice to use no passphrase if you wish.

The command will generate two files:

* `id_ed25519` (private key - keep this secure)
* `id_ed25519.pub` (public key - this is the one you add to the dashboard).

To view your public key, you can use:

```bash theme={null}
cat ~/.ssh/id_ed25519.pub
```

From here you can add the public key to **Managed Keys** on the Cito Dashboard and assign it to your site(s).

## On Windows (10 and 11)

Open PowerShell (you can right-click the Start button and select "Windows PowerShell" or "Terminal").

If you haven't installed OpenSSH client, install it:

* Go to Settings > Apps > Optional Features
* Click "Add a feature"
* Search for "OpenSSH Client"
* Click Install

Once OpenSSH is installed, in PowerShell run:

```powershell theme={null}
ssh-keygen -t ed25519 -C "your_email@example.com"
```

When prompted for the save location, press Enter to accept the default path (`C:\Users\YourUsername\.ssh\id_ed25519`).

When asked for a passphrase, you can optionally set one for your key. This adds an extra layer of security. You can press Enter twice to use no passphrase if you wish.

The command will generate two files:

* `id_ed25519` (private key - keep this secure)
* `id_ed25519.pub` (public key - this is the one you add to the dashboard).

To view your public key, run:

```powershell theme={null}
type $env:USERPROFILE\.ssh\id_ed25519.pub
```

To copy this to the clipboard, you can run:

```powershell theme={null}
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard
```

From here you can add the public key to **Managed Keys** on the Cito Dashboard and assign it to your site(s).

You can then use this public key in your Powershell terminal, or add it to your choice of SFTP client.
