I seem to have lost my permissions to a github account after pushing to it from another (local) repository. I am now receiving the following error:
git push
Permission denied (publickey).fatal:
The remote end hung up unexpectedly
I then took the following steps to regenerate a key:
ssh-keygen
Set up an ssh on my account for this laptop, using id_rsa.pub
However, this was unsuccessful. When I try the following code suggested, I receive the following error:
ssh-add -l
Could not open a connection to your authentication agent.
Any thoughts?
If you already have a public key in ~/.ssh (and have already added that key to your github account), you might only have to load your key into the SSH agent again.
To test if the SSH agent has the key, type
ssh-add -l
If the result is:Then simply load your key into the SSH agent like this:
(github_rsa is the name on my machine for the stored SSH key. This file can, among others, also be named: id_rsa)
After that you have to enter your passphrase for the key (this is likely your password to log into github). If you get a message like this:
You have to export your key on the server with the command
and
ssh-agent
should run before your ssh-add. You can put this line in/etc/rc.local
if you are under Linux :Edit: now I know you use windows, so see this thread : Getting ssh-agent to work with git run from windows command shell
I solved this problem following this step-by-step instructions:
Step 1: Check for SSH keys
Step 2: Backup and remove existing SSH keys
Step 3: Generate a new SSH key
Step 4: Add your SSH key to GitHub
Then, go to hithub, and do:
Step 5: Test everything out
If ok, you'll see
Otherwise (it happened with me), you will see
To solve this
For original info
https://help.github.com/articles/generating-ssh-keys
https://help.github.com/articles/error-agent-admitted-failure-to-sign
Doing an
$ ssh-add
This worked for me to resolve the following as well for gitlab