I have gone through many other posts about the above error, but they all seem to be for a different OS, or for some different reason.
I am running Windows 8.1. I have git installed (I am very new to git), and have signed up to gitlab, create a project there, created and added the key (as per instructions), however when I try and do a push, I get the
Pushing to git@gitlab.com:myusername/Test1.git
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Now when I created my ssh key using
ssh-keygen -t rsa -C "myemail@gmail.com
it did create the files in the local project folder, and not under C:\Users\Peter (my home folder)
So, copied the single file (known_hosts) I deleted the existing .ssh folder, and created using bash, and then copied in the above together with the created id_rsa.pub and idrsa.key files.
From Git Gui, if I go to Help | Show SSH Key is reports "Found a public key in ~/.ssh/id_ras.pub
From bash, my permissions on the folder are.
drwxr-xr-x 1 Peter Administ 0 Jun 14 09:35 .ssh
and the permissions on the files within are..
$ ls .ssh -l
total 2
-rw-r--r-- 1 Peter Administ 403 Jun 13 18:26 id_rsa.pub
-rw-r--r-- 1 Peter Administ 1766 Jun 13 18:26 idrsa.key
-rw-r--r-- 1 Peter Administ 184 Jun 13 18:11 known_hosts
I am assuming I need to fix the permissions here?
So I go into the .ssh folder and try a chmod 777 *
But then when I use ls -l to see the permissions they have not changed
Likewise when I try that on the actual directory .ssh, permissions stay as they are
So, the questions are
- Am I on the right track here, is it the permissions of the folder/files that are the problem
- If so, how can I fix this (on Windows 8.1)
I am at a complete loss of what to try next
Thanks in advance for any help!