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 192.168.50.5 port 22:2: Too many authentication failures Disconnected from 192.168.50.5 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/example.com/trellis/.vagrant/machines/default/virtualbox/private_key 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/example.com/trellis/.vagrant/machines/default/virtualbox/private_key 
  IdentitiesOnly=yes

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