无法更新 ssh

无法更新 ssh

我有两台服务器,第一台(目标)正在运行我的网站,无法重新启动。第二台是我的备份服务器。我希望备份能够 rsync 到目标。

我可以使用 Windows 上的 Putty 连接到这两个,但是当我尝试从备份 ssh 到目标时,会出现超时。(但目标可以 ssh 到备份...)。

在备份服务器上,我有:

backup$ssh -V
OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012

但在目标服务器上:

target$ ssh -V
OpenSSH_5.9p1 Debian-5ubuntu1.2, OpenSSL 1.0.1 14 Mar 2012

我相信这就是我无法通过 ssh 备份到目标的原因。我尝试过apt-get update && apt-get install sshapt-get install openssh-server,但版本一直相同。

我如何更新目标的 ssh 服务器以便能够从备份连接到它?

编辑:

ssh -vvv如果有人想知道的话,请添加:

backup$ ssh -vvv vod.121video.com
OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 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 target [XXX.XXX.XXX.XXX] port 22.
debug1: connect to address XXX.XXX.XXX.XXX port 22: Connection timed out
ssh: connect to host target port 22: Connection timed out

编辑2:

使用Sylvain答案的配置文件:

backup$ ssh -vvv target
OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 1: Applying options for target
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Executing proxy command: exec ssh proxyserver nc -q0 target 22
debug1: permanently_set_uid: 0/0
debug1: permanently_drop_suid: 0
debug3: Incorrect RSA1 identifier
debug3: Could not load "/root/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /root/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
ssh: Could not resolve hostname proxyserver: No such file or directory
ssh_exchange_identification: Connection closed by remote host

答案1

作为目标是生产服务器,我不确定您是否可以直接通过 ssh 连接到它。也许您必须先设置 ssh 配置才能连接到代理服务器,如下所示:

Host target
  ProxyCommand ssh proxyserver nc -q0 %h %p
  ForwardAgent yes 

相关内容