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

# Use the SSH key stored on your phone

> Get the SSH key the Allthenticator app keeps on your phone, add it to GitHub or GitLab, sign Git commits with it, and set up older systems manually.

The Allthenticator app generates an SSH key in your phone's secure hardware, and the private key never leaves the phone. Any computer paired with your phone can use the key, but only while the phone is connected.

<video autoPlay muted loop playsInline src="https://mintcdn.com/allthenticate-e69095b0/7yUU7sq9zDstLP_S/images/help/features/ssh-key-demo.mp4?fit=max&auto=format&n=7yUU7sq9zDstLP_S&q=85&s=2f020bc0cc32ded3fa747f63bcb162cc" />

One SSH key on your phone, used from every paired computer

## How the desktop app sets up SSH

When your phone connects, the Allthenticate desktop app writes an SSH security key for your account into `~/.ssh`, so a plain `ssh` command uses it with nothing else to configure. This works on:

* Linux
* macOS 15.5 or later
* Windows with the built-in OpenSSH 8.9 or later

The app writes these files:

| File | Contents |
| - | - |
| `~/.ssh/id_ecdsa_sk` and `~/.ssh/id_ecdsa_sk.pub` | A key file pair of type `sk-ecdsa-sha2-nistp256@openssh.com`. It only points to the key on your phone; the private key stays on the phone. If you already have your own `id_ecdsa_sk`, the app names its files `id_ecdsa_sk_allthenticate_...` instead. |
| `~/.ssh/allthenticate.conf` | The SSH settings that use the key. The app rewrites it when a phone connects. |
| `~/.ssh/config` | Gets the line `Include ~/.ssh/allthenticate.conf` at the end. |

The public key's comment is your email followed by `(Allthenticate)`.

