This is a follow-up question to an earlier question. I've used the same Vagrantfile, but have commented out two lines I don't think are necessary.
I'm trying to ssh into my Vagrant box without using vagrant ssh
. Below is my Vagrantfile and ssh configuration information:
Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 6144
v.cpus = 2
v.name = "mb_vagrant"
end
config.vm.box = "ubuntu/trusty64"
config.vm.network :private_network, ip: "192.168.33.10"
config.ssh.forward_agent = true
# config.vm.provision :shell, path: "bootstrap.sh"
# config.vm.network :forwarded_port, host: 8001, guest: 8001
end
The output from vagrant ssh-config
:
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "/Users/mbigras/Google Drive/tmp/chef-repo/.vagrant/machines/default/virtualbox/private_key"
IdentitiesOnly yes
LogLevel FATAL
ForwardAgent yes
I've tried ssh
ing into my machine with the following command:
$ ssh -i "/Users/mbigras/Google Drive/tmp/chef-repo/.vagrant/machines/default/virtualbox/private_key" -p 2222 [email protected]
ssh: connect to host 192.168.33.10 port 2222: Connection refused
Also, as per the solution described in another answer, I've tried removing ~/.ssh/known_hosts
before attempting to connect; however, it also doesn't work:
$ rm ~/.ssh/known_hosts
$ ssh -i "/Users/mbigras/Google Drive/tmp/chef-repo/.vagrant/machines/default/virtualbox/private_key" -p 2222 [email protected]
ssh: connect to host 192.168.33.10 port 2222: Connection refused
What am I missing here?