Ubuntu 上的 Hortonworks SSH 问题:ssh_exchange_identification:连接被远程主机关闭
Hortonworks SSH issue on Ubuntu: ssh_exchange_identification: Connection closed by remote host
我试图研究类似的问题,但 none 的解决方案可以解决我的问题。
我在 Ubuntu 16.04 LTS 上的 Virtualbox 上使用 Hortonworks HDP 2.6.5 沙箱。 Hortonworks 是 运行,我在 VirtualBox 上显示了以下内容:
按照说明,我使用本地主机上的 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 协议的 shell 访问很有用,因此不适用于命令行 ssh。请注意日志末尾的 'HTTP/1.1 400 Bad Request' 错误消息。尝试端口 2222,如下所示:
提示> ssh root@localhost -p 2222
我试图研究类似的问题,但 none 的解决方案可以解决我的问题。
我在 Ubuntu 16.04 LTS 上的 Virtualbox 上使用 Hortonworks HDP 2.6.5 沙箱。 Hortonworks 是 运行,我在 VirtualBox 上显示了以下内容:
按照说明,我使用本地主机上的 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 协议的 shell 访问很有用,因此不适用于命令行 ssh。请注意日志末尾的 'HTTP/1.1 400 Bad Request' 错误消息。尝试端口 2222,如下所示:
提示> ssh root@localhost -p 2222