Create an SSH Signing Key for Git
The instructions provided below are basic and do not cover advanced
ssh-keygen and Git.
For more detailed instructions on creating SSH signing keys for Git,
refer to other resources available on the web.
Ensure that you have installed:
- Git version 2.34 or newer (run
git -vto check)
- OpenSSH 8.8 or newer (run
ssh -Vto check)
Step 1: Create an SSH Signing Key
Run the following command in your terminal:
ssh-keygen -t ed25519 -C "firstname.lastname@example.org" -N "" -f my_signing_key
This command will generate two files:
my_signing_key- the private key file
my_signing_key.pub- the public key file
You can store the public key file
even public locations.
However, ensure that your private key file remains private.
A common location to store SSH key files is the local directory
where other SSH keys are often kept.
Step 2: Configure Git to Use Your SSH Signing Key
First, configure Git to use SSH keys for signing instead of GPG keys:
git config --global gpg.format ssh
Next, let Git know the location of your private SSH signing key. For example:
git config --global user.signingkey ~/.ssh/my_signing_key
my_signing_key.pub file somewhere for future access.
You will use it to create a signed succession.