【问题标题】:SSH Connection closed by remote host [closed]SSH连接被远程主机关闭[关闭]
【发布时间】:2013-01-25 23:51:37
【问题描述】:

我无法通过 SSH 连接到远程主机,但只能在我的家庭网络(提供商)上。如果我在另一个网络(我在同一个城市的朋友 - 不同的提供商),连接就完美了。 Ping 到服务器(在我家)有效。我也只有这台服务器才有这个问题。如果我尝试从我的家庭网络连接到其他主机,它可以工作。我该怎么办?

nich@ubuntu:/etc$ ssh -vvv xxx@www.sci.muni.cz
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to www.sci.muni.cz [147.251.24.3] port 22.
debug1: Connection established.
debug1: identity file /home/nich/.ssh/id_rsa type -1
debug1: identity file /home/nich/.ssh/id_rsa-cert type -1
debug1: identity file /home/nich/.ssh/id_dsa type -1
debug1: identity file /home/nich/.ssh/id_dsa-cert type -1
debug1: identity file /home/nich/.ssh/id_ecdsa type -1
debug1: identity file /home/nich/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host

nich@ubuntu:/etc$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:        12.04
Codename:       precise

【问题讨论】:

  • 可能是远程端请求反向dns并在不可用时断开连接?
  • 所以我什么都做不了?
  • 好吧,首先确定是这种情况(也许通过查看远程服务器上的日志)。如果 是 的情况,并且您无法让管理员删除此设置,您可以通过隧道连接或仅 ssh 到中间主机,然后从那里 ssh。
  • 通过另一台主机拒绝主机的连接正在工作。但我不能使用它,因为我想将服务器文件挂载到我的本地 ubuntu (nautilus)。
  • 您能告诉我有关此解决方案的更多信息吗?如果我想连接到 xxx@www.sci.muni.cz,隧道命令应该怎么看?

标签: linux ubuntu ssh


【解决方案1】:

以下是尝试创建隧道的方法。

  • intermediary 是您信任的为您进行转发的机器
  • remote 是您尝试访问的机器

    ssh -N -L 20000:remote:22 user@intermediary
    

完成此操作后,您的本地计算机将在端口 20000 上侦听。当您通过 ssh 连接到此端口时,在您的主机上,连接将通过隧道转发到 intermediary,intermediary 将然后转发给remote。

【讨论】:

猜你喜欢
  • 2019-10-27
  • 1970-01-01
  • 2012-02-03
  • 2020-04-28
  • 1970-01-01
  • 2014-07-30
  • 2016-05-13
  • 2021-02-04
  • 1970-01-01
相关资源
最近更新 更多