I’m using vagrant 2 on OS X Mountain Lion.
Vagrant.configure("2") do |config|
config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true
end
config.ssh.private_key_path
is your local private key- Your private key must be available to the local ssh-agent. You can check with
ssh-add -L
, if it’s not listed add it withssh-add ~/.ssh/id_rsa
- Don’t forget to add you public key to
~/.ssh/authorized_keys
on the Vagrant VM. You can do it copy-and-pasting or using a tool like ssh-copy-id