diff --git a/content/security/ssh-key.md b/content/security/ssh-key.md index f0a26f3..9428fce 100644 --- a/content/security/ssh-key.md +++ b/content/security/ssh-key.md @@ -31,6 +31,18 @@ It is recommended to use one key per client. This means that if you access your > Enter file in which to save the key (/home/knut/.ssh/id_ed25519): [Press enter] ``` + If you see that `/home/knut/.ssh/id_ed25519 already exists`, follow these steps: + + 1. When prompted to overwrite the existing file, type n to choose not to overwrite. + + 2. Afterward, re-run the same command: + + ```shell + ssh-keygen -t ed25519 -a 100 + ``` + + 3. This time, enter a new filepath when prompted (e.g., `~/.ssh/id_ed25519_codeberg`) to avoid overwriting the existing key. + 4. You will be asked for a passphrase; enter one if you'd like, or leave the prompt empty. Your private key can be protected by a passphrase. This adds a layer of authentication that increases security. Be aware that this will only be helpful for certain attack scenarios and does not offer 100% protection. It is recommended to keep your private key safe and - well - private. @@ -95,6 +107,15 @@ Keep in mind that now, every time you wish to use Codeberg over SSH, you must ha ## Test the SSH connection +If you are using a custom path, add an entry in your `$HOME/.ssh/config` file: + +```config +Host codeberg.org + HostName codeberg.org + User git + IdentityFile ~/.ssh/id_ed25519_codeberg +``` + Do this simple test: ```shell