diff --git a/content/security/ssh-key.md b/content/security/ssh-key.md index 8be3c59..5d7b736 100644 --- a/content/security/ssh-key.md +++ b/content/security/ssh-key.md @@ -123,6 +123,21 @@ Every keypair consists of a public and a private key that are connected to one a 4. Copy the output, beginning with `-----BEGIN SSH SIGNATURE-----` and ending with `-----END SSH SIGNATURE-----`. 5. Paste it into the large textbox and click the __Verify__ button. +## Telling Git about your SSH key + +SSH can also be used to sign commits as an alternative for GPG. You can read more about GPG commit signing [here](/security/gpg-key). + +{% admonition "note" %} + +SSH commit signing is available in Git 2.34 or later. To update your version of Git, see the [Git](https://git-scm.com/downloads) website. + +{% endadmonition %} + +1. Open your terminal. +2. Type `git config --global gpg.format ssh`. +3. Type `git config --global user.signingKey `, substituting `` with the path to the key you'd like to use, for example *~/.ssh/id_ed25519*. +4. Type `git config --global commit.gpgSign true`. + ## Avoid re-typing the passphrase Assuming you've created a secure key with a passphrase, SSH will prompt you for your passphrase for every connection. Common desktop environments like macOS or GNOME will offer you to cache your passphrase via an SSH agent.