如何在远程系统上修改 sshd_config 的 MaxStartups 字段?
How to modify MaxStartups field of sshd_config on remote systems?
我正在 运行 AWS EC2 上进行大规模模拟,使用 GNU Parallel 在每个系统上生成多个进程。这需要从主机到客户端的多个并行 ssh 连接。每个客户端的 sshd_config 中的 MaxStartups 值上限。
修改此字段的better/right方法是什么?我相信会有比登录每个系统并修改文件更好的机制。
编写更改值的脚本。
使用 GNU Parallel 登录所有机器到 运行 脚本。
所以像这样:
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
我正在 运行 AWS EC2 上进行大规模模拟,使用 GNU Parallel 在每个系统上生成多个进程。这需要从主机到客户端的多个并行 ssh 连接。每个客户端的 sshd_config 中的 MaxStartups 值上限。
修改此字段的better/right方法是什么?我相信会有比登录每个系统并修改文件更好的机制。
编写更改值的脚本。
使用 GNU Parallel 登录所有机器到 运行 脚本。
所以像这样:
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