Linux command
clusterssh 命令
网络
需要网络或远程资源。
常用示例
Open SSH connections to multiple hosts
cssh [host1] [host2] [host3]
Connect to hosts defined in a cluster tag
cssh [cluster_name]
Connect with specific username
cssh -l [username] [host1] [host2]
Connect to hosts from a file
cssh -f [hosts.txt]
Open connections with custom terminal
cssh -T [/usr/bin/xterm] [host1] [host2]
List configured clusters
cssh -L
说明
ClusterSSH (cssh) opens multiple SSH terminal windows simultaneously, with a control window that broadcasts keystrokes to all connections. This enables running the same commands across multiple servers in parallel. Each host gets its own xterm window, arranged on screen automatically. Typing in the control window sends input to all terminals simultaneously. Individual terminals can be selected for host-specific commands. Clusters can be predefined in configuration files, grouping hosts by function (web servers, databases, etc.). Clusters can include other clusters, building hierarchies for complex environments.
参数
- -l _username_
- Username for SSH connections.
- -f _file_
- Read hosts from file (one per line).
- -T _terminal_
- Terminal application to use.
- -L
- List configured clusters.
- -c _config_
- Use alternate configuration file.
- -o _options_
- Pass options to SSH.
- -t _title_
- Set window title.
- -a _command_
- Run a command in each session immediately after connecting.
- -p _port_
- Override the default SSH port.
- -Q
- Do not close cssh when the last terminal exits.
- -q
- Quiet mode, suppress warnings.
- -d
- Enable debug output (can be repeated up to level 4).
FAQ
What is the clusterssh command used for?
ClusterSSH (cssh) opens multiple SSH terminal windows simultaneously, with a control window that broadcasts keystrokes to all connections. This enables running the same commands across multiple servers in parallel. Each host gets its own xterm window, arranged on screen automatically. Typing in the control window sends input to all terminals simultaneously. Individual terminals can be selected for host-specific commands. Clusters can be predefined in configuration files, grouping hosts by function (web servers, databases, etc.). Clusters can include other clusters, building hierarchies for complex environments.
How do I run a basic clusterssh example?
Run `cssh [host1] [host2] [host3]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -l _username_ do in clusterssh?
Username for SSH connections.