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

# SSH Keys

> Generate an SSH key and use it to access your Rackdog servers

SSH keys let you log in to your servers without passwords. Rackdog accepts a public key at provision time and installs it on the server so you can connect as soon as it's ready.

## Generate a key

On your local machine, run:

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

This creates a private key (keep it on your machine) and a public key that you'll paste into Rackdog.

## Find your public key

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

Copy the output. That's what you'll paste into the dashboard.

## Add the key to your organization

SSH keys are stored at the organization level, so add the key once and reuse it across servers.

1. In the dashboard, go to `https://metal.rackdog.com/<organization_id>/sshkeys`.
2. Click to add a new key, give it a name, and paste in your public key.
3. Save.

## Select the key when provisioning

During server provisioning, pick the key you just added from the **SSH key** selector. Rackdog will install it on the server automatically so you can log in as soon as provisioning finishes.

## Connect to the server

Once the server is ready, grab its IP from the dashboard and connect. The username depends on the OS you provisioned:

| OS            | Username        |
| ------------- | --------------- |
| Ubuntu        | `ubuntu`        |
| Debian        | `debian`        |
| CentOS        | `centos`        |
| Fedora        | `fedora`        |
| Rocky Linux   | `rocky`         |
| AlmaLinux     | `almalinux`     |
| Windows       | `Administrator` |
| Anything else | `root`          |

For example, on an Ubuntu server:

```bash theme={null}
ssh ubuntu@YOUR_SERVER_IP
```

## Good habits

* Keep the private key on your own machine and don't share it.
* Use a passphrase when you generate the key.
* Rotate keys periodically, especially if a machine holding one is lost or decommissioned.
* Disable password-based SSH on the server once key access is working (set `PasswordAuthentication no` in `/etc/ssh/sshd_config` and reload `sshd`).
