fix: update instructions for adding custom key path in ssh-keygen (#535)

This commit is contained in:
ninthcircle 2025-02-22 19:26:25 +05:30
parent 9cbd248f4c
commit 8649e50afa
No known key found for this signature in database

View file

@ -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 <kbd>n</kbd> 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