$ sudo apt-get install ssh
The ssh protocol (Secure Shell) is a cryptographic protocol to log into remote server, calling remote commands, copy data to a server and more. It’s often used to operate in environments without a desktop like our brick.
Installing ssh is pretty straight forward.
Most distributions come with ssh already installed. If it’s not installed you can install it via command line:
$ sudo apt-get install ssh
On some distributions the package is called open-ssh.
If you don’t use a Debian based Linux distribution you may have to use another packet manager.
macOS has a built-in ssh client.
This method is recommended, because it works system-wide and in any command line interface.
You can install a native ssh client provided by Microsoft.
To install open
Settings > Apps > Optional features > Add a feature > OpenSSH Client
If you want to use the WSL you may use the provided instructions for Linux.
The Windows Subsystem for Linux (WSL) is a Linux VM running parallel to your Windows installation. You can install it by following these instructions.
The GitBash has a built-in ssh client. Note that it is only fully functional when using GitBash and not in cmd, Powershell nor other command line interfaces (this includes the default Terminal in VSCode). This means for every task that involves using ssh (eg. cloning with ssh, deploy-script…) you need to use the GitBash. If you’re not using the WSL chances are you will need to install the GitBash anyway to use Git.
An ssh-key is used for authentification when using ssh.
In other words by setting up a key and configuring the server you don’t need to enter a password to login anymore.
To generate a key open a command line and run
The first thing this command will ask for is a location.
If you never worked with ssh-keys before it’s fine to leave it blank and use the default location.
If you already have used a ssh-key change the location because else the old key eventually will be overwritten.
The other thing is a passphrase. You can set one but then you will also need to use it every time you use the key. So it’s ok to leave that blank too.
After that you key is generated.
To use the git clone command with ssh you need to add your public ssh key to your Gitlab account.
First you need to get your public key. Find the path you used in the key generation and the key with the .pub ending.
The default path is
~/.ssh/id_rsa.pub on Linux and macOS or
C:\Users\your username\.ssh\id_rsa.pub on Windows.
Open the file in a text-editor and copy everything. Then proceed with the next step.
Visit Settings > SSH Keys
Paste your previously copied key in the text field. The name and expiration date are optional.
Hit Add key and you’re done!