首页 > 解决方案 > SSH 连接被端口 22 关闭

问题描述

我正在尝试与我的 CPanel 服务器建立 SSH 连接。我正在使用我的 mac 来执行此操作。但是,在生成密钥并将公钥保存/授权到服务器后,我无法创建 SSH 连接。

我保证我已经查看了所有其他相关的解决方案,例如更改权限、检查密钥是否在服务器上得到授权等。

结果如下:

.ssh % ssh -vvv cpanelusername@site.com
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to site.com port 22.
debug1: Connection established.
debug1: identity file /Users/user/.ssh/id_rsa type 0
debug1: identity file /Users/user/.ssh/id_rsa-cert type -1
debug1: identity file /Users/user/.ssh/id_dsa type -1
debug1: identity file /Users/user/.ssh/id_dsa-cert type -1
debug1: identity file /Users/user/.ssh/id_ecdsa type -1
debug1: identity file /Users/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/user/.ssh/id_ed25519 type -1
debug1: identity file /Users/user/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/user/.ssh/id_xmss type -1
debug1: identity file /Users/user/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000002
debug3: fd 5 is O_NONBLOCK
debug1: Authenticating to site.com:22 as 'cpanelusername'
debug3: hostkeys_foreach: reading file "/Users/user/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 107.180.56.153 port 22

经过大量研究后,我仍然对这些调试的含义以及我的连接被关闭的原因感到困惑。如果有人对我为什么无法连接或可以解释调试有任何见解,那将不胜感激。提前致谢!

标签: sshterminalcpanelssh-keygen

解决方案


推荐阅读