为什么 ssh 无法在 .ssh/config 中扩展 %h 变量?

Zor*_*ran 7 ssh rhel-6 redhat-enterprise-linux

为什么 ssh 无法从 .ssh/config 扩展 %h?这曾经有效并且仍然有效,除了在 RHEL 盒子上。寻找这可能是什么起源。是否有某个设置告诉 ssh 不要扩展 %h?

我的 .ssh/config 中有这样的东西:

Host *.foo
  HostName %h.mydomain.com
Run Code Online (Sandbox Code Playgroud)

在这不起作用的 RHEL 盒子上,我得到了这个:

$ ssh -vvvv bar.foo
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /home/zsimic/.ssh/config
debug1: Applying options for *.foo
debug1: Applying options for *.foo
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
ssh: Could not resolve hostname %h.mydomain.com: Name or service not known
Run Code Online (Sandbox Code Playgroud)

use*_*686 16

您使用的是 OpenSSH 5.3;%h在 OpenSSH 5.6 中引入

自 OpenSSH 5.5 以来的变化
==========================

 * 将 %h 扩展到 ssh_config 主机名选项中的主机名。虽然这
   听起来没用,实际上对于不合格的工作很方便
   主机名:

     主持人 *。*
        主机名 %h
     主持人 *
        主机名 %h.example.org