ssh连接被远程主机Centos 7关闭

ssh连接被远程主机Centos 7关闭

我正在尝试通过 ssh 连接到我的服务器,但连接失败。

我打开终端并输入以下内容:

ssh -vvv -p 21 [email protected]

下面是包含结果的日志文件

OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: /etc/ssh/ssh_config line 52: Applying options for *
debug2: resolve_canonicalize: hostname xx.xxx.x.xxx is address
debug2: ssh_connect_direct
debug1: Connecting to xx.xxx.x.xxx [xx.xxx.x.xxx] port 21.
debug1: Connection established.
debug1: identity file /Users/davide/.ssh/id_rsa type -1
debug1: identity file /Users/davide/.ssh/id_rsa-cert type -1
debug1: identity file /Users/davide/.ssh/id_dsa type -1
debug1: identity file /Users/davide/.ssh/id_dsa-cert type -1
debug1: identity file /Users/davide/.ssh/id_ecdsa type -1
debug1: identity file /Users/davide/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/davide/.ssh/id_ed25519 type -1
debug1: identity file /Users/davide/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/davide/.ssh/id_xmss type -1
debug1: identity file /Users/davide/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: Connection closed by remote host

我是 unix 终端的新手,所以我不知道如何解决这个问题。有什么建议么?谢谢

答案1

首先,您确定目标 SSH 端口是正确的吗?21是 FTP 的默认端口,也是22SSH 的默认端口。

然后,如果端口正确,因为它不是默认值,我想您还有另一种方式来访问服务器。如果是这样,请尝试遵循以下建议http://edoceo.com/notabene/ssh-exchange-identification(您在 Google 上输入时的第一个结果ssh_exchange_identification: Connection closed by remote host)。

相关内容