Roots Discourse

Too many authentication failures while vagrant ssh

I’m trying to ssh in to my VM example.test with ssh vagrant@example.test. This throws me this error: Received disconnect from port 22:2: Too many authentication failures Disconnected from port 22
I think this sounds like to many ssh-keys are being tried - probably because the id_rsa keyfile is being used. So I would like to direct ssh vagrant@example.test to the one and only ssh key it needs. How can I do this?

I’m aware of the vagrant ssh command, but as I want to make the sync script from @benword work, I need to make the normal ssh work.

I tried ssh -i /path/to/my/ vagrant@example.test but it throws the same error.

Any ideas?

Ok, I got this solved by adding this to `~/.ssh/config on my local machine:

Host example.test
  IdentityFile /path/to/my/ 

This will offer ssh the correct keyfile and also restrict it not try any other key (which it will do by default).