Gitlab key format issue

I fixed my error by regenerating my public key (id_es.pub) from my private key (id_es) :

ssh-keygen -f ~/.ssh/id_es -y > ~/.ssh/id_es.pub

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.

  1. Generate your key file, save the private key (with or without a passphrase)
  2. Add your username/email address as the comment
  3. Copy the contents of the generated key and paste it into your id_rsa.pub
  4. Export the OpenSSH private key using the menu and save it as id_rsa

Export OpenSSH Key