使用csshX同步管理多个SSH会话
前言
终端登录管理方案非常成熟除了耳熟能详的跨平台付费方案SeureCRT,Windows有Xshell,macOS有iTerm2,不过在macOS下想用到类似SecureCRT和Xshell一样的Send to all功能可能就没有这么方便了,而csshX正好可以满足批量管理操作的需求
使用csshX同步管理多个SSH会话
更新历史
2020年10月20日 - 更新csshx在macOS Catalina的使用
2018年11月26日 - 初稿
阅读原文 - https://wsgzao.github.io/post/csshx/
扩展阅读
csshx - https://github.com/brockgr/csshx
csshx简介
As csshX is a command line tool, no special installation is needed. It maybe copied into a directory in your path, (e.g. /usr/local/bin) for your convenience.
The software has been tested on Mac OS X 10.5, 10.6 and 10.7 with the default Perl installation - no additional Perl modules are required.
DOCUMENTATION:
1 | The documentation for csshX is self contained. Please run: |
使用brew安装csshx
Name: csshx
Use: Cluster ssh tool for Terminal.app
URL: https://github.com/brockgr/csshx
1 | # 安装homebrew |
csshx使用
当我们管理数十台或更多 Linux 服务器的时候,往往需要在每台服务器上执行同样的命令,比如我们想一次查看 10 台服务器(node)上系统负载情况,或者想知道哪台服务器有剩余内存可以分给新客户,又或者想执行 df 命令看看哪个服务器上还有多的硬盘空间等等,除了可以用脚本或工具统一收集这些信息外,我们还可以考虑使用一些同步管理多个 SSH 会话的小工具来帮助管理多台服务器,节省时间提高管理效率。在 Linux 上可以用 pdsh、ClusterSSH 和 mussh;在 Mac 上可以用 csshX.
1 | # 使用 csshX 很简单,如果要同时 ssh 到 4 个服务器可以直接传递IP |
其他问题
csshx is not working in New Mac OS Release MacOS Mojave
https://github.com/brockgr/csshx/issues/94
brew install parera10/csshx/csshx
1 | # If you already have installed it: |

