我试图研究类似的问题,但是没有一种解决方案可以解决我的问题。
我正在Ubuntu 16.04 LTS的Virtualbox上使用Hortonworks HDP 2.6.5沙箱。 Hortonworks正在运行,我在VirtualBox上显示了以下内容:
按照说明,我通过以下命令将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
如果有人可以提供帮助,我将不胜感激。
谢谢
答案 0 :(得分:1)
在HDP沙箱控制台中打印的有关SSH访问的说明具有误导性。端口4200对于在浏览器中使用HTTP协议进行外壳访问非常有用,因此不适用于命令行ssh。请注意,在日志末尾出现“ HTTP / 1.1 400错误的请求”错误消息。尝试尝试使用端口2222,如下所示:
提示> ssh root @ localhost -p 2222