Ubuntu SSH 服务器通过互联网输入密码后冻结客户端

Ubuntu SSH 服务器通过互联网输入密码后冻结客户端

我可以通过 SSH 从本地网络的任何地方登录我的 Ubuntu 服务器,但无法从互联网登录。当我尝试登录时,它会要求我的用户名、显示横幅并提示输入密码。但是当我输入密码时,SSH 服务器会挂起并冻结。

我已经使用 Putty、另一台 Linux 服务器中的 SSH 和 Android 版 ConnectBot 对此进行了测试。它们都存在这个问题。auth.log 文件显示连接正在通过,密码已被接受,但客户端什么也没看到,最终断开连接。auth.log 只是说这是正常的断开连接。如果它有帮助,我知道我可以访问在其上运行的 Apache2 网站,因此连接正在发生。我看过几篇关于此问题的其他帖子,但没有一篇能提供任何实质性的帮助。

有什么帮助吗?

ssh -v 的输出是

OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 50.168.183.239 [50.168.183.239] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/nitsua_revaew/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-8
debug1: match: OpenSSH_6.6.1p1 Ubuntu-8 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA d2:84:4a:6e:f4:a6:85:75:95:28:59:62:a7:d0:93:4a
debug1: Host '50.168.183.239' is known and matches the ECDSA host key.
debug1: Found key in /home/nitsua_revaew/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
__        _    _
\ \      / /__| | ___ ___  _ __ ___   ___
 \ \ /\ / / _ \ |/ __/ _ \| '_ ` _ \ / _ \
  \ V  V /  __/ | (_| (_) | | | | | |  __/
   \_/\_/ \___|_|\___\___/|_| |_| |_|\___|

                    to
               Austin's Server


           Enjoy Your Stay
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/nitsua_revaew/.ssh/id_rsa
debug1: Trying private key: /home/nitsua_revaew/.ssh/id_dsa
debug1: Trying private key: /home/nitsua_revaew/.ssh/id_ecdsa
debug1: Trying private key: /home/nitsua_revaew/.ssh/id_ed25519
debug1: Next authentication method: password
[email protected]'s password:

我登录后显示

Authenticated to 50.168.183.239 ([50.168.183.239]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.

然后它就冻结了。有什么想法吗?

答案1

听起来好像端口 22 被阻止了。根据您运行服务器的位置,有几种选择。第一种是访问您的路由器并解除端口 22 的阻止。您也可以尝试从端口 80 运行 ssh。

ssh -p 80 myserver.net

顺便问一下,您使用哪种地址访问服务器?如果您使用 IP 地址,请确保您没有使用本地网络 IP(它们通常以 192 开头)。

相关内容