Question
Unable to git pull with SSH - Works with HTTPS
I’m stuck using https for git pulls… I have tried to switch to ssh but every time I try to add my identity, I get a “Could not open a connection to your authentication agent”.
I tried creating many keys and adding them to git but to no avail. I’m turning to the forums to get some guidance
sudo git pull
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I’m on ubuntu 16.04
These are the contents of my ~/.ssh/
-rw------- 1 macrandle macrandle 744 Nov 8 07:40 authorized_keys
-rw-rw-r-- 1 macrandle macrandle 120 Mar 23 06:18 config
-rw------- 1 macrandle macrandle 3326 Nov 8 08:02 id_rsa
-rw-r--r-- 1 macrandle macrandle 743 Jan 13 22:19 id_rsa.pub
-rw------- 1 root root 3326 Mar 23 00:17 id_rsa_work
-rw-r--r-- 1 root root 743 Mar 23 00:17 id_rsa_work.pub
-rw-r--r-- 1 macrandle macrandle 2652 Jan 13 22:29 known_hosts
I’m trying to add idrsawork and my keys are added to my github account
I have tried
eval $(ssh-agent)
and then
sudo ssh-add ~/.ssh/id_rsa_work
this leads to “Could not open a connection to your authentication agent”
Any help would be great.
Cheers
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×