Skip to content

Commit 9586cf3

Browse files
authored
Merge pull request #141 from vicenter-gitkraken/HC-88
HC-88 Create a new page for SSH Signing
2 parents 9288b63 + 9444ae5 commit 9586cf3

File tree

5 files changed

+64
-13
lines changed

5 files changed

+64
-13
lines changed

_images/gkc-git-executable.png

71.2 KB
Loading

_images/[email protected]

184 KB
Loading

_images/gkc-ssh-keygen.png

118 KB
Loading

_images/[email protected]

257 KB
Loading

gitkraken-client/commit-signing-with-gpg.md

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
---
22

3-
title: Commit Signing with gpg
4-
description: Learn how to create GPG keys and sign your commits in GitKraken Client
3+
title: Commit Signing
4+
description: Learn how to sign your commits in GitKraken Client
55
taxonomy:
66
category: gitkraken-client
77

88
---
99

1010
##What is Commit Signing?
1111

12-
In Git, you may commit using any name and email address. However, Git supports signing commits and annotated tags using a GPG key pair.
12+
In Git, you may commit using any name and email address. However, Git supports signing commits and annotated tags using a GPG or SSH key pair.
1313

1414
By signing a commit, other users with your public key can verify the commit was created by the owner of that key. Users can also share their public key with their remote hosting service, such as GitHub, so that commits appear as verified on their website.
1515

16-
###Commit Signing Requirements
16+
***
17+
18+
###Commit Signing with GPG
19+
20+
####Requirements
1721

1822
Before you start signing your commits, you will first need to install and configure GPG. Our recommendations to get GPG installed quickly are below.
1923

@@ -43,8 +47,7 @@ Once you have installed GPG to your machine, you can verify it is installed and
4347

4448
<img src="/wp-content/uploads/gpg-verify.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
4549

46-
47-
###Generating a GPG Key In GitKraken
50+
####Generating a GPG Key In GitKraken
4851

