×

multissh并行SSH执行工具

消耗积分:0 | 格式:zip | 大小:0.02 MB | 2022-05-26

哈哈哈

分享资料个

授权协议 Apache
开发语言 Google Go
操作系统 跨平台
软件类型 开源软件

软件简介

multissh

一个简单的并行 SSH 工具,可以批量的对主机通过 SSH 执行命令组合。

支持:

  • 并发执行

  • 单次执行多条命令

  • ip 地址段自动匹配主机(192.168.0.1-192.168.0.100)

  • ssh 用户名/密码认证

  • ssh key 认证

  • json 格式输出

  • 输出到文本,文件名为 host.txt

编译

go get ./...
go build

release

可以直接下载编译好的 release 版本

提供 win64 和 linux64 两个平台的可执行文件

https://github.com/shanghai-edu/multissh/releases/

命令体系

# ./multissh -h
Usage of ./multissh:
  -c string
        cfg File Path
  -ciphers string
        ciphers
  -cmdfile string
        cmdfile path
  -cmds string
        cmds
  -hostfile string
        hostfile path
  -hosts string
        host address list
  -ipfile string
        ipfile path
  -ips string
        ip address list
  -j    print output in json format
  -k string
        ssh private key
  -l    In linux mode,multi command combine with && ,such as date&&cd /opt&&ls
  -n int
        max execute number (default 20)
  -outTxt
        write result into txt
  -p string
        password
  -port int
        ssh port (default 22)
  -t int
        max timeout (default 30)
  -u string
        username
  -v    show version

cmdfile 示例

show clock

hostfile 示例

192.168.31.21
192.168.15.102

ipfile 示例

192.168.15.101-192.168.15.103
192.168.31.21-192.168.31.22

ssh.json 示例

{
    "SshHosts": [
        {
            "Host": "192.168.31.51",
            "Port": 22,
            "Username": "admin",
            "Password": "admin",
			"cmds":"show clock;show clock"
        },
        {
            "Host": "192.168.80.131",
            "Port": 22,
            "Username": "root",
            "Password": "",
            "key": "./server.key",
            "linuxMode": true,
            "CmdFile": "cmd2.txt.example"
        }
    ]
}
 

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !