ssh 配置主机限制

标签 ssh configuration line config

我对 ~/.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

最佳答案

当前的 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
    

关于ssh 配置主机限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45499992/

相关文章:

java - Jsch shell/Expecdt4j 简单示例?

python - matplotlibrc 对情节没有影响?

找不到 iOS "RKObjectManager.h"

hadoop - 配置单元记录器总是显示信息

algorithm - 基于网格的线路优化

arrays - Powershell逐字读取文本文件

linux - 使用 SCP 将文件从本地复制到远程时权限被拒绝

Java8 + Jcraft = 该算法的 key 太长

php - PHP Curl从aws返回404,但可以在其他主机甚至我的机器上运行

javascript - 在两个元素之间画一条连接线