{"id":13437636,"url":"https://github.com/six-ddc/hss","last_synced_at":"2025-04-05T22:06:12.804Z","repository":{"id":46094473,"uuid":"105174855","full_name":"six-ddc/hss","owner":"six-ddc","description":"An interactive parallel ssh client featuring autocomplete and asynchronous execution.","archived":false,"fork":false,"pushed_at":"2022-02-08T03:35:17.000Z","size":2938,"stargazers_count":361,"open_issues_count":8,"forks_count":23,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T20:05:14.442Z","etag":null,"topics":["autocompletion","command-line","multiple","parallel","pssh","readline","ssh","ssh-client"],"latest_commit_sha":null,"homepage":"","language":"C","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/six-ddc.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-28T16:51:33.000Z","updated_at":"2025-03-28T14:51:54.000Z","dependencies_parsed_at":"2022-07-19T01:33:03.999Z","dependency_job_id":null,"html_url":"https://github.com/six-ddc/hss","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/six-ddc%2Fhss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/six-ddc%2Fhss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/six-ddc%2Fhss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/six-ddc%2Fhss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/six-ddc","download_url":"https://codeload.github.com/six-ddc/hss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406087,"owners_count":20933803,"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":["autocompletion","command-line","multiple","parallel","pssh","readline","ssh","ssh-client"],"created_at":"2024-07-31T03:00:58.901Z","updated_at":"2025-04-05T22:06:12.733Z","avatar_url":"https://github.com/six-ddc.png","language":"C","readme":"# hss\n\n[![Release](http://github-release-version.herokuapp.com/github/six-ddc/hss/release.svg?style=flat)](https://github.com/six-ddc/hss/releases/latest)\n[![Build Status](https://travis-ci.org/six-ddc/hss.svg?branch=master)](https://travis-ci.org/six-ddc/hss)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n## 概述\n\nhss是一款可交互式的ssh批量执行命令的客户端，交互输入模式基于[libreadline](https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html)实现，使你能像操作bash一样地输入需要执行的命令，同时也支持命令搜索，历史命令纪录等。并且工具支持在输入命令时，按一下`tab`键，即可根据远程服务器的信息，进行文件路径和执行命令补全。另外命令的执行是异步的，无需等待一台机器命令执行完成才执行下一台的ssh操作，可支持同时操作数百台服务器。\n\n## 预览\n\n```\nUsage: hss [-f hostfile] [-o file] [-u username] [command]...\n\nOptions:\n  -f file        file with the list of hosts\n  -H host        specifies a host option, support the same options as the ssh command\n  -l limit       number of multiple ssh to perform at a time (default: unlimited)\n  -u user        the default user name to use when connecting to the remote server\n  -c opts        specify the common ssh options (i.e. '-p 22 -i identity_file')\n  -o file        write remote command output to a file\n  -i             force use a vi-style line editing interface\n  -v             be more verbose\n  -V             show program version\n  -h             display this message\n\nFor more information, see https://github.com/six-ddc/hss\n```\n\n* 使用效果图如下：\n\n[![asciicast](https://asciinema.org/a/233954.svg)](https://asciinema.org/a/233954)\n\n## 安装\n\n* MacOS\n\n```bash\nbrew install hss\n```\n\n* Linux\n\n    * 安装依赖\n\n    ```bash\n    ## on CentOS\n    yum install readline-devel\n\n    ## on Ubuntu / Debian \n    apt-get install libreadline6-dev\n    ```\n\n    * 编译\u0026安装\n\n    ```bash\n    make \u0026\u0026 make install\n    ```\n\n* 或者直接下载[Release文件](https://github.com/six-ddc/hss/releases)\n\n## 指南\n\nhss的实现原理是对每个host，直接调用本地的`ssh`命令去执行服务器操作，然后再通过进程间通信将执行结果返回给终端。\n\n故此hss支持所有的`ssh`命令的参数选项。以下是hostfile示例文件：\n\n```\n192.168.1.1\n-p 2222 root@192.168.1.2\n-p 2222 -i ~/.ssh/identity_file root@192.168.1.3\n-p 2222 -oConnectTimeout=3 root@192.168.1.4\n```\n\n连接上述机器的命令如下：\n\n```\n# 指定配置文件的方式\nhss -f hostfile\n\n# 通过传参的方式\nhss -H '192.168.1.1' -H '-p 2222 root@192.168.1.2' -H '-p 2222 -i ~/.ssh/identity_file root@192.168.1.3' -H '-p 2222 -oConnectTimeout=3 root@192.168.1.4'\n```\n\nhss命令本身也支持透传参数到ssh命令，，比如指定了`-c '-oConnectTimeout=3'`，那么对于没有配置超时时间的，将用该值作为超时设置。\n\n### readline使用\n\n可交互式的命令输入，基于`libreadline`实现，支持远程命令补全，远程文件路径补全，历史命令保存，历史命令搜索，快捷移动等。（更多命令参考[readline说明](http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC1)）\n\n* 输入的历史命令保存在`~/.hss_history`文件中\n* 远程命令和文件路径补全，数据信息来自于第一个host连接\n* 进行文件路径补全时，需要当前单词的首字符是`/`, `~`, `.`才可提示补全\n\n## 下版本方向\n\n* [x] 解决链接目录补全显示@结尾的问题\n\n\n","funding_links":[],"categories":["C","Command-Line Productivity","Admins","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsix-ddc%2Fhss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsix-ddc%2Fhss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsix-ddc%2Fhss/lists"}