siberiancrane
siberiancrane

Reputation: 616

How to modify MaxStartups field of sshd_config on remote systems?

I am running a large scale simulation on AWS EC2, using GNU Parallel to spawn multiple process on each system. This requires multiple parallel ssh connections from the host to client. This is capped by the MaxStartups value in sshd_config for each client.

What's the better/right way to modify this field? I believe there would be a better mechanism than login to each system and modify the file.

Upvotes: 1

Views: 2241

Answers (1)

Ole Tange
Ole Tange

Reputation: 33740

Write a script that changes the value.

Use GNU Parallel to login to all the machines to run the script.

So something like:

change_max() {
  perl -i -pe 's/MaxStartups.*/MaxStartups 100:30:1000/' /etc/ssh/sshd_config
}
export -f change_max
parallel --nonall --env change_max --slf hosts.list change_max

Upvotes: 1

Related Questions