firstname.lastname@example.org: 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.
When you try to clone private repositories for the first time from an account, you may get following error.
email@example.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
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.
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.