Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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:

Host YourEC2host.com 
    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

 
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.