Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 setup a config file located at "~/.ssh/config" which contains some IdentityFile lines to point to the key files that I use for some of my servers.

e.g. IdentityFile ~/Data/Keys/KeyFile.pem

This works fine when I want to connect to my servers on ec2 which require a key file for authentication.

When I want to connect to a server that does not use a key file and requires a password ssh tries to use my key files in ~/.ssh/config and the connection fails with:

Received disconnect from host.ip: 2: Too many authentication failures for root

Is there a ssh command argument that I can use to connect to this server so that ssh does not try to use my identity files?

share|improve this question
up vote 4 down vote accepted

You should be able to limit the use of the IdentityFile lines to your EC2 host with the host statement:

    IdentityFile ~/Data/Keys/KeyFile.pem

For more information, see the section about the host section in the ssh_config man page.

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.