Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was playing about with ssh keys, and stupidly deleted the github keys in my .ssh folder.

Now i get

Error: Permission denied (public key)

When i try and connect to a remote repo.

I have looked through the help page provided by [github] (https://help.github.com/articles/error-permission-denied-publickey) however i have not been able to figure it out.

$ ssh -vT git@github.com yields:

debug1: No more authentication methods to try. Permission denied (publickey).

ssh-add -l yields:

The agent has no identities.

in ~/.ssh/ i no longer have github_rsa or github_rsa.pub, and cat known_hosts yields:

github.com,204.232.175.90 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==

I think the problem is with the keys, and that re-generating them may fix the problem -- but i am not sure. Is it possible to regenerate these keys?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Yes, you can create new keys for github.

In your accounts page, select 'SSH Keys'. I'd delete the old public key and add the new public key. Then use your private key to try connecting.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.