2
這是一個後續問題到earlier question。我使用了相同的Vagrantfile,但已經註釋掉了兩條我認爲不必要的路線。無法SSH進入Vagrant虛擬機(不使用流浪SSH)第2部分
我試圖ssh進入我的流浪箱沒有使用vagrant ssh
。下面是我的Vagrantfile和ssh配置信息:
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
從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
我已經試過ssh
荷蘭國際集團到我的機器上使用以下命令:
$ 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
此外,根據解決方案des在another answer中,我嘗試在嘗試連接之前刪除~/.ssh/known_hosts
;但它也不起作用:
$ 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
我在這裏錯過了什麼?
如果您想要使用16.04,我可以推薦[bento/ubuntu-16.04](https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04 ),因爲他們使用標準用戶名:vagrant,密碼:vagrant convention – mbigras