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