CSFTP(1p)
β¨ CSFTP β the cluster admin era β¨
okay bestie, sit down, we're talking about csftp π
it's a Cluster administration tool and honestly it's giving "one keyboard, twenty servers, zero regrets" π
πΈ VERSION
this doc is for version 4.18 π (yes, we're keeping receipts)
π¦ SYNOPSIS
csftp [-a '<command>'] [-K <seconds>] [-q] [-c '<filename>'] [-x <cols>]
[-C '<filename>'] [--debug [[...] || <INTEGER>]] [-d] [-e
'<[user@]<host>[:port]>'] [--fillscreen] [-f '<font>'] [-h] [-L '[tag]']
[-H] [-o '<STRING>'] [-p <port>] [-Q] [-y <rows>] [-s] [-r '<filename>']
[-t '<STRING>'] [-g] [-T '<title>'] [-u] [-?] [-A] [-l '<username>']
[-v]
π RELATED
lowkey you should also go read the individual man pages for each of these lil utilities, they're all part of the family:
cconβ uses'console'as the communication methodcrshβ uses'rsh'as the communication methodcsshβ uses'ssh'as the communication methodctelβ uses'telnet'as the communication method
π DESCRIPTION
this command opens an administration console and an xterm to every host you point it at. anything you type into the administration console gets replicated to all the windows π and yes, you can also just type directly into any individual window, that's allowed, we're flexible.
it's built for cluster administration (but not only that, don't gatekeep) β specifically for when the same configuration or the same commands gotta run on every node in the cluster. running them all at once through this tool is literally how you keep all your nodes in sync, no cap π
connections get opened using sftp, which has to be correctly installed and configured. (emphasis on correctly, bestie. we don't do half-configured here π)
β οΈ extra caution required when you're editing files β οΈ lines may not necessarily be in the same order across servers. assuming line 5 is the same everywhere and just editing that?? dangerous. genuinely dangerous. it's way better to search for the specific line you wanna change and double-check that every single terminal is showing what you expect before you commit any changes. please. for me. π«Ά
π§ Further Notes
also go look at "KNOWN BUGS", k?
- the dotted line on any sub-menu is a tear-off β like, click on it and the sub-menu becomes its own whole window. main character energy tbh π
- unchecking a hostname in the Hosts sub-menu unplugs that host from the cluster control window, so nothing you type into the console gets sent to it. re-select it and it's plugged back in. it's giving plug and play π
- if your window manager menu bars are getting obscured by terminal windows, go check out the
screen_reserve_XXXXXoptions in the$HOME/.clusterssh/configfile (peep "FILES"). - if the terminals are overlapping way too much, go check out the
terminal_reserve_XXXXXoptions in the$HOME/.clusterssh/configfile (again, see "FILES"). - when you're using ClusterSSH on a big number of systems to connect to a single system using an SSH utility β like, say, you fire off a command to copy a file with
scpfrom the remote computers over to one single host β and those connections need authentication (aka you're about to authenticate with a password), thesshddaemon at that location may refuse connections once the"MaxStartups"limit insshd_configis exceeded. (if that value isn't set, it defaults to10.) this is expected behavior, it's not a bug β sshd uses this exact mechanism to prevent DoS attacks from unauthenticated sources. so pls tunesshd_configand reload the SSH daemon, or consider using the~/.ssh/authorized_keysmechanism for authentication if you run into this π - if client windows fail to open, try running:
csftp -e {single host name}
that tests the mechanisms used to open windows to hosts. the culprit could be either the -xrm terminal option, which enables AllowSendEvents (heads up: some terminals don't require this option at all, and other terminals have a totally different method for enabling it β check your terminal's documentation), or it could be the configuration of sftp.
β¨ OPTIONS β¨
some of these options can also be defined inside the configuration file π default options are shown where appropriate, as is tradition.
--action '<command>', -a '<command>'β run that command in every single session. like-a 'vi /etc/hosts'drops you straight into a vi session, no detours πΈ--autoclose <seconds>, -K <seconds>β how many seconds to wait before closing terminal windows that are finished.--autoquit, -qβ toggle automatically quitting once the last client window has closed (this overrides the config file, we love an override).--cluster-file '<filename>', -c '<filename>'β use the file you supply as an additional cluster file (see also "FILES").--cols <cols>, -x <cols>β number of columns--config-file '<filename>', -C '<filename>'β use the file you supply as an additional configuration file (see also "FILES").--debug [[...] || <INTEGER>]β turn on debugging. you can either hand it a level, or just repeat the option multiple times. maximum level is9π₯--dump-config, -dβ dump the current configuration in the same format that the$HOME/.clusterssh/configfile uses.--evaluate '<[user@]<host>[:port]>', -e '<[user@]<host>[:port]>'β display and evaluate the terminal and connection arguments so you can spot any potential errors. the<hostname>is required here to help with the evaluation.--fillscreenβ resize terminal windows so they fill the whole available screen. everything. all of it. π--font '<font>', -f '<font>'β specify the font to use in the terminal windows. use standard X font notation like"5x8".--help, -hβ show basic help text and exit--list '[tag]', -L '[tag]'β list available cluster tags. the tag is optional. if you do provide a tag, then the hosts for that tag get listed. NOTE: the format of the output changes when you use the"--quiet"or"-Q"option π--man, -Hβ show the full help text (that's the man page, babes) and exit--options '<STRING>', -o '<STRING>'β specify arguments to pass to ssh when making the connection. NOTE: options for ssh should normally just live in the ssh configuration file; see"ssh_config"and$HOME/.ssh/configfor more details.
Default: -x -o ConnectTimeout=10
--port <port>, -p <port>β specify an alternate port for connections.--quiet, -Qβ don't output extra text when using some options π€«--rows <rows>, -y <rows>β number of rows--show-history, -sβ show history inside the console window.--tag-file '<filename>', -r '<filename>'β use the file you supply as an additional tag file (see also "FILES").--term-args '<STRING>', -t '<STRING>'β specify arguments to pass to the terminals being used.--tile, -gβ toggle window tiling (overriding the config file).--title '<title>', -T '<title>'β specify the initial part of the title used in the console and the client windows.--unique-servers, -uβ toggle connecting to each host only once when a hostname has been specified multiple times.--usage, -?β show the synopsis and exit--use-all-a-records, -Aβ if a hostname resolves to multiple IP addresses, toggle whether to connect to all of them, or just the first one (see also the config file entry).--username '<username>', -l '<username>'β specify the default username to use for connections (if it's different from whoever's currently logged in). NOTE: this will get overridden by<user>@<host>π--version, -vβ show version information and exit
π ARGUMENTS
these are the arguments we support, bestie:
[user@]<hostname>[:port] ...β open an xterm to the given hostname and connect it to the administration console. the optional port number comes in handy when the server isn't listening on the standard port.<tag> ...β open a series of xterms defined by<tag>in one of the supplementary configuration files (see "FILES").
Note: if you specify a username on a cluster tag, it'll override any usernames defined in that cluster.
π KEY SHORTCUTS
these shortcuts all work inside the console window π and all of them can be changed via the configuration files, if you're feeling custom.
- Control-Shift-plus β open the
'Add Host(s) or Cluster(s)'dialogue box. you can enter multiple host or cluster names, separated by spaces. - Alt-n β paste in the hostname part of the specific connection string into each client, minus any username or port. e.g.
scp /etc/hosts server:files/<Alt-n>.hosts
would replace the <Alt-n> with the client's name in each window.
- Alt-l β paste in the hostname of the server that
csshis being run on - Alt-q β quit the program and close all connections and windows π
- Alt-r β retile all the client windows.
- Alt-u β paste in the username for the connection
- Alt-1
- Alt-2
- Alt-3
- Alt-4 β run the matching user defined macro on the server and send the output over to the client
πΈ EXAMPLES
Open up a session to 3 servers
$ csftp server1 server2 server3
Open up a session to a cluster of servers identified by the tag 'farm1' and give the controlling window a specific title β where that tag is defined in one of the default configuration files:
$ csftp -T 'Web Farm Cluster 1' farm1
Connect to different servers using different login names. NOTE: you can also pull this off by setting up appropriate options in the configuration files. also don't close the console when the last terminal exits.
$ csftp user1@server1 admin@server2
Open up a cluster defined in a non-default configuration file
$ csftp -c $HOME/cssh.extra_clusters db_cluster
Override the configured/default port to use 2022 instead
$ csftp -p 2022 server1 server2
π¦ FILES
/etc/clusters,$HOME/.clusterssh/clustersβ these files hold a list of tags-to-server-names mappings π when any name gets used on the command line, it's checked to see if it's a tag. if it is a tag, then that tag gets replaced with the list of servers. the format goes like this:
<tag> [user@]<server>[:port] [user@]<server>[:port] [...]
e.g.
# List of servers in live
live admin1@server1 admin2@server2:2022 server3 server4
all comments (marked by a #) and blank lines are ignored. tags may be nested, but be aware of using recursive tags, because they are not checked for π
servers can be defined using expansion macros:
"webservers websvr{a,b,c}"
would expand to
"webservers websvra websvrb websvrc"
and
"webservers websvr{6..9}"
would expand to
"webservers websvr6 websvr7 websvr8 websvr9"
extra cluster files can also be specified either as an option on the command line (see "cluster-file") or in the user's $HOME/.clusterssh/config file (see the "extra_cluster_file" configuration option).
NOTE: the last tag read overwrites any pre-existing tag of that name.
NOTE: there's a special cluster tag called "default" β any tags or hosts included inside this tag get automatically opened if nothing is specified on the command line β
π·οΈ /etc/tags, $HOME/.clusterssh/tags
Very similar to clusters files, but the definition is reversed. The format is:
<host> <tag> [...]
This allows one host to be specified as a member of a number of tags. This format can be clearer than using clusters files.
Extra tag files may be specified either as an option (see "tag-file") or within the user's $HOME/.clusterssh/config file (see "extra_tag_file" configuration option).
NOTE: All tags are added together
βοΈ /etc/csshrc & $HOME/.clusterssh/config
This file contains configuration overrides β the defaults are as marked. Default options are overwritten first by the global file, and then by the user file.
NOTE: values for entries do not need to be quoted unless it is required for passing arguments, e.g.
"terminal_allow_send_events="-xrm '*.VT100.allowSendEvents:true'""
should be written as
"terminal_allow_send_events=-xrm '*.VT100.allowSendEvents:true'"
Okay bestie, hereβs the whole config menu, and every single one is listed, no skips, periodt:
auto_close = 5β close terminal window after this many seconds. If set to0will instead wait on input from the user in each window before closing. See also--autocloseand--no-autoclose.auto_quit = 1β automatically quit after the last client window closes. Set to0to disable. See also--autoquit.auto_wm_decoration_offsets = noβ enable or disable alternative algorithm for calculating terminal positioning.command_pre =command_post =
Add extra commands around the communication method. For example:
command_pre= . $HOME/virtualenvs/default/bin/active ;
command_post= | ct
would allow for using Python virtual environments and then piping all shell output through "chromaterm" for syntax highlighting. Note: you must use appropriate command separators/terminators to keep the meaning of the command pipline (such as ";" and "|" between commands).
These are not put through macro parsing.
comms = sftpβ sets the default communication method (initially taken from the name of the program, but can be overridden here).console_position = <null>β set the initial position of the console β if empty then let the window manager decide. Format is'+<x>+<y>', i.e.'+0+0'is top left hand corner of the screen,'+0-70'is bottom left hand side of screen (more or less).external_command_mode = 0600β file mode bits for theexternal_command_pipe.external_command_pipe = <null>β define the full path to an external command pipe that can be written to for controlling some aspects of ClusterSSH, such as opening sessions to more clusters.
Commands:
"open <tag|hostname>"β open new sessions to provided tag or hostname"retile"β force window retiling
e.g.: "echo 'open localhost'" /path/to/external_command_pipe >>
external_cluster_command = <null>β define the full path to an external command that can be used to resolve tags to host names. This command can be written in any language. The script must accept a list of tags to resolve and output a list of hosts (space separated on a single line). Any tags that cannot be resolved should be returned unchanged.
A non-0 exit code will be counted as an error, a warning will be printed and output ignored.
If the external command is given a "-L" option it should output a list of tags (space separated on a single line) it can resolve
extra_cluster_file = <null>β define an extra cluster file in the format of/etc/clusters. Multiple files can be specified, separated by commas. Both~and$HOMEare acceptable as a reference to the user's home directory, e.g.
"extra_cluster_file = ~/clusters, $HOME/clus"
extra_tag_file = <null>β define an extra tag file in the format of/etc/tags. Multiple files can be specified, separated by commas. Both~and$HOMEare acceptable as a reference to the user's home directory, e.g.
"extra_tag_file = ~/tags, $HOME/tags"
key_addhost = Control-Shift-plusβ default key sequence to open AddHost menu. See"KEY SHORTCUTS"for more information.hide_menu = 0β if set to 1, hide the menu bar (File, Hosts, Send, Help) in the console.key_clientname = Alt-nβ default key sequence to send cssh client names to client. See"KEY SHORTCUTS"for more information.key_localname = Alt-lβ default key sequence to send hostname of local server to client. See"KEY SHORTCUTS"for more information.key_paste = Control-vβ default key sequence to paste text into the console window. See"KEY SHORTCUTS"for more information.key_quit = Control-qβ default key sequence to quit the program (will terminate all open windows). See"KEY SHORTCUTS"for more information.key_retilehosts = Alt-rβ default key sequence to retile host windows. See"KEY SHORTCUTS"for more information.key_username = Alt-uβ default key sequence to send username to client. See"KEY SHORTCUTS"for more information.key_user_1 = Alt-1key_user_2 = Alt-2key_user_3 = Alt-3key_user_4 = Alt-4
Default key sequence to send user defined macros to client. If the matching macro_user_1 macro is undefined, the sequence is passed straight to the terminal. See "KEY SHORTCUTS" for more information.
macro_servername = %smacro_hostname = %hmacro_username = %umacro_newline = %nmacro_version = %vmacro_user_1 = %1macro_user_2 = %2macro_user_3 = %3macro_user_4 = %4
Change the replacement macro used when either using a 'Send' menu item, or when pasting text into the main console.
macro_user_1_command =macro_user_2_command =macro_user_3_command =macro_user_4_command =
User defined macros β the macro is run through the shell on the server and the output is sent to the client. For example,
"macro_user_1_command=echo echo macro_user_1"
would send the text C<echo macro_user_1> into the terminal session.
"macro_user_1_command=env | grep CSSH"
would send the CSSH environment variables to the client.
The following environment variables are set in the shell of the macro process
"CSSH_SERVERNAME""CSSH_HOSTNAME""CSSH_USERNAME""CSSH_CONNECTION_STRING""CSSH_CONNECTION_PORT""CSSH_VERSION"
macros_enabled = yesβ enable or disable macro replacement. Note: this affects all the"macro_*"variables above.max_addhost_menu_cluster_items = 6β maximum number of entries in the 'Add Host' menu cluster list before scrollbars are usedmax_host_menu_items = 30β maximum number of hosts to put into the host menu before starting a new columnmenu_host_autotearoff = 0menu_send_autotearoff = 0
When set to non-0 will automatically tear-off the host or send menu at program start
mouse_paste = Button-2 (middle mouse button)β default key sequence to paste text into the console window using the mouse. See"KEY SHORTCUTS"for more information.rsh = /path/to/rshssh = /path/to/sshtelnet = /path/to/telnet
Set the path to the specific binary to use for the communication method, else uses the first match found in $PATH
rsh_args = <blank>ssh_args = "-x -o ConnectTimeout=10"telnet_args = <blank>
Sets any arguments to be used with the communication method (defaults to ssh arguments).
NOTE: The given defaults are based on OpenSSH, not commercial ssh software.
NOTE: Any"generic"change to the method (e.g., specifying the ssh port to use) should be done in the medium's own config file (see"ssh_config"and$HOME/.ssh/config).
screen_reserve_top = 0screen_reserve_bottom = 60screen_reserve_left = 0screen_reserve_right = 0
Number of pixels from the screen's side to reserve when calculating screen geometry for tiling. Setting this to something like 50 will help keep cssh from positioning windows over your window manager's menu bar if it draws one at that side of the screen.
terminal = /path/to/xtermβ path to the X-Windows terminal used for the client.terminal_args = <blank>β arguments to use when opening terminal windows. Otherwise takes defaults from$HOME/.Xdefaultsor$HOME/.Xresourcesfile.terminal_chdir = 0β when non-0, set the working directory for each terminal as per'terminal_chdir_path'terminal_chdir_path = $HOME/.clusterssh/work/%sβ path to use as working directory for each terminal when'terminal_chdir'is enabled. The path provided is passed through the macro parser (see the section above on'macros_enabled'.terminal_font = 6x13β font to use in the terminal windows. Use standard X font notation.terminal_reserve_top = 5terminal_reserve_bottom = 0terminal_reserve_left = 5terminal_reserve_right = 0
Number of pixels from the terminal's side to reserve when calculating screen geometry for tiling. Setting these will help keep cssh from positioning windows over your scroll and title bars or otherwise overlapping the windows too much.
terminal_colorize = 1β if set to 1 (the default), then"-bg"and"-fg"arguments will be added to the terminal invocation command-line. The terminal will be colored in a pseudo-random way based on the host name; while the color of a terminal is not easily predicted, it will always be the same color for a given host name. After a while, you will recognize hosts by their characteristic terminal color.terminal_bg_style = darkβ bestie, this is the palette switch π if you set it to"dark", the terminal background goes black and the foreground gets the pseudo-random color. If you set it to"light", it flips: foreground black, background pseudo-random color. BUT β ifterminal_colorizeis"zero", this whole setting does literally nothing. It's giving decoration only.terminal_size = 80x24β the initial size of the terminals. NOTE: when it resizes terminals for tiling, the number of lines (24) gets decreased β not the number of characters (80). Width stays iconic, height gets flexible β¨terminal_title_opt = -Tβ the option it passes to"terminal"to set the window title.terminal_allow_send_events = -xrm '*.VT100.allowSendEvents:true'β the option the terminal requires so it'll actually accept XSendEvents. No cap, it just needs this or it ghosts you.title = csshβ the title of the windows used for both the console and the terminals. One name, many windows, main character energy πunmap_on_redraw = noβ tells Tk to use theUnmapWindowrequest before redrawing terminal windows. It defaults to"no"because"yes"causes problems with the FVWM window manager. If you're getting weird redraw problems, you can set it to"yes"to let the window be unmapped before it's repositioned.use_all_a_records = 0β if a hostname resolves to multiple IP addresses, set this to1to connect to all of them, not just the first one found. See also"--use-all-a-records"}. (yes the stray brace is in the original, we're keeping it, periodt π )use_hotkeys = 1β set it to0and boom, every hotkey is disabled. Total silence. πuse_natural_sort = 0β windows normally sort alphabetically, so you gethost1,host11,host2. Setting this to1changes the sort order tohost1,host2,host11β the way your brain actually reads numbers. NOTE: you must have the perl moduleSort::Naturallyinstalled. No module, no sorted vibes π¦user = $LOGNAMEβ sets the default user for running commands on clients.window_tiling = 1β perform window tiling (set to0to disable). Tidy windows, tidy mind πwindow_tiling_direction = rightβ the direction to tile windows."right"means start top left, move right, then down. Anything else means start bottom right, move left, then up. Choose your adventure β¨
NOTE: the key shortcut modifiers must be in the form "Control", "Alt" or "Shift" β first letter capitalised, rest lowercase, iykyk. Keys can also be disabled one at a time by setting them to the word "null".
πΈ $HOME/.clusterssh/send_menu πΈ
This (optional) file contains the items that populate the send menu. The default entry could be written as:
<send_menu>
<menu title="Use Macros">
<toggle/>
<accelerator>ALT-p</accelerator>
</menu>
<menu title="Remote Hostname">
<command>%s</command>
<accelerator>ALT-n</accelerator>
</menu>
<menu title="Local Hostname">
<command>%s</command>
<accelerator>ALT-l</accelerator>
</menu>
<menu title="Username">
<command>%u</command>
<accelerator>ALT-u</accelerator>
</menu>
<menu title="Test Text">
<command>echo "ClusterSSH Version: %v%n</command>
</menu>
</send_menu>
Submenus can also be specified, like this:
<send_menu>
<menu title="Default Entries">
<detach>yes</detach>
<menu title="Hostname">
<command>%s</command>
<accelerator>ALT-n</accelerator>
</menu>
</menu>
</send_menu>
π Caveats, bestie, read these π
- There is currently no strict format checking of this file.
- The format of the file may change in the future.
- If the file exists, the default entry (Hostname) is not added.
The following replacement macros are available (note: these can be changed in the configuration file):
%sβ Hostname part of the specific connection string to each client, minus any username or port.%uβ Username part of the connection string to each client.%hβ Hostname of server wherecsshis being run from.%nβ"RETURN"code.
NOTE: requires XML::Simple to be installed. No module, no send menu, and we'd be sad π
π KNOWN BUGS π
If you have any ideas about how to fix the below bugs, please get in touch and/or provide a patch. We'd be obsessed.
- Swapping virtual desktops can cause a redraw of all the terminal windows. This is due to a lack of distinction within Tk between switching desktops and minimising/maximising windows. Until Tk can tell the difference between the two events, there is no fix (apart from rewriting everything directly in X). Yeah. π
π§ TROUBLESHOOTING π§
If you have issues running csftp, first try:
csftp -e [user@]<hostname>[:port]
This performs two tests to confirm cssh is able to work properly with the settings provided within the $HOME/.clusterssh/config file (or the internal defaults).
- Test the terminal window works with the options provided.
- Test
sftpworks to a host with the configured arguments.
Configuration options to watch for in ssh are:
SSHdoesn't understand"-o ConnectTimeout=10"β remove the option from the$HOME/.clusterssh/configfile.OpenSSH-3.8using untrusted ssh tunnels β use"-Y"instead of"-X", or use"ForwardX11Trusted yes"in$HOME/.ssh/ssh_config(if you change the default ssh options from"-x"to"-X").
π«Ά SUPPORT AND REPORTING BUGS π«Ά
A web site for comments, requests, bug reports and bug fixes/patches is available at: <https://github.com/duncs/clusterssh>
If you require support, please run the following commands and create an issue via: <https://github.com/duncs/clusterssh/issues>
perl -V
perl -MTk -e 'print $Tk::VERSION,$/'
perl -MX11::Protocol -e 'print $X11::Protocol::VERSION,$/'
cat /etc/csshrc $HOME/.clusterssh/config
Using the debug option (--debug) will turn on debugging output. Repeat the option to increase the amount of debug. However, if possible please only use this option with one host at a time, e.g. cssh --debug <host>, due to the amount of output produced (in both main and child windows). It's a lot. It's giving floodgate. π
π SEE ALSO π
<https://github.com/duncs/clusterssh/wiki/>, "ssh", Tk::overview, X11::Protocol, "perl"
π AUTHOR π
Duncan Ferguson, "<duncan_j_ferguson at yahoo.co.uk>"
π LICENSE AND COPYRIGHT π
Copyright 1999-2018 Duncan Ferguson.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
and that's the whole page bestie, we ate and left absolutely zero crumbs ππ
this lil run was served up by perl v5.40.1, dated 2026-01-14, and it's CSFTP(1p) β go forth and sftp slay β¨π§π
π¦ where this page comes from
- ubuntu resolute: clusterssh 4.18-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: clusterssh 4.18-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms