SSH 连接被端口 22 关闭

问题描述 投票:0回答:1

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

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

结果如下:

.ssh % ssh -vvv [email protected]
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

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

ssh terminal cpanel ssh-keygen
1个回答
0
投票

确保您使用的帐户在 /etc/passwd、/etc/shadow 和 /etc/group 中有记录。还要确保 homedir 存在并且由该帐户拥有。

© www.soinside.com 2019 - 2024. All rights reserved.