diff --git a/external/contribute/ssh-key-generation/img/key-details.png b/external/contribute/ssh-key-generation/img/key-details.png new file mode 100644 index 0000000000000000000000000000000000000000..a663151b4468f276f5d1ade6893c8b413cdc327d Binary files /dev/null and b/external/contribute/ssh-key-generation/img/key-details.png differ diff --git a/external/contribute/ssh-key-generation/img/new-key.png b/external/contribute/ssh-key-generation/img/new-key.png new file mode 100644 index 0000000000000000000000000000000000000000..91e7e30d63166cf37dccec66250e7613fc1aa646 Binary files /dev/null and b/external/contribute/ssh-key-generation/img/new-key.png differ diff --git a/external/contribute/ssh-key-generation/img/preferences.png b/external/contribute/ssh-key-generation/img/preferences.png new file mode 100644 index 0000000000000000000000000000000000000000..bc428028a9d2761205aa1f1de0a347bff01b544e Binary files /dev/null and b/external/contribute/ssh-key-generation/img/preferences.png differ diff --git a/external/contribute/ssh-key-generation/img/ssh-menu.png b/external/contribute/ssh-key-generation/img/ssh-menu.png new file mode 100644 index 0000000000000000000000000000000000000000..453da79e763cf5b82a472c8d72aea2d6f3553347 Binary files /dev/null and b/external/contribute/ssh-key-generation/img/ssh-menu.png differ diff --git a/external/contribute/ssh-key-generation/ssh-key-generation.md b/external/contribute/ssh-key-generation/ssh-key-generation.md new file mode 100644 index 0000000000000000000000000000000000000000..c3a7a9868bcaa2ea30dae67a7cb057991b2d3ae6 --- /dev/null +++ b/external/contribute/ssh-key-generation/ssh-key-generation.md @@ -0,0 +1,82 @@ +--- +layout: page +permalink: /external/contribute/ssh-key-generation/ +shortcut: contribute:ssh-key-generation +redirect_from: + - /cards/contribute:ssh-key-generation + - /external/cards/contribute:ssh-key-generation + - /contribute/ssh-key-generation + - /external/external/contribute/ssh-key-generation/ +--- + +# Key-based Authentication + +Key-based authentication allows GitLab users to identify their device once on their account and avoid having to log in via their credentials every time. GitLab uses SSH protocol to communicate with Git. + +SSH uses a public and a private key. The public key must be registered to GitLab, make sure you **do not upload your private key**. + +# Prerequisites + +To use SSH one of the following must be installed: + +- The OpenSSH client, which comes pre-installed on GNU/Linux, macOS, and Windows 10. +- SSH version 6.5 or later. Earlier versions used an MD5 signature, which is not secure. + +To view the version of SSH installed on your system, run the following command on your terminal (on Linux or macOS) or Git Bash (on Windows) + +``` +ssh -V +``` + +# Key Generation + +1. Run the terminal + +2. Type the following command at the command prompt and run it after replacing your firstname and lastname: + + ``` + ssh-keygen -t ed25519 -C firstname.lastname@uni.lu + ``` + +3. Accept the suggested filename and directory + +4. Press `Enter` to continue. Defining a password is not necessary + +5. To copy the contents of your public key file, run the following command: + + - For macOS: + ``` + tr -d '\n' < ~/.ssh/id_ed25519.pub | pbcopy + ``` + - For Windows: + ``` + cat ~/.ssh/id_ed25519.pub | clip + ``` + +# Saving the SSH Key on GitLab + +Once the content of the public key is copied, it must be saved to your GitLab account. + +To save your key to your account: + +1. Log in to your GitLab account + +2. Navigate to the `Preferences` menu + + + +3. User settings will be displayed on the left-hand side menu. Click on the "SSH Keys" option + + + +4. On the `SSH Keys` page, click on `Add new key` button to add your public key + + + +5. Paste your new key into the `Key` box, name the key and save it by clicking the `Add key` button + + + +# Troubleshooting + +Please refer to the [GitLab Docs](https://service.uni.lu/sp?id=sc_cat_item&table=sc_cat_item&sys_id=c1d98bacdb9cf810ca53454039961917) or [create a ticket](https://service.uni.lu/sp?id=sc_cat_item&table=sc_cat_item&sys_id=c1d98bacdb9cf810ca53454039961917) for further assistance regarding the key-based authentication.