【问题标题】:ssh config host limitsssh 配置主机限制
【发布时间】:2018-01-11 23:46:07
【问题描述】:

~/.ssh/config. 有问题 我有 300 台主机,我需要以 root 身份而不是我自己。 我编写了为我创建配置文件的脚本,它为我提供了四行配置文件:

host *
    user me
host <here 300 hostnames seperated by space and in this same line all>
    user root

当我想通过 ssh 连接到任何服务器时,我收到消息,说我有一个“错误的配置在第 10 行”或“...第 6 行”:/

wc -l .ssh/config

给我 4 个

【问题讨论】:

  • 配置行长度好像有限制? 30万台主机的配置线有多长?
  • 有2195个字符

标签: ssh configuration line config


【解决方案1】:

当前的 OpenSSH 应该最多读取 4096 字节长的行。但是 OpenSSH 7.5 之前的版本只能读取 1024 个字节,这可能还不够 (commit)。

你有两种可能:

  • 更新到 OpenSSH 7.5
  • 将行剥离为不超过 1024 个字符的较短行,例如

    host <here first 100 hostnames seperated by space and in this same line all>
            user root
        host <here another 100 hostnames ...>
            user root
        host <here another 100 hostnames ...>
            user root
    

【讨论】:

  • 是的,我们使用 OpenSSH_5.3 @work。它解释了很多。非常感谢您提供如此快速的帮助。万事如意
猜你喜欢
  • 1970-01-01
  • 2018-10-07
  • 1970-01-01
  • 1970-01-01
  • 2013-10-01
  • 2011-07-02
  • 1970-01-01
  • 2017-08-16
  • 1970-01-01
相关资源
最近更新 更多