[2023] How to set up your SSH key for GitLab on macOS

One of the most common issues while getting started with Git and GitLab is setting up the private and public keys.

Valentin Despa
DevOps with Valentine

--

Last updated: February 2023

Background

The most common error you may get when trying to clone a Git repository over SSH is this one:

git@gitlab.com: Permission denied (publickey,keyboard-interactive). fatal: Could not read from remote repository.

What is SSH?

SSH is a way to authenticate without exposing your username and password.

SSH stands for Secure Shell and is a cryptographic protocol based on the concept of public-private keys.

We are using SSH with Git because it is much easier than typing your username and password all the time, and it is also more secure.

You have probably noticed that GitLab is complaining that you don’t have an SSH key.

You won’t be able to pull or push repositories via SSH until you add an SSH key to your profile

--

--

Valentin Despa
DevOps with Valentine

Software developer, educator & overlander • GitLab Hero • AWS Community Builder • Postman Supernova • Imprint: http://vdespa.com/imprint