Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions tutorials/protect-github-ssh.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
updated_at: October 13, 2026
updated_at: December 2, 2026
title: Protect GitHub with SSH Certificates
html_title: Protect GitHub Repositories with Hardware-Bound SSH Certificates
description: Authenticate to GitHub with short-lived SSH certificates backed by your device's TPM or Secure Enclave, issued and managed by the Smallstep Agent.
Expand Down Expand Up @@ -40,8 +40,12 @@ sequenceDiagram
You will need:

- A GitHub Enterprise Cloud organization where you are an owner.
- Devices enrolled in Smallstep with the [Smallstep Agent](../platform/smallstep-agent.mdx) installed,
- Devices enrolled in your Smallstep team with the [Smallstep Agent](../platform/smallstep-agent.mdx) installed,
each with a user assigned.
A device enrolled in a different team won't receive the certificate.
- SSH enabled for your Smallstep team.
If it isn't enabled yet,
[contact Smallstep Support](https://support.smallstep.com/en/contact-us) to turn it on before you continue.
- Users synced from your identity provider, with a GitHub username attribute (next section).

## Sync users and their GitHub usernames
Expand Down Expand Up @@ -107,8 +111,19 @@ Create a **credential** that tells the Smallstep Agent to issue a hardware-bound
to each of your devices.

You will need [an API token](https://smallstep.com/app/?next=/settings/api/tokens/add).
In the dashboard, tokens are under **Team Settings → API Clients**.
Give the token the `post-endpoint-configurations` scope, found in the **Protect** group of scopes
(add `get-endpoint-configuration` and `list-endpoint-configurations` to look it up afterward).
See [Smallstep API](../platform/smallstep-api.mdx) for details.

<Alert severity="info" mb={4}>
<div>
SSH credentials are created as endpoint configurations in API version <code>2025-01-01</code>,
which is why the request below sets <code>x-smallstep-api-version: 2025-01-01</code>.
Later API versions don't include the endpoint configurations API.
</div>
</Alert>

Store your API token in a headers file for `curl`:

```bash
Expand Down Expand Up @@ -175,6 +190,11 @@ from the `githubUsername` attribute you configured above.
Once this credential is created, the Smallstep Agent on matching devices automatically requests
and renews hardware-bound SSH certificates that carry each user's GitHub username.

A successful request returns the new configuration with its `id`.
SSH credentials don't appear on the **Credentials** page in the dashboard.
To confirm it worked, wait a few minutes and run `ssh-add -l` on a matching device
(see [Verify SSH authentication](#verify-ssh-authentication)).

# Step 2: Configure the enforcement point

The enforcement point is GitHub itself:
Expand Down
Loading