multissh
一个简单的并行SSH工具,可以批量的对主机通过SSH执行命令组合。
支持:
并发执行
单次执行多条命令
ip地址段自动匹配主机(192.168.0.1-192.168.0.100)
ssh用户名/密码认证
sshkey认证
jso格式输出
输出到文本,文件名为host.txt
编译go get ./...go buildrelease可以直接下载编译好的release版本
提供wi64和liux64两个平台的可执行文件
https://github.com/shaghai-edu/multissh/releases/
命令体系# ./multissh -hUsage of ./multissh: -c strig cfg File Path -ciphers strig ciphers -cmdfile strig cmdfile path -cmds strig cmds -hostfile strig hostfile path -hosts strig host address list -ipfile strig ipfile path -ips strig ip address list -j prit output i jso format -k strig ssh private key -l I liux mode,multi commad combie with && ,such as date&&cd /opt&&ls - it max execute umber (default 20) -outTxt write result ito txt -p strig password -port it ssh port (default 22) -t it max timeout (default 30) -u strig userame -v show versiocmdfile示例
show clockhostfile示例
192.168.31.21192.168.15.102ipfile示例
192.168.15.101-192.168.15.103192.168.31.21-192.168.31.22ssh.jso示例
{ "SshHosts": [ { "Host": "192.168.31.51", "Port": 22, "Userame": "admi", "Password": "admi","cmds":"show clock;show clock" }, { "Host": "192.168.80.131", "Port": 22, "Userame": "root", "Password": "", "key": "./server.key", "liuxMode": true, "CmdFile": "cmd2.txt.example" } ]}
评论