Server Fault is a question and answer site for system and network administrators. 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 have been using SSH alot. I find myself creating new keys when something fails, like for git, then I lose communication to my other servers. I know going forward there should only be one set of locally generated keys, but for now, I need to merge the many /.ssh backups I've made so they can all be used simultaneously. How can I do this?

share|improve this question
up vote 3 down vote accepted

It is permissible to list many keys in your ~/.ssh/config. Or you can add many keys to an SSH agent.

Host *
    IdentityFile ~/.ssh/zoredache_20101108.id_rsa
    IdentityFile ~/.ssh/zoredache_20100211.id_rsa
    IdentityFile ~/.ssh/zoredache_20080514_id_rsa
share|improve this answer

In your ~/.ssh/config file try:

Host A
    IdentityFIle ~/.ssh/

Host B
    IdentityFIle ~/.ssh/

Host C
    IdentityFIle ~/.ssh/

A session setup only allows 3 authentication attemps before the connection is dropped. Think of that as a 3 ID file limit. With the above, you can ssh to host A and it will use just that ID file. ssh to host B and it uses a different one, and so on.

share|improve this answer

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.