{"id":20314854,"url":"https://github.com/windvalley/gossh","last_synced_at":"2025-04-04T18:07:12.702Z","repository":{"id":44893975,"uuid":"340302671","full_name":"windvalley/gossh","owner":"windvalley","description":"🚀🚀A high-performance and high-concurrency ssh tool written in Go. It is 10 times faster than Ansible. If you need much more performance and better ease of use, you will love it.","archived":false,"fork":false,"pushed_at":"2024-12-17T06:11:52.000Z","size":386,"stargazers_count":171,"open_issues_count":0,"forks_count":44,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-28T17:09:32.849Z","etag":null,"topics":["ansible","batchssh","cli","devops","gossh","high-concurrency","multissh","ops","parallel-ssh","sa","sre","ssh","ssh-client","sshbatch"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windvalley.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-19T08:20:18.000Z","updated_at":"2025-03-24T03:31:35.000Z","dependencies_parsed_at":"2024-02-25T05:20:49.569Z","dependency_job_id":"90e972a1-a567-4e44-8a48-8d9d3782c26f","html_url":"https://github.com/windvalley/gossh","commit_stats":{"total_commits":184,"total_committers":2,"mean_commits":92.0,"dds":"0.11956521739130432","last_synced_commit":"92f92f35a1ee909071c896e64f926b8e28cf3a85"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgossh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgossh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgossh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgossh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windvalley","download_url":"https://codeload.github.com/windvalley/gossh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","batchssh","cli","devops","gossh","high-concurrency","multissh","ops","parallel-ssh","sa","sre","ssh","ssh-client","sshbatch"],"created_at":"2024-11-14T18:16:58.206Z","updated_at":"2025-04-04T18:07:12.672Z","avatar_url":"https://github.com/windvalley.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoSSH\n\n[![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://go.dev)\n[![Github Workflow Status](https://img.shields.io/github/actions/workflow/status/windvalley/gossh/gosshci.yaml?branch=main)](https://github.com/windvalley/gossh/actions/workflows/gosshci.yaml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=windvalley_gossh\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=windvalley_gossh)\n[![Version](https://img.shields.io/github/v/release/windvalley/gossh?include_prereleases)](https://github.com/windvalley/gossh/releases)\n![Supports](https://img.shields.io/badge/Supports-macOS,%20Linux-orange)\n![Page Views](https://views.whatilearened.today/views/github/windvalley/gossh.svg)\n[![Release Download Total](https://img.shields.io/github/downloads/windvalley/gossh/total)](https://github.com/windvalley/gossh/releases)\n[![LICENSE](https://img.shields.io/github/license/windvalley/gossh)](LICENSE)\n\nGossh is a high-performance and high-concurrency ssh tool written in Go.\nIt can efficiently manage tens of thousands of Linux server clusters.\nIt is 10 times faster than `Ansible`.\nIf you need much more performance and better ease of use, you will love `gossh`.\n\nFeel free to open a new issue if you have any issues, questions or suggestions about this project.\n\n## 💝 Features\n\n- Four kinds of ssh tasks:  \n  `command`: Execute commands on target hosts.  \n  `script`: Execute a local shell script on target hosts.  \n  `push`: Copy local files and dirs to target hosts.  \n  `fetch`: Copy files and dirs from target hosts to local.\n\n- Auto detect following authentication methods for the login user(default `$USER`):  \n  `Password`: from inventory file, or from flag `-k/--auth.ask-pass`,`-p/--auth.password`,`-a/--auth.pass-file`, or from configuration file.  \n  `Pubkey Authentication`: by identity files(default `~/.ssh/id_rsa`), also include that with passphrase.  \n  `SSH-Agent Authentication`: through the system environment variable `$SSH_AUTH_SOCK`.  \n  If the above three authentication methods are valid at the same time, the priority order is: `SSH-Agent` \u003e `Pubkey` \u003e `Password`.\n\n- Provide the target hosts by:  \n  Hosts/host-patterns/host-group-names as positional arguments separated by space.  \n  Inventory file by flag `-i/--hosts.inventory` or from configuration file.\n\n- Expand host patterns that from positional arguments or a inventory file to host list.\n  Supported host patterns e.g.:\n\n  ```text\n  10.16.0.[1-10]\n  foo[01-03].bar.com\n  foo[01-03,06,12-16].idc[1-3].[beijing,wuhan].bar.com\n  ```\n\n- Allow adding variables to inventory file.  \n  Available variables: `host`, `port`, `user`, `password`, `keys`, `passphrase`. E.g.:\n\n  ```text\n  alias_name_node1 host=node1.sre.im\n  alias_name_node2 host=192.168.33.12 port=8022 user=vagrant password=123456 keys=~/.ssh/id_rsa passphrase=xxx\n  node3.sre.im user=vagrant password=GOSSH-AES256:9cfe499133b69a6c7fc62b5b6ba72d3d8dfb4d0e7987170a40c5d50bb5d71e19\n  ```\n\n- Group hosts in inventory file. E.g.:\n\n  ```text\n  # no group hosts\n  node1.sre.im\n\n  # group hosts\n  [webserver]\n  node2.sre.im port=6022\n  node3.sre.im\n\n  # host variables for group webserver\n  [webserver:vars]\n  port=8022\n  user=zhangsan\n  password=plaintextOrCiphertextByVault\n\n  [dbserver]\n  db[1-3].sre.im\n\n  # group project1 has hosts that from both group webserver and dbserver\n  [project1:children]\n  webserver\n  dbserver\n  ```\n\n- Use `sudo` to run as other user(default `root`) to execute the commands/shell-script or fetch files/dirs.\n\n- Specify i18n environment variable value while executing commands or a shell script to help keep the language of the outputs consistent. For example: `zh_CN.UTF-8`, `en_US.UTF-8`.\n\n- Three kinds of timeout in seconds:  \n  Connecting to each target host (default `10`).  \n  Subcommand `command`, `script`, `push`, `fetch` for each target host.  \n  The entire `gossh` task.\n\n- Output to a file or screen or a file and screen at the same time.  \n  Colorful output, json format output, verbose(debug) output, and silent output.\n\n- High-performance and high-concurrency. Customize the number of concurrent connections (default `1`).\n\n- SSH Proxy can be specified to connect to the target hosts.\n\n- Provides subcommand `vault` to encrypt/decrypt confidential information\n  such as password or passphrase without compromising security.\n\n- Support the detection of dangerous commands that will be executed on target hosts, and allow users to customize a blacklist of commands.\n\n- For ease of use, it supports config file. You can write flags that are not frequently changed into the config file, so you don't need to laboriously specify these flags on the command line. If the flag in both command line and config file, flag that from command line takes precedence over the other.  \n  The default config file is `$PWD/.gossh.yaml` or `$HOME/.gossh.yaml`, and `$PWD/.gossh.yaml` has a higher priority. Note that the config file is optional, that is, there can be no config file.\n\n- Provides subcommand `config` to help generate configuration file in easy way.\n\n## 🛠 Installation\n\nPrebuilt binaries for macOS and Linux can be downloaded from the [GitHub releases page](https://github.com/windvalley/gossh/releases).\n\nAlso you can install `gossh` by compiling:\n\n```sh\n$ git clone --depth 1 https://github.com/windvalley/gossh\n\n$ cd gossh\n\n# Note: need to install Go environment first.\n$ make \u0026\u0026 make install\n```\n\n## 📜 Usage\n\n```text\n$ gossh -h\n\nGossh is a high-performance and high-concurrency ssh tool.\nIt can efficiently manage tens of thousands of Linux server clusters.\n\nFind more information at: https://github.com/windvalley/gossh\n\nUsage:\n  gossh [command]\n\nAvailable Commands:\n  command     Execute commands on target hosts\n  script      Execute a local shell script on target hosts\n  push        Copy local files and dirs to target hosts\n  fetch       Copy files and dirs from target hosts to local\n  vault       Encryption and decryption utility\n  config      Generate gossh configuration file\n  version     Show gossh version information\n  help        Help about any command\n  completion  Generate the autocompletion script for the specified shell\n\nFlags:\n  -u, --auth.user string                login user (default $USER)\n  -p, --auth.password string            password of login user\n  -k, --auth.ask-pass                   ask for the password of login user\n  -a, --auth.pass-file string           file that holds the password of login user\n  -I, --auth.identity-files strings     identity files (default [~/.ssh/id_rsa])\n  -K, --auth.passphrase string          passphrase of the identity files\n  -V, --auth.vault-pass-file string     text file or executable file that holds the vault password\n                                        for encryption and decryption\n  -i, --hosts.inventory string          file that holds the target hosts\n  -P, --hosts.port int                  port of the target hosts (default 22)\n  -l, --hosts.list                      outputs a list of target hosts, and does not do anything else\n  -s, --run.sudo                        use sudo to execute commands/script or fetch files/dirs\n  -U, --run.as-user string              run via sudo as this user (default \"root\")\n  -L, --run.lang string                 specify i18n while executing command\n                                        (e.g. zh_CN.UTF-8|en_US.UTF-8)\n  -c, --run.concurrency int             number of concurrent connections (default 1)\n  -B, --run.command-blacklist strings   commands that are prohibited from execution on target hosts\n                                        (default: [rm,reboot,halt,shutdown,init,mkfs,mkfs.*,umount,dd])\n  -o, --output.file string              file to which messages are output\n  -j, --output.json                     output messages in json format\n  -C, --output.condense                 condense output and disable color\n  -q, --output.quiet                    do not output messages to screen\n  -v, --output.verbose                  show debug messages\n  -X, --proxy.server string             proxy server address\n      --proxy.port int                  proxy server port (default 22)\n      --proxy.user string               login user for proxy (default same as 'auth.user')\n      --proxy.password string           password for proxy (default same as 'auth.password')\n      --proxy.identity-files strings    identity files for proxy (default same as 'auth.identity-files')\n      --proxy.passphrase string         passphrase of the identity files for proxy\n                                        (default same as 'auth.passphrase')\n  -t, --timeout.command int             timeout seconds for handling each target host\n      --timeout.task int                timeout seconds for the entire gossh task\n      --timeout.conn int                timeout seconds for connecting each target host (default 10)\n      --config string                   config file (default {$PWD,$HOME}/.gossh.yaml)\n  -h, --help                            help for gossh\n\nUse \"gossh [command] --help\" for more information about a command.\n```\n\n## 🚀 Performance\n\nClient server: `4vCPUs` and `8GiB`\n\nTarget servers: `hosts.list` contains `936` servers distributed in `86` different IDCs across the country.\n\n**Ansible:**\n\n```sh\n$ time ansible all -i hosts.list -m command -a \"uptime\" -f 100 -k\n```\n\nOutput:\n\n```text\n...\n\nreal    1m18.858s\nuser    3m18.566s\nsys     1m24.263s\n```\n\n**Gossh:**\n\n```sh\n$ time gossh command -i hosts.list -e \"uptime\" -c 100 -k\n```\n\nOutput:\n\n```text\n...\n\n[INFO] 2021-12-22 23:06:50.837228 success count: 936, failed count: 0, elapsed: 6.30s\n\nreal    0m6.316s\nuser    0m13.529s\nsys     0m0.592s\n```\n\n## 📄 Documentation\n\n- [Configuration](docs/config.md)\n- [Inventory](docs/inventory.md)\n- [Authentication](docs/authentication.md)\n- [Command](docs/command.md)\n- [Script](docs/script.md)\n- [Push](docs/push.md)\n- [Fetch](docs/fetch.md)\n- [Vault](docs/vault.md)\n\n## 📝 Changelog\n\n[CHANGELOG](CHANGELOG.md)\n\n## ✨ Contributing\n\nI actively welcome your pull requests, please follow the steps below:\n\n1. Open a new issue at [gossh/issues](https://github.com/windvalley/gossh/issues).\n\n2. Fork the repo and create your branch from `main`.\n\n3. Do the changes in your fork.\n\n4. Send a pull request.\n\n\u003e Note: Any contributions you make will be under the [MIT](LICENSE) Software License.\n\n## ⚖️ License\n\nThis project is under the MIT License.\nSee the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindvalley%2Fgossh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindvalley%2Fgossh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindvalley%2Fgossh/lists"}