ubuntu - Ubuntu 上的 Hortonworks SSH 问题 : ssh_exchange_identification: Connection closed by remote host

标签 ubuntu ssh virtualbox ubuntu-16.04 hortonworks-sandbox

我尝试研究类似的问题,但没有一个解决方案可以帮助我的问题。

我在 Ubuntu 16.04 LTS 上的 Virtualbox 上使用 Hortonworks HDP 2.6.5 沙箱。 Hortonworks 正在运行,VirtualBox 上显示以下内容:

enter image description here

按照说明,我使用 localhost 上的 4200 端口通过以下命令进行 ssh:

ssh [user]@127.0.0.1 -p 4200

这导致我出现以下错误:

ssh_exchange_identification: Connection closed by remote host

我尝试调试,得到以下日志:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 4200.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mahsa/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1: ssh_exchange_identification: HTTP/1.1 400 Bad Request

如果有人可以帮助解决这个问题,我将不胜感激。

谢谢

最佳答案

HDP Sandbox 控制台中打印的有关 SSH 访问的说明具有误导性。端口 4200 对于使用浏览器使用 HTTP 协议(protocol)进行 shell 访问非常有用,因此不适用于命令行 ssh。请注意日志末尾的“HTTP/1.1 400 Bad Request”错误消息。尝试使用端口 2222,如下所示:

提示> ssh root@localhost -p 2222

关于ubuntu - Ubuntu 上的 Hortonworks SSH 问题 : ssh_exchange_identification: Connection closed by remote host,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52764029/

相关文章:

python - 如何在 Ubuntu(最好是 Windows)中启动一个接受键盘输入的 Python 屏幕保护程序?

ubuntu - 如何在nginx中配置多个子域?

python - 使用 Paramiko (Python) 通过 SSH 执行 smartctl 命令时没有输出

assembly - 如何在自定义操作系统中的程序集中关闭 acpi?

多个域的PHP临时上传目录

mysql - 无法连接到 localhost :3306? 上的 mysql

python - 使 Python 通过 SSH 隧道连接到 MySQL

ssh - 适用于所有用户的SSH强制命令

sql - 如何使用 Windows 身份验证登录 SQL Server

linux - 基于虚拟盒的嵌入式 Linux 开发