Fix some difficult to read text in the section on generating SSH keys (#764)

I’ve largely put down the torch of software development, but I use Codeberg for Nix and it feels wrong to use it without at least helping in some way.

Some language in the SSH key section can be easily misrepresented by skimming (e.g. the command to generate the key twice can lead newbies to maybe think they’d have to generate a public and private key seperately.)

Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/764
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
emholt1 2026-06-25 11:27:00 +02:00 committed by Robert Wolff
parent 0c98b55b39
commit e5f59881ed
2 changed files with 10 additions and 14 deletions

View file

@ -112,6 +112,7 @@
"mstruebing", "mstruebing",
"davidanson", "davidanson",
"pipelinecomponents", "pipelinecomponents",
"passwordless",
"corepack", "corepack",
"letsencrypt.org", "letsencrypt.org",
"accounturi", "accounturi",

View file

@ -6,6 +6,7 @@ eleventyNavigation:
order: 20 order: 20
--- ---
In comparison to using HTTPS, SSH keys provide a safer and passwordless way to authenticate with Codeberg.
It is recommended to use one key per client. This means that if you access your Codeberg repository from your home PC, It is recommended to use one key per client. This means that if you access your Codeberg repository from your home PC,
your laptop and your office PC you should generate separate keys for each machine. your laptop and your office PC you should generate separate keys for each machine.
@ -22,6 +23,8 @@ your laptop and your office PC you should generate separate keys for each machin
This will generate a new SSH key. This will generate a new SSH key.
You can also add a comment to help you identify the client with `-C "comment here"`. You can also add a comment to help you identify the client with `-C "comment here"`.
The program may also ask for a name and email address to associate with the key. While it is recommended to fill in something identifiable here, if you don't wish to, it may safely be left blank. These fields are for organizational purposes.
```shell ```shell
> Generating public/private ed25519 key pair. > Generating public/private ed25519 key pair.
``` ```
@ -36,13 +39,7 @@ your laptop and your office PC you should generate separate keys for each machin
If you see that `/home/knut/.ssh/id_ed25519 already exists`, follow these steps: 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. 1. When prompted to overwrite the existing file, type <kbd>n</kbd> to choose not to overwrite.
2. Afterward, re-run the same command: 2. Afterward, re-run the same command. This time, enter a new filepath when prompted (e.g., `/home/knut/.ssh/id_ed25519_codeberg`) to avoid overwriting the
```shell
ssh-keygen -t ed25519 -a 100
```
3. This time, enter a new filepath when prompted (e.g., `/home/knut/.ssh/id_ed25519_codeberg`) to avoid overwriting the
existing key. existing key.
4. You will be asked for a passphrase; enter one if you'd like, or leave the prompt empty. 4. You will be asked for a passphrase; enter one if you'd like, or leave the prompt empty.
@ -76,8 +73,9 @@ be prompted to touch it to continue.
1. Copy the SSH key to your clipboard. You must only copy the public key not the private one. 1. Copy the SSH key to your clipboard. You must only copy the public key not the private one.
You can identify it by the `.pub` suffix. By default, you can find the public key in `$HOME/.ssh/id_ed25519.pub`. You can identify it by the `.pub` suffix. By default, you can find the public key in `$HOME/.ssh/id_ed25519.pub`.
On Linux, assuming you are using Wayland, you can use `wl-copy` on the command line. The key can be opened with any text editor and copied from there. However, there are other ways to copy the key from the terminal.
You may need to install `wl-clipboard` from your package manager.
On Linux with Wayland, use the `wl-copy` utility. (This may require an installation of the `wl-clipboard` package):
```shell ```shell
wl-copy -t text/plain < ~/.ssh/id_ed25519.pub wl-copy -t text/plain < ~/.ssh/id_ed25519.pub
@ -101,12 +99,9 @@ be prompted to touch it to continue.
pbcopy < ~/.ssh/id_ed25519.pub pbcopy < ~/.ssh/id_ed25519.pub
``` ```
These commands will copy the contents of id_ed25519.pub (your SSH public key) to your clipboard. These commands will copy the contents of `id_ed25519.pub` (your SSH public key) to your clipboard.
> Alternatively you can locate the hidden .ssh folder, open the file in your favorite text editor, and copy it to 2. Navigate to your [user settings](https://codeberg.org/user/settings).
> your clipboard.
2. Navigate to your [user settings](https://codeberg.org/user/settings)
<img src="/images/security/user-settings.png" alt="User Settings"> <img src="/images/security/user-settings.png" alt="User Settings">