How to Fix git@gitlab.com: Permission denied (publickey,keyboard-interactive)

git@gitlab.com: Permission denied error occur because git has no proper identification of your system

Gitlab is a popular Git client for use with your local and remote server. Errors are common while using git commands, today, I’m sharing a fix for the key permission error that occurred when i attempt to push to my remote server using Gitlab.

Also read: How to fix Access-Control-Allow-Origin (CORS origin) Issue

The problem

When you try to clone private repositories for the first time from an account, you may get following error.

git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

This is because git has no proper identification of your system so when you try to push changes it returns this error. To fix this issue you should add the identity of your system to GitLab website as an SSH key.

BTW what is SSH?

SSH, also known as Secure Shell or Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.

Okay Cool. Now how to fix ?

Well, i will share a summary below and will work perfectly fine for me.

Go to .ssh folder in Windows

C:/users/username/.ssh

Hold SHIFT and right-click anywhere window and select Open Powershell window here or you can typing cmd in the address bar and ENTER will also open command prompt.

Type ssh-keygen

Press enter.

It will ask you to save the key to the specific directory. (type your preferred key name)

Press enter. It will prompt you to type a passphrase or enter without a passphrase.

The public key will be created for the specified directory.

You’ll see your key files in the .ssh folder. Open it on the notepad. Copy all text from it.

Note: If you provide a key name then two files will be generated with that name. If you didn’t provide a key name then id_rsa.pub will be generated by default.

Go to https://gitlab.com/profile/keys .

Paste here in the “key” text field.

Now click on the “Title” below. It will automatically get filled.

Then click “Add key”.

Now give it a shot and it will work for sure.

By Shahas Nizar

A passionate blogger and a tech enthusiast who is always keen and awaiting to know about fully fledged new technologies who's currently using iPhone 12 as a part of daily routine. You can spot me @ #facebook, #twitter & #Google +

Leave a Reply