eswues
eswues

Reputation: 129

ssh config host limits

I have some problem with ~/.ssh/config. I have 300 hosts on which i need to get as root and not as me. I wrote the script which is creating the config file for me, which gives me config file with four lines:

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

When I want to connect to any server through ssh I have got the message, that I have a 'bad configuration in line: 10' or '...line 6' :/

wc -l .ssh/config

gives me 4

Upvotes: 3

Views: 1885

Answers (1)

Jakuje
Jakuje

Reputation: 25966

Current OpenSSH should read up to 4096 bytes long lines. But versions before OpenSSH 7.5 were reading only 1024 bytes, which might not be enough (commit).

You have two possibilities:

  • Update to OpenSSH 7.5
  • Strip the lines to shorter ones not exceeding 1024 characters, for example

    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
    

Upvotes: 5

Related Questions