首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更新Ubuntu来宾后,流浪者"ssh_exchange_identification:连接被远程主机关闭“

更新Ubuntu来宾后,流浪者"ssh_exchange_identification:连接被远程主机关闭“
EN

Stack Overflow用户
提问于 2016-05-28 00:59:29
回答 4查看 7.2K关注 0票数 4

这是我第二次遇到这种情况:我使用Vagrant创建了一个虚拟Ubuntu机器,并在运行之后:

sudo apt-get update sudo apt-get upgrade

我得到了这个:

代码语言:javascript
复制
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

当我调试ssh连接时,我看到以下内容:

代码语言:javascript
复制
vagrant ssh -- -vvv
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data ~/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: /etc/ssh/ssh_config line 102: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file ~/.vagrant/machines/default/virtualbox/private_key type -1
debug1: key_load_public: No such file or directory
debug1: identity file ~/.vagrant/machines/default/virtualbox/private_key-cert type -1
ssh_exchange_identification: Connection closed by remote host

这在Linux上发生在我身上,在Mac OS上也是如此。

也许有一个bug,或者我做错了什么。

EN

回答 4

Stack Overflow用户

发布于 2016-08-04 17:56:20

下面的解决方案对我来说非常有效:

  1. 转到主目录路径: sudo chmod go-w /usr/
  2. 转到项目框: a)漫游重新加载,b)漫游启动& c)漫游ssh.
票数 6
EN

Stack Overflow用户

发布于 2017-01-09 02:23:06

我在OSX 10.11.6和Vagrant 1.9.1上使用laravel/homestead 1.0.1 box时遇到了这个问题。

在Virtual Box VM设置中打开适配器上的"Cable Connected“。

Virtual Box GUI>VM Settings>Network>Adapter> ☑ Cable Connected

永久解决这个问题。将这个添加到您的漫游文件的中间。

config.vm.provider 'virtualbox' do |vb| vb.customize ['modifyvm', :id, '--cableconnected1', 'on'] end

票数 6
EN

Stack Overflow用户

发布于 2016-06-07 20:13:27

ssh_exchange_identification: Connection closed by remote host可能与VirtualBox 5.0.20中有关使用通配符来宾地址处理端口转发的更改有关,这会导致出现connection closed问题。有关此问题的更多信息:

有两种方法可以解决这个问题:

包含一个修复的

  1. Install a test build,该修复将为您的guest_ip设置(documentation).

在您的Vagrantfile中设置一个初始的.15访客ip address

  • Define a forwarded_port
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37488820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档