Connect to gitlab by ssh (Linux)

Preparation – Linux computer

First of all, a ssh key is required. Generate a key par with this command:

ssh-keygen -t rsa -b 4096 -C ""

The key pair should be located here:


Copy the content of the public key file:

Configure gitlab

Login with your user and go to Settings -> SSH Keys and paste the content of the public key in the intended input field and click “Add key”

Testing the connection

ssh -T
Welcome to GitLab, @your_username!