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 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.
3. If you have set one on your key, you'll be prompted for your FIDO2 PIN. Enter it to continue
4. When you're prompted to "Enter a file in which to save the key", press <kbd>Enter</kbd>. This accepts the default file location.
5. You will be asked for a passphrase; enter one if you'd like, or leave the prompt empty.
Keep in mind that now, every time you wish to use Codeberg over SSH, you must have your security key plugged in and will 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. You can identify it by the `.pub` suffix. By default, you can find the public key in `$HOME/.ssh/id_ed25519.pub`.
_Note: All Codeberg users share a single Unix user named `git` which is used to check out repositories. Depending on the key provided, permission is granted or denied. You can check out all repositories with your key which you have permission for. You can push code to all repositories where you have write access._
Every keypair consists of a public and a private key that are connected to one another. Using this private key, you can sign the provided message. If the signed message is valid, Codeberg can confirm that the added key is yours.
3. Type `git config --global user.signingKey <PATH TO SSH KEY>`, substituting `<PATH TO SSH KEY>` with the path to the key you'd like to use, for example _~/.ssh/id_ed25519_.
Assuming you've created a secure key with a passphrase, SSH will prompt you for your passphrase for every connection. Common desktop environments like macOS or GNOME will offer you to cache your passphrase via an SSH agent.
Your HTTPS URL used this format: `https://codeberg.org/<user>/<repo>.git`
The SSH URL uses this format: `git@codeberg.org:<user>/<repo>.git` (optionally with `ssh://` at the beginning like this: `ssh://git@codeberg.org:<user>/<repo>.git`).
Alternatively, you can find the SSH URL by going to your repository page on Codeberg (for example, going to `https://codeberg.org/knut/foobar`), clicking on SSH in the top right corner and copying the URL.