---
# System prepended metadata

title: Git SSH Key - Panascais Code Documentation
tags: [' ssh', code, ' git']

---

---
title: Git SSH Key - Panascais Code Documentation
tags: code, git, ssh
robots: noindex, nofollow
lang: en
---

# Add a SSH Key to your Account

## About SSH Keys

Every user who wants to make changes to a Git repository using his local computer needs an SSH key linked to the Gitlab. With this key your computer can authenticate itself with our Gitlab.

An SSH key consists of a public and a private key. The public key can be compared to a lock and the private key to an actual key.

Our Gitlab, as well as any other platform, will in all cases only have access to your public key, i.e. the lock. Your computer will use your private key and try to open the lock with it. If the key and the lock are compatible, our Gitlab will authorize your computer.

SSH keys act as a replacement to the username/password combination for your account, as the password should never be stored in clear text on your device.

## Requirements

You must already have a Gitlab account and your work environment set up. These steps are also explained in this documentation.

## Create a SSH key

1. Open a terminal. Use **Git Bash** for Windows or the **Terminal** / **iTerm** for macOS.
2. Type `ssh-keygen -t ecdsa -C "<your-email>"` and replace the `<your-email>` placeholder with your personal business email address.
Hit <kbd>ENTER</kbd> to confirm. The output should look like this:
![](https://i.imgur.com/jzeA4fh.png)
3. Don't enter a new filename, skip this step by hitting <kbd>ENTER</kbd> again.
4. You'll be asked for a passphrase. We recommend to skip this step by hitting <kbd>ENTER</kbd> twice.

Your key should be generated now. Keep your terminal window opened and continue with the next step.

## Link the key to your Git account

1. Automatically copying the SSH key:
   - If on **Windows**: Type `cat ~/.ssh/id_ecdsa.pub | clip` into your terminal and confirm by hitting <kbd>ENTER</kbd>. You can copy this command from the browser and <kbd>RIGHT-CLICK</kbd> your mouse in Git Bash to paste on **Windows**
   - If on **macOS or Linux**: Type `cat ~/.ssh/id_ecdsa.pub | pbcopy` into your terminal and confirm by hitting <kbd>ENTER</kbd>. You can copy this command from the browser and <kbd>CMD + V</kbd> to paste on **macOS or Linux**
2. Open [lab.panascais.net/-/profile/keys](https://lab.panascais.net/-/profile/keys) in your browser
3. Paste the copied SSH Key into the large textarea
   > The previous command already copied the key for you, you just need to paste it 
   
   ![](https://i.imgur.com/CmVTAfb.png)
4. Choose a title for your key and confirm by clicking the blue <kbd>Add Key</kbd> button.

## Result
Your SSH key is now known to Gitlab and you can start installing and working with repositories locally.