我有一个远程服务器,我需要通过 VPN 管理到另一个数据中心。我曾经从(服务器 A)连接到它的服务器正在退役,所以我在同一个 VLAN(服务器 B)上使用另一个。
服务器 A 和 B 运行相同版本的 SSH (SSH-2.0-OpenSSH_4.3) 并具有相同的 /etc/ssh/ssh_config 文件。
服务器 A 和 B 都有 RSA 密钥,公共部分存储在远程机器上的 .ssh/authorized_keys 中。
当我从服务器 A ssh 到远程机器时,我立即进入。
当我从服务器 B ssh 到远程机器时,我必须等待大约 20 秒或更长时间。
我已经在详细调试模式下运行 ssh,它挂在服务器 B 上的部分在这里:
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /home/user/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host '10.10.10.50' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:1
debug2: bits set: 493/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/user/.ssh/identity ((nil))
debug2: key: /home/user/.ssh/id_rsa (0x7ff214705310)
debug2: key: /home/user/.ssh/id_dsa ((nil))
...
Run Code Online (Sandbox Code Playgroud)
这是有 20 秒延迟的点。不影响服务器 A 的服务器 B 发生了什么?
可能是反向 dns 查找延迟。检查服务器 B 上的 DNS 配置。
您可以通过在 sshd_config 中设置“UseDNS no”来验证这一点,看看它是否有帮助。(但是,最好解决任何潜在的 DNS 问题(如果有)。
归档时间: |
|
查看次数: |
1176 次 |
最近记录: |