An SSH keypair is required in order to access repositories on Gitlab. This article describes the process to generate a keypair and upload it to the Gitlab server.
Key Generation on Windows
SSH keys are created as a part of the Configure Git script on Windows workstations. From the Start menu, navigate to Git -> Configure Git.
When the script completes, a window shows the public key. The key is also copied to the clipboard, so you may dismiss this window.
Key Generation on Linux and MacOS
Open a Terminal and run the following commands
someuser@mackerel:[0]:~$ ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/someuser/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/someuser/.ssh/id_ed25519
Your public key has been saved in /Users/someuser/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:+Vz7BtBBJhc2PO9vat3IZ+dvaUZ3qsGy2cMGg3iIzd8 someuser@mackerel
...
someuser@mackerel:[0]:~$ cat .ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFGMRW7gZ9C6LW2HbY1feTBMjzZ4nIuhegfeEOeJ09qN someuser@mackerel
Copy the public key contents to the clipboard.
Adding SSH keys in Gitlab
To add the key to GitLab, go to https://gitlab.walleyetrading.net/-/user_settings/ssh_keys. Login using the "LDAP1" tab (default) with your network credentials.
There will be a box for you to paste the public key from the clipboard. If the expiration date field has a value, remove it by clicking the X icon. Finally, click Add key.
If this is your first time logging-in to GitLab, it may take up to an hour before your group memberships are synchronized, and you are able to clone repositories.