From ffaa480a89285ab470590cc69c6392bcbe070054 Mon Sep 17 00:00:00 2001 From: Eliott Sammier <eliott.sammier@tetras-libre.fr> Date: Thu, 23 May 2024 13:37:42 +0000 Subject: [PATCH] Update README.md: add instructions for SSH keys --- README.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4b0f6ea..689771b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,35 @@ SSH and GPG public keys for Tétras Libre collaborators +[[_TOC_]] + +# SSH +SSH is used for Git access, among other things. +## Creating SSH key +```sh +ssh-keygen -t ed25519 -f ~/.ssh/<your-name>_ed25519 +``` +If necessary, you can use the traditional RSA key type, instead of Ed25519, just use `-t rsa` instead and `<your-name>_rsa` for the key name. + +From the [Arch Linux wiki page](https://wiki.archlinux.org/title/SSH_keys#Generating_an_SSH_key_pair): +> You can also add an optional comment to the public key with the `-C` switch, to more easily identify it in places such as `~/.ssh/known_hosts` [...]. For example: +```sh +-C "$(whoami)@$(uname -n)-$(date -I)" +``` +> will add a comment saying which user created the key on which machine and when (like `user@machine-2023-08-14`) + +## Adding key to the repo +Simply copy your key from `~/.ssh/` to the repo's `SSH` folder. +**Be careful to add the `.pub` key and not your private key!** + + # GPG GPG is used for [pass](https://gitlab.tetras-libre.fr/tetras-libre-admin/pass) -## Creating gpg key -`gpg --generate-key` -follow dialog +## Creating GPG key +```sh +gpg --generate-key +``` +and follow dialog. ## Add key of Tétras Libre collaborators To import a gpg key, use `gpg --import <key file>`. To import all keys, go to GPG folder and use `gpg --import *` -- GitLab