远程主机关闭连接,随后拒绝连接

远程主机关闭连接,随后拒绝连接

突然间,我与服务器的 ssh 连接被破坏了。以下是发生的情况:

$ ssh -vvv -p <PORT> -l <USER> <HOST>
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/khosrow/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <HOST> [<IP>] port <PORT>.
debug1: Connection established.
debug1: identity file /home/khosrow/.ssh/identity type -1
debug1: identity file /home/khosrow/.ssh/id_rsa type -1
debug1: identity file /home/khosrow/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host

我最近更新了盒子,yum updatesshd 也更新了。老实说,我不知道这是否造成了任何损害。但它提示/etc/ssh/sshd_config存储为,/etc/ssh/sshd_config.rpmnew这很正常。

我在谷歌搜索时看到过类似的帖子,但几乎所有帖子都建议我检查/etc/hosts.allow/etc/hosts.deny,但就我而言,我做不到。我无法连接到盒子来查看那里发生了什么。

我通过服务器提供商的 Web 界面重新启动了盒子,情况变得更糟。我现在得到了这个:

$ ssh -vvv -p <PORT> -l <USER> <HOST>
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/khosrow/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <HOST> [<IP>] <PORT>.
debug1: connect to address <IP> port <PORT>: Connection refused
ssh: connect to host <HOST> port <PORT>: Connection refused

同时具有<CUSTOM_PORT>和默认的 22 个端口。

如果有人能帮助我,我将不胜感激。

答案1

看起来 sshd 已关闭或 iptables 阻止了你。也许 sshd 的配置有问题。如果你 telnet 自定义端口和端口 22,会发生什么?

您的服务器是否启用了 telnet 访问?您仍然可以尝试通过 telnet 访问。

如果您无法从 Web 控制台管理服务或防火墙或无法通过 telnet 登录,恐怕您必须致电您的提供商客户支持。

相关内容