4952
If you have GPG installed on your local machine, you will be able to generate a GPG key pair from within GitKraken Client.
5053
<div class='callout callout--success'>
@@ -55,7 +58,7 @@ Under `Preferences` → `GPG Preferences`, there is an option to `Generate new G
5558

5659
<img src="/wp-content/uploads/generate-new-gpg-key.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
5760

58-
###Configure GPG in GitKraken
61+
####Configure GPG in GitKraken
5962

6063
Once you have GPG installed on your machine, you will need to configure GitKraken to use GPG. Launch GitKraken Client and navigate to Preferences → GPG Preferences.
6164

@@ -77,7 +80,7 @@ Once you have GPG installed on your machine, you will need to configure GitKrake
7780

7881
+ **Generate new GPG Key:** GitKraken Client will generate a new GPG key for you, see [Generating a GPG Key In GitKraken](/git-workflows-and-extensions/commit-signing-with-gpg/#generating-a-gpg-key-in-gitkraken).
7982

80-
###Verifying a Local Commit is Signed
83+
####Verifying a Local Commit is Signed
8184

8285
You can verify a commit has been signed by selecting a commit and viewing the commit panel. An icon will appear to the left of the commit SHA on signed commits only.
8386

@@ -96,18 +99,17 @@ Below is a list of possible signature codes and what they mean:
9699
+ `BADSIG` -- The signature with the keyid has not been verified.
97100
+ `ERRSIG` -- It was not possible to check the signature. This may be caused by a missing public key or an unsupported algorithm.
98101

99-
100-
###Uploading Your GPG Key to a Remote Hosting Service
102+
####Uploading Your GPG Key to a Remote Hosting Service
101103

102104
To upload your GPG public key to your remote hosting service, we recommend viewing the documentation for the respective hosting service:
103105

104106
* <em class='context-menu'><i class="fab fa-github"></i></em> [GitHub](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account)
105107
* <em class='context-menu'><i class="fab fa-gitlab" aria-hidden="true"></i></em> [GitLab](https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/#adding-a-gpg-key-to-your-account)
106-
* <em class='context-menu'><i class="fab fa-bitbucket" aria-hidden="true"></i></em> [Bitbucket](https://confluence.atlassian.com/bitbucketserver/using-gpg-keys-913477014.html#UsingGPGkeys-AddaGPGkeytoBitbucketServer)
108+
* <em class='context-menu'><i class="fab fa-bitbucket" aria-hidden="true"></i></em> Only Bitbucket Server[Bitbucket](https://confluence.atlassian.com/bitbucketserver/using-gpg-keys-913477014.html#UsingGPGkeys-AddaGPGkeytoBitbucketServer)
107109

108110
To copy your GPG public key in GitKraken Client, navigate to Preferences → GPG Preferences and below your Signing Key, select `Copy GPG Public Key`.
109111

110-
###Editing Your GPG Key
112+
####Editing Your GPG Key
111113

112114
Editing your gpg key is helpful when you wish to add another email address to a key or renew an expired key. To edit a GPG key, navigate to your terminal and enter `gpg --list-secret-keys --keyid-format LONG`. This command will output a list of your GPG keys, take note of the ID of the key you wish to edit.
113115

@@ -128,11 +130,60 @@ For a complete list you can review [GNU’s documentation](https://www.gnupg.org
128130

129131
Make sure to upload the updated key on your hosting service once you have saved. See [Uploading Your GPG Key to a Remote Hosting Service](/git-workflows-and-extensions/commit-signing-with-gpg/#uploading-your-gpg-key-to-a-remote-hosting-service).
130132

131-
###Deleting your GPG Key
133+
####Deleting your GPG Key
132134

133135
You can delete your key via terminal with the command `gpg --delete-secret-keys` simply append your username or key ID.
136+
134137
<img src="/wp-content/uploads/delete-key.png" class="img-bordered img-responsive center">
135138

136139
There will be several prompts to make sure that you *really* want to delete your GPG key:
140+
137141
<img src="/wp-content/uploads/delete-key-for-sure.png" class="img-bordered img-responsive center">
138142

143+
***
144+
145+
###Commit Signing with SSH
146+
147+
SSH signature verification is available in Gitkraken 9.6.0 as Experimental feature
148+
149+
####Requirements
150+
151+
- MacOS and Linux: Git and OpenSSH should be pre-installed. To check if are installed, open a terminal and run
152+
`git -v`
153+
`ssh -V`
154+
- Windows: Install <a href="https://git-scm.com/" target="_blank">Git Bash</a>
155+
156+
####Create SSH Key
157+
158+
Open a Terminal and run this command:
159+
160+
`ssh-keygen -t ed25519 -C "[email protected]"`
161+
162+
<img src="/wp-content/uploads/gkc-ssh-keygen.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
163+
164+
####Configure git to sign commits with SSH
165+
166+
Run this command to use SSH for signing commits and pointing to the key previously created:
167+
`git config --global gpg.format sshgit config --global user.signingkey /PATH/TO/.SSH/KEY.PUB`
168+
169+
####Create allowed_signers file
170+
171+
This file is needed to verify the key used to sign the commits is valid and known by git
172+
```
173+
touch ~/.ssh/allowed_signers
174+
git config gpg.ssh.allowedSignersFile ~/.ssh/allowed_signers
175+
echo "$(git config --get user.email) namespaces=\"git\" $(cat ~/.ssh/<MY_KEY>.pub)" >> ~/.ssh/allowed_signers
176+
```
177+
178+
####Enable Commit Signing by Default in Gitkraken:
179+
180+
Preferences > GPG > Sign Commits/Tags By defaultPreferences > Experimental > Use Git Executable and select a git executable 2.34 or later
181+
182+
<img src="/wp-content/uploads/gkc-git-executable.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
183+
184+
####Add the SSH key to your remote hosting
185+
186+
* <em class='context-menu'><i class="fab fa-github"></i></em> [GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)
187+
* <em class='context-menu'><i class="fab fa-gitlab" aria-hidden="true"></i></em> [GitLab](https://docs.gitlab.com/ee/user/ssh.html#add-an-ssh-key-to-your-gitlab-account)
188+
* <em class='context-menu'><i class="fab fa-bitbucket" aria-hidden="true"></i></em> Commit Signing verification is not supported on Bitbucket.org
189+

0 commit comments

Comments
 (0)