On computers that don't meet these requirements, the desktop app offers your phone's older device key through its SSH agent instead. See [Set up the SSH agent manually](#set-up-the-ssh-agent-manually).

## Copy your public key

**1. Open the desktop app**

Open the Allthenticate desktop app with your phone connected. Your phone's card shows **SSH key** only while the phone is connected.

**2. Show the key**

Select **SSH key** on the phone's card. The app asks the phone for its key, which takes a few seconds after the phone connects.

![Allthenticate desktop app Status page with a connected phone's card expanded to show its sk-ecdsa SSH public key, a copy button, and GitHub, GitLab and Sign Git commits buttons](https://mintcdn.com/allthenticate-e69095b0/7yUU7sq9zDstLP_S/images/help/features/ssh-key-card.png?fit=max\&auto=format\&n=7yUU7sq9zDstLP_S\&q=85\&s=e47022f8c47eeac837d9352021d8be26)

The SSH key shown on a phone's card in the desktop app

**3. Add it where you need it**

* Select **GitHub** or **GitLab** to copy the key and open that site's page for adding SSH keys, then paste it.
* Or copy the key and add it to a server's `~/.ssh/authorized_keys`.

> [!NOTE]
>
> If the desktop app shows **Your old SSH key is being retired. Copy your new key from Status and use it instead.**, something is still using the older device key. Copy the key shown on your phone's card and replace the old key on your Git host and servers.

## Sign your Git commits

Signing every commit with the key on your phone proves the commit came from you. Select **Sign Git commits** on your phone's card in the desktop app. Git then signs every commit with that key. To turn it off, select **Stop signing commits**.

![Allthenticate desktop app phone card showing the SSH key with GitHub, GitLab and Stop signing commits buttons](https://mintcdn.com/allthenticate-e69095b0/7yUU7sq9zDstLP_S/images/help/features/ssh-sign-commits.png?fit=max\&auto=format\&n=7yUU7sq9zDstLP_S\&q=85\&s=a231270ab1c9741e1947a6e74ac724c9)

Commit signing turned on: the button changes to Stop signing commits

Git 2.34 or later is required. Check with `git --version`; on a Mac you can upgrade with `brew install git`.

If the app reports **Couldn't set up Git signing**, configure Git by hand.

### Set up commit signing manually

These commands do what **Sign Git commits** does for the security key file. Use the file name the app wrote if it isn't `id_ecdsa_sk`.

```bash theme={null}
git config --global gpg.format ssh
git config --global commit.gpgsign true
git config --global user.signingkey ~/.ssh/id_ecdsa_sk
```

On macOS and Windows, also point Git at an `ssh-keygen` that can reach the phone:

```bash macOS theme={null}
git config --global gpg.ssh.program /opt/sda/scripts/ssh-keygen-sk
```

```bash Windows theme={null}
git config --global gpg.ssh.program C:/Windows/System32/OpenSSH/ssh-keygen.exe
```

To verify your own signatures, add yourself as an allowed signer:

```bash theme={null}
mkdir -p ~/.config/git
git config --global gpg.ssh.allowedSignersFile ~/.config/git/allowed_signers
echo "$(git config user.email) $(cat ~/.ssh/id_ecdsa_sk.pub)" >> ~/.config/git/allowed_signers
```

### Sign commits in GitKraken

GitKraken signs with the key on your phone once Git is set up as above. Open GitKraken's **Preferences** (the gear icon in the top right), then:

1. Under **Experimental** > **Git Executable**, turn on **Use Git Executable**. This lets GitKraken sign commits with SSH.
2. Under **GPG**, turn on **Sign Commits by Default** (and **Sign Tags by Default** if you want). GitKraken notes that `gpg.format=ssh` is set, so it signs with SSH instead of GPG.

## Set up the SSH agent manually

Use this on computers where the desktop app doesn't write a key file, or for tools that only talk to an SSH agent. The desktop app runs an SSH agent that offers your phone's device key while the phone is connected. Point `SSH_AUTH_SOCK` at it:

> [tab] zsh
>
> ```bash theme={null}
> echo 'export SSH_AUTH_SOCK=/var/run/allthenticate-ssh.sock' >> ~/.zshenv
> ```
>
> Then open a new terminal.

> [tab] bash
>
> Add this line to `~/.bashrc`, then open a new terminal:
>
> ```bash theme={null}
> export SSH_AUTH_SOCK=/var/run/allthenticate-ssh.sock
> ```

> [tab] fish
>
> ```fish theme={null}
> set -e SSH_AUTH_SOCK
> set -Ux SSH_AUTH_SOCK /var/run/allthenticate-ssh.sock
> ```

> [tab] Windows (Git Bash)
>
> On Windows, the agent works only with Git Bash (the Cygwin environment that comes with Git for Windows). Add this line to `~/.bashrc` in Git Bash:
>
> ```bash theme={null}
> export SSH_AUTH_SOCK="/c/Program Files/Allthenticate/Passwordless/allthenticate-ssh.sock"
> ```

Check that the agent sees your phone's key:

```bash theme={null}
ssh-add -L
```

The output is one line per connected phone, ending with your username and `@Allthenticate`:

```text theme={null}
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ... alex@Allthenticate
```

If no phone is connected, the list is empty and the desktop app shows **SSH needs your phone. Connect it, then try again.**

To sign commits through the agent, give Git the key itself instead of a file:

> [tab] zsh or bash
>
> ```bash theme={null}
> git config --global gpg.format ssh
> git config --global commit.gpgsign true
> SIGNING_KEY="$(ssh-add -L)"
> git config --global user.signingkey "$SIGNING_KEY"
> mkdir -p ~/.config/git
> git config --global gpg.ssh.allowedSignersFile ~/.config/git/allowed_signers
> echo "$(git config user.email) $SIGNING_KEY" >> ~/.config/git/allowed_signers
> ```

> [tab] fish
>
> ```fish theme={null}
> git config --global gpg.format ssh
> git config --global commit.gpgsign true
> git config --global user.signingkey (ssh-add -L)
> mkdir -p ~/.config/git
> git config --global gpg.ssh.allowedSignersFile ~/.config/git/allowed_signers
> echo (git config user.email) (ssh-add -L) >> ~/.config/git/allowed_signers
> ```

## Troubleshooting

> [accordion] The SSH key button doesn't appear
>
> The button appears only while the phone is connected. Check that the Allthenticator app shows this computer as connected.

> [accordion] This phone didn't send a key
>
> Check that the phone is connected, then select **Try again**. If the app says **Update the Allthenticate app on this phone to get its SSH key**, update the Allthenticator app from the App Store or Google Play.

> [accordion] Couldn't reach the background service
>
> The desktop app can't reach its background service, which provides the SSH key. See the guide for your operating system in [Desktop sign-in](https://help.allthenticate.com/help/desktop/overview.md).

> [accordion] Git isn't installed on this computer
>
> **Sign Git commits** needs Git. Install it, then try again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.