Skip to content

Instantly share code, notes, and snippets.

@RRRCHINO94
Forked from mvneves/ssh-agent.md
Created April 9, 2023 23:04
Show Gist options
  • Save RRRCHINO94/24e30c78faeaa9a5256a7d9811364d64 to your computer and use it in GitHub Desktop.
Save RRRCHINO94/24e30c78faeaa9a5256a7d9811364d64 to your computer and use it in GitHub Desktop.
"Could not open a connection to your authentication agent"

SSH authentication agent does not automatically start when using it from a remote server. This results in the following error message:

$ git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
$ ssh-add ~/my-ssh-key.pem
Could not open a connection to your authentication agent.

To fix it requires manually starting ssh-agent:

$ eval `ssh-agent -s`
Agent pid 13442
$ ssh-add ~/my-ssh-key.pem
Identity added: /home/user/my-ssh-key.pem (/home/user/my-ssh-key.pem)
$ git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment