Sign up ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I was following the Github tutorial and I generated a new SSH key pair. But now when I'm online, Google keeps throwing up SSL errors (and so does everywhere else with SSL, for that matter). What terminal commands do I need to input in order to return to my original SSH key pair?

share|improve this question
Can you be more specific about SSL errors? Your browser shouldn't be using your ssh keys in ~/.ssh for anything related to surfing the web (or really anything related to the browser at all). – Ian C. Mar 6 '12 at 20:08

1 Answer 1

Note: I actually think your browser SSL errors are not at all related to the fact that your generated a new keypair for ssh use in your ~/.ssh directory. Browsers don't use these keys, only ssh uses these keys (and things that are based around libssh).

But if you want to restore the previous version of your keypair here are the two ways you can do it....

Assuming you followed step 2 in that github document, you can just restore your backed-up keys:

cd ~/.ssh
rm id_rsa*
cp key_backup/* .

That will delete the new keys you created and then restore your old keys.

If you didn't backup your original keys according to that document you can try to use Time Machine to find the previous version of your keys and restore them.

First open a Finder window and then hit Cmd-Shift-G to bring up the Go To box. In the box type: ~/.ssh and press the Go button.

Go To ~/.ssh

Switch to column view so you can see the details of the files in the ~/.ssh directory and note the Date Modified time on the id_rsa and files.

Switch to column view so you can see the Date Modified meta-data on the files

Now enter Time Machine by clicking on the Time Machine icon in the upper right hand corner of the menu bar and selecting 'Enter Time Machine':

Enter Time Machine

Step backwards in time until you find the point where Date Modified time stamps on those two files change. That should be the previous version of those files. Select the id_rsa and files from this point in time and restore them overtop of the existing files.

share|improve this answer
Thanks Ian for the great answer. An update: I restarted my router and now everything works. It's weird about the timing... everything broke when I changed the SSH keys. But it's working now. Thanks again. – Dan Mar 6 '12 at 21:43
@Dan if a router restart helped I suspect your DNS may have been poisoned. I'd take a look at your router security. Maybe change the password. It sounds like your encrypted https connections were being routed through a proxy that was serving up a bogus SSL certificate. – Ian C. Mar 6 '12 at 22:17
@Dan also: how about an accept on the answer? It does answer the "how to restore my old ssh keys", right? :) – Ian C. Mar 6 '12 at 22:31

Your Answer


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.