Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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] ( however i have not been able to figure it out.

$ ssh -vT 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, and cat known_hosts yields:, 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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .