这是什么意思? ssh_exchange_identification:连接被远程主机关闭

这是什么意思? ssh_exchange_identification:连接被远程主机关闭

我正在尝试在家里创建一个 SSH 文件服务器,我可以在其他地方访问它。目前运行的是 Arch Linux 内核 4.16.3-1-ARCH。我可以通过 LAN 轻松地通过我的另一台计算机进行访问:

bred@loaf:~$ ssh [email protected] -p 80
[email protected]'s password:

但事实证明,尝试通过 WAN 访问更加困难。我一直在尝试使用端口 80,因为端口 22 似乎被阻止了。我知道80是开放的ismyportopen.com。我想我真的不知道自己在做什么,而 arch wiki 似乎让我失望了。

我注意到在同一 LAN 上尝试通过 WAN 连接时出现此错误。

bred@loaf:~$ ssh [email protected] -vv -p 80
OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2l  25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "65.157.96.234" port 80
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 65.157.96.234 [65.157.96.234] port 80.
debug1: connect to address 65.157.96.234 port 80: Connection refused
ssh: connect to host 65.157.96.234 port 80: Connection refused

当我尝试通过同一 LAN 上的计算机通过 WAN 连接,但尝试通过 VPN 从同一 LAN 计算机(而不是主机)进行连接时,我会收到此错误。

bred@loaf:~$ ssh [email protected] -vv -p 80
OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2l  25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "65.157.96.234" port 80
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 65.157.96.234 [65.157.96.234] port 80.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bred/.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
ssh_exchange_identification: Connection closed by remote host

这是主机上我的 /etc/ssh/sshd_config 的副本,不包括注释行:

AllowUsers landau
Port 80
ChallengeResponseAuthentication no
UsePAM yes
Subsystem       sftp    /usr/lib/ssh/sftp-server

我的主机的 /etc/hosts.allow 和 /etc/hosts.deny 默认情况下不存在。我添加sshd:ALL到允许文件中,但这似乎没有帮助。

相关内容