I am facing a strange situation where I am using gitlab account to handle my code. I am using ssh protocol to access the repo. I am able to pull the code but I am receiving the following error while I try to push the code. This could be something silly on my side. But I have the keys stored in my gitlab profile and able to use it to pull the code.
Error :
$ git push origin master
key_load_public: invalid format
Enter passphrase for key '/c/Users/username/.ssh/id_rsa':
Access denied.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
So, the OpenSSH private key format ultimately contains a private key encrypted with a non-standard version of PBKDF2 that uses bcrypt as its core hash function. The structure that contains the key is not ASN. 1, even though it's base64 encoded and wrapped between header and footer that are similar to the PEM ones.
Use the same ssh key across applications No need to make complicated ~/. ssh/config files; just give each GitHub/GitLab account the same public key and you're done.
Log into GitLab and click on your account preferences. Click the SSH Keys link and paste the copied value into the text field. Set an expiration date, and then click the blue button to persistently add the GitLab SSH key. Configure GitLab SSH keys under your account preferences.
The SSH stands for Secure Shell or Secure Socket Shell used for managing the networks, operating systems and configurations and also authenticates to the GitLab server without using username and password each time. You can set the SSH keys to provide a reliable connection between the computer and GitLab.
Finally I have been able to resolve this issue and I am posting it for other users. If the keys generated by putty is not helping you to access the gitlab repo, try generating the keys from gitbash terminal using the command ssh-keygen
and save the files in .ssh
folder of your user account.
The linux style key generation made my life easy as I was trying to generate key in windows environment with putty keygen.
Hope this helps somebody.
PuTTYGen can generate the correct OpenSSH keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With