Each time I want to pull or push to a remote Gitlab repository, it gives me the following error:
**> sign_and_send_pubkey: signing failed: agent refused operation
Permission denied (publickey). fatal: Could not read from remote repository.**
I have tried to deal with this error, and the only way I found to solve it, but temporarely, is to use the command:
> eval $("ssh-agent")
The problem is that each time I want to push/pull to Gitlab, I must use this command, which is not normal.
Why is this and how can I definitely solve it ?
PS: I'm in ubuntu 16.04.6. and I am sure I added my ssh-key to Gitlab correctly.
Thanks for your time.
11 Answer
You might have not added your private key to the ssh agent. To do so use these commands:
eval $(ssh-agent)
ssh-add ~/.ssh/id_rsa