无法通过SSH进入Vagrant VM(不使用vagrant ssh) [英] Can't SSH into Vagrant VM (without using vagrant ssh)

查看:988
本文介绍了无法通过SSH进入Vagrant VM(不使用vagrant ssh)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在准备使结构部署脚本与本地Vagrant VM配合使用时,我试图说服VM让我通过SSH进入它,而不使用vagrant ssh.我不断收到错误消息.

In preparation for adapting a fabric deployment script to work with a local Vagrant VM, I'm trying to convince the VM to let me SSH into it without using vagrant ssh. I keep getting errors.

我尝试了很多不同的设置组合,但这是最新的Vagrant文​​件:

I've tried a lot of different combinations of settings, but here is the latest Vagrant file:

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/sloan/code/vagrant/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  ForwardAgent yes

如果我尝试使用设置的密钥文件和IP进行SSH,则连接被拒绝:

If I try to SSH in using the key file and IP I set, I get connection refused:

> ssh -i /Users/sloan/code/vagrant/.vagrant/machines/default/virtualbox/private_key -p 2222 vagrant@192.168.33.10
ssh: connect to host 192.168.33.10 port 2222: Connection refused

如果我使用vagrant@127.0.0.1而不是vagrant@192.168.33.10尝试相同的操作,则会收到主机密钥验证失败.

If I try the same thing with vagrant@127.0.0.1 instead of vagrant@192.168.33.10 I get a Host key verification failure.

我在这里想念什么?

推荐答案

主机密钥验证失败

Host key verification failure

这是 ssh 的一项安全功能,它试图在中间攻击发生之前制止人员.

This is a security feature of ssh that tries to stop man in the middle attacks before they happen.

您的计算机上次将其放入该无所事事的盒子时,存储了服务器签名的副本;现在连接时,很可能是在重建之后,您连接到相同的物理地址,并且签名现在不匹配.

Your computer, last time it ssh'd into that vagrant box, stored a copy of the servers signature; when you are connecting now, most likely after a rebuild, you are connecting to the same physical address, and the signatures now mismatch.

要清除陈旧的条目,可以在客户端设备(您尝试从 SSH SSH的设备)上的纯文本文件~/.ssh/known_hosts中找到它们.

To clear out stale entries, you can find them in the plain text file ~/.ssh/known_hosts on your client device ( the device you are trying to ssh from ).

这篇关于无法通过SSH进入Vagrant VM(不使用vagrant ssh)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