multiSSH3 6.25__tar.gz → 6.27__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. {multissh3-6.25 → multissh3-6.27}/PKG-INFO +21 -20
  2. {multissh3-6.25 → multissh3-6.27}/README.md +20 -16
  3. {multissh3-6.25 → multissh3-6.27}/multiSSH3.egg-info/PKG-INFO +21 -20
  4. {multissh3-6.25 → multissh3-6.27}/multiSSH3.egg-info/SOURCES.txt +3 -2
  5. {multissh3-6.25 → multissh3-6.27}/multiSSH3.egg-info/dependency_links.txt +0 -0
  6. {multissh3-6.25 → multissh3-6.27}/multiSSH3.egg-info/entry_points.txt +0 -0
  7. {multissh3-6.25 → multissh3-6.27}/multiSSH3.egg-info/top_level.txt +0 -0
  8. {multissh3-6.25 → multissh3-6.27}/multiSSH3.py +1164 -558
  9. {multissh3-6.25 → multissh3-6.27}/setup.py +0 -4
  10. {multissh3-6.25 → multissh3-6.27}/tests/test_cli_branches.py +8 -8
  11. {multissh3-6.25 → multissh3-6.27}/tests/test_cli_processing.py +22 -0
  12. multissh3-6.27/tests/test_config_cli.py +233 -0
  13. {multissh3-6.25 → multissh3-6.27}/tests/test_curses_branches.py +13 -0
  14. {multissh3-6.25 → multissh3-6.27}/tests/test_curses_event_loop.py +14 -0
  15. multissh3-6.27/tests/test_expand_hostnames.py +397 -0
  16. multissh3-6.27/tests/test_file_trust.py +258 -0
  17. multissh3-6.27/tests/test_helpers_extra.py +119 -0
  18. multissh3-6.27/tests/test_host.py +45 -0
  19. multissh3-6.27/tests/test_ipmi_lockout_wait.py +87 -0
  20. multissh3-6.27/tests/test_main_lifecycle.py +380 -0
  21. multissh3-6.27/tests/test_run_command.py +333 -0
  22. {multissh3-6.25 → multissh3-6.27}/tests/test_run_command_branches.py +126 -2
  23. multissh3-6.27/tests/test_run_command_characterization.py +221 -0
  24. multissh3-6.27/tests/test_run_on_hosts.py +176 -0
  25. {multissh3-6.25 → multissh3-6.27}/tests/test_run_on_hosts_modes.py +113 -0
  26. multissh3-6.27/tests/test_stream_reader.py +133 -0
  27. multissh3-6.27/tests/test_unavailable_hosts.py +333 -0
  28. multissh3-6.25/multiSSH3.egg-info/requires.txt +0 -2
  29. multissh3-6.25/tests/test_config_cli.py +0 -58
  30. multissh3-6.25/tests/test_expand_hostnames.py +0 -90
  31. multissh3-6.25/tests/test_helpers_extra.py +0 -64
  32. multissh3-6.25/tests/test_host.py +0 -36
  33. multissh3-6.25/tests/test_ipmi_lockout_wait.py +0 -32
  34. multissh3-6.25/tests/test_main_lifecycle.py +0 -132
  35. multissh3-6.25/tests/test_ordered_multiset.py +0 -45
  36. multissh3-6.25/tests/test_run_command.py +0 -178
  37. multissh3-6.25/tests/test_run_on_hosts.py +0 -49
  38. multissh3-6.25/tests/test_unavailable_hosts.py +0 -144
  39. {multissh3-6.25 → multissh3-6.27}/setup.cfg +0 -0
  40. {multissh3-6.25 → multissh3-6.27}/tests/test_color_helpers.py +0 -0
  41. {multissh3-6.25 → multissh3-6.27}/tests/test_compact_hostnames.py +0 -0
  42. {multissh3-6.25 → multissh3-6.27}/tests/test_config_validate.py +0 -0
  43. {multissh3-6.25 → multissh3-6.27}/tests/test_curses_tui.py +0 -0
  44. {multissh3-6.25 → multissh3-6.27}/tests/test_harness_smoke.py +0 -0
  45. {multissh3-6.25 → multissh3-6.27}/tests/test_output_merge.py +0 -0
  46. {multissh3-6.25 → multissh3-6.27}/tests/test_runtime_branch_matrix.py +0 -0
  47. {multissh3-6.25 → multissh3-6.27}/tests/test_smoke_optional.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 6.25
3
+ Version: 6.27
4
4
  Summary: Run commands on multiple hosts via SSH
5
5
  Home-page: https://github.com/yufei-pan/multiSSH3
6
6
  Author: Yufei Pan
@@ -13,8 +13,6 @@ Classifier: Operating System :: MacOS
13
13
  Classifier: Operating System :: Microsoft :: Windows
14
14
  Requires-Python: >=3.6
15
15
  Description-Content-Type: text/markdown
16
- Requires-Dist: argparse
17
- Requires-Dist: ipaddress
18
16
  Dynamic: author
19
17
  Dynamic: author-email
20
18
  Dynamic: classifier
@@ -22,7 +20,6 @@ Dynamic: description
22
20
  Dynamic: description-content-type
23
21
  Dynamic: home-page
24
22
  Dynamic: license
25
- Dynamic: requires-dist
26
23
  Dynamic: requires-python
27
24
  Dynamic: summary
28
25
 
@@ -168,13 +165,18 @@ to print the help message with current default values.
168
165
  Defaults are read from the following chain map stored as json files, top ones overwrite the bottom ones.:
169
166
  | `CONFIG_FILE_CHAIN` |
170
167
  | ------------------------------------------ |
171
- | `./multiSSH3.config.json` |
172
168
  | `~/multiSSH3.config.json` |
173
169
  | `~/.multiSSH3.config.json` |
174
170
  | `~/.config/multiSSH3/multiSSH3.config.json`|
175
171
  | `/etc/multiSSH3.d/multiSSH3.config.json` |
176
172
  | `/etc/multiSSH3.config.json` |
177
173
 
174
+ > The current directory is not searched: a cloned repo or an unpacked archive could otherwise change any setting, including which `ssh` runs. Use `--config_file` to load a config file from there; mssh prints a note when `./multiSSH3.config.json` exists (read automatically up to 6.26).
175
+ >
176
+ > Config and env files found on these default paths are only loaded when they are owned by you or root and nobody else can write to them (group write is fine when the group is your own private group). Others are skipped with a warning that shows the `chmod` fix. Files you name with `--config_file`, `--env_file` or `--env_files` are always loaded.
177
+ >
178
+ > `--store_config_file` writes the file readable by you only (`0600`), as it can hold passwords. The `/etc` locations above are written `0644` so every user can read them. An existing file's permissions are only ever tightened, and a file whose permissions cannot be restricted is left untouched (the config is printed instead).
179
+
178
180
  ### Generating / Storing Config File
179
181
  To store / generate a config file with the current command line options, you can use
180
182
  ```bash
@@ -188,7 +190,7 @@ mssh --store_config_file [STORE_CONFIG_FILE_PATH]
188
190
  >
189
191
  >`--generate_config_file` will output to stdout if `--config_file` is not specified.
190
192
 
191
- > Use `--store_config_file` without a path will store to `multiSSH3.config.json` in the current working directory.
193
+ > Without a path, `--store_config_file` writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
192
194
 
193
195
  You can modify the json file or use command line arguments to update values and store them as defaults.
194
196
  ```bash
@@ -200,7 +202,7 @@ will store
200
202
  "DEFAULT_CLI_TIMEOUT": "180"
201
203
  ...
202
204
  ```
203
- into `./multiSSH3.config.json`
205
+ into `~/.multiSSH3.config.json` (or the config file mssh loaded)
204
206
 
205
207
 
206
208
  > If you want to store password, it will be a plain text password in this config file. This will be better to supply it everytime as a CLI argument but you should really consider setting up public-key authentication.
@@ -262,7 +264,8 @@ When hostname need to be resolved, mssh will check in the following order:
262
264
  - Redo the whole range -> hostname resolution logic with the resolved env variable value.
263
265
  - hostname is in map generated from env_file(s) specified by `--env_files ENV_FILES`
264
266
  - Redo the whole range -> hostname resolution logic with the resolved env variable value.
265
- - Lookup using `socket.gethostbyname()` to query dns server. ( Slow! )
267
+ - Lookup using `socket.getaddrinfo()` to query dns server ( IPv4 preferred, IPv6 accepted ). Names are looked up in parallel.
268
+ - If the ssh config (`ssh -G`) maps the name to another `HostName` or through a `ProxyJump` / `ProxyCommand`, it is valid ( `#IP#` uses the `HostName`'s address when it resolves ). A catch-all block such as `Host *` only counts when it gives the name a `HostName` that resolves (e.g. `HostName %h.corp.example`), so typos are still rejected.
266
269
 
267
270
  > TLDR:
268
271
  >
@@ -285,12 +288,11 @@ When hostname need to be resolved, mssh will check in the following order:
285
288
  | `~/.zshrc` |
286
289
  | `~/host.env` |
287
290
  | `~/hosts.env` |
288
- | `.env` |
289
- | `host.env` |
290
- | `hosts.env` |
291
291
 
292
292
  Later files take precedence over earlier files.
293
293
 
294
+ > The current directory is not searched, as files there could redirect host aliases. Use `--env_files hosts.env` to add one. mssh points this out when a host name it cannot find is defined in `./.env`, `./host.env` or `./hosts.env` (read automatically up to 6.26).
295
+
294
296
  ### Example Env Hostname File
295
297
 
296
298
  An example hostname alias file will look like:
@@ -348,8 +350,9 @@ While leaving minimum 40 characters / 1 line for each host display by default. Y
348
350
  > ← or → : Move cursor
349
351
  > PgUp/Dn : Scroll history by 5
350
352
  > Home/End: Jump cursor
351
- > Esc : Clear line
353
+ > Esc : Clear / hide view
352
354
  > ```
355
+ > `Esc` clears the input line. On an empty input line it hides the live view; the commands keep running and their output is printed when they finish.
353
356
  > You can also toggle this help in curses by pressing `?` or `F1`.
354
357
 
355
358
  ### Command String Replacement
@@ -364,8 +367,6 @@ mssh will replace some magic strings in the command string with host specific va
364
367
  | `#USERNAME#` | Replaced with the username |
365
368
  | `#ID#` | Replaced with the ID of the host obj |
366
369
  | `#I# ` | Replaced with the index of the host |
367
- | `#PASSWD#` | Replaced with the password |
368
- | `#PASSWORD#` | Replaced with the password |
369
370
  | `#UUID#` | Replaced with the UUID of the host |
370
371
  | `#RESOLVEDNAME#`| Replaced with the resolved name |
371
372
  | `#IP#` | Replaced with the resolved IP |
@@ -383,6 +384,7 @@ Here details the options for multiSSH3 6.02 @ 2025-11-10
383
384
 
384
385
  ### `-p, --password PASSWORD` | _`DEFAULT_PASSWORD`_
385
386
  - You can specify the password for all hosts using this option. Although it is recommended to use SSH keys / store password in config file for authentication.
387
+ - Note: a password given on the command line is plain text. It can be seen by other local users (e.g. in `ps` and your shell history), is echoed in the `> mssh ...` line mssh prints at start, and is recorded in the history file (`-hf`, default `~/.mssh_history`) so the command can be replayed. mssh creates a new history file readable by its owner only (mode 600); an existing history file keeps its permissions. Use `-I, --no_history` to keep a command out of the history, or set `DEFAULT_PASSWORD` in a config file (also plain text, so keep that file private) to avoid typing it on the command line.
386
388
 
387
389
  ### `-k, --key, --identity [KEY]` | _`DEFAULT_IDENTITY_FILE`_
388
390
  - You can specify the identity file or folder to use for public key authentication. If a folder is specified, it will search for a key file inside the folder.
@@ -403,6 +405,8 @@ mssh -ea="--delete" -f ./data/ allServers /tmp/data/
403
405
 
404
406
  ### `-11, --oneonone` | _`DEFAULT_ONE_ON_ONE`_
405
407
  - Run commands in one-on-one mode, where each command corresponds to each host, front to back.
408
+ - Hosts are taken in the order they are given. A range or an environment variable expands in ascending order in its place, e.g. `b,a[1-2]` pairs the commands with `b`, `a1`, `a2`.
409
+ - Hosts skipped with `-X, --skip_hosts` are left out before pairing, so give one command per remaining host. An unreachable host keeps its command, which is skipped.
406
410
  - If command list length is not equal to expanded host list length, an error will be raised.
407
411
 
408
412
  ### `-f, --file FILE` | None
@@ -563,7 +567,7 @@ mssh -f ./data/ allServers /tmp/data/
563
567
  - Note: Timedout Hosts are considered unreachable.
564
568
  - By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
565
569
  - Unreachable hosts will be tried again when their timeout expires.
566
- - mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in a temperary file called __{username}_multiSSH3_UNAVAILABLE_HOSTS.csv in the system temp folder.
570
+ - mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in `unavailable_hosts.csv` in `$XDG_RUNTIME_DIR/multiSSH3/`, or else in a private `multiSSH3-<uid>` folder in the system temp folder ( cleared at reboot ). If neither can be used, they are only kept for the current run.
567
571
  - To force mssh to not use unreachable hosts from previous runs, you can use `-a, -nsu, --no_skip_unreachable` to set `skip_unreachable` to false.
568
572
 
569
573
  ### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
@@ -595,7 +599,7 @@ mssh -f ./data/ allServers /tmp/data/
595
599
  ### `--store_config_file [STORE_CONFIG_FILE]` | None
596
600
  - Store the current command line options to a config file.
597
601
  - Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
598
- - Outputs to `multiSSH3.config.json` in the current working directory if no path is specified.
602
+ - Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
599
603
 
600
604
  ### `--debug` | False
601
605
  - Enable debug mode.
@@ -719,7 +723,7 @@ options:
719
723
  -ef, --env_file ENV_FILE
720
724
  Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
721
725
  -efs, --env_files ENV_FILES
722
- The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env', '.env', 'host.env', 'hosts.env'])
726
+ The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env'])
723
727
  -m, --max_connections MAX_CONNECTIONS
724
728
  Max number of connections to use (default: 4 * cpu_count)
725
729
  -j, --json Output in json format. (default: False)
@@ -910,9 +914,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
910
914
  '~/.zshrc',
911
915
  '~/host.env',
912
916
  '~/hosts.env',
913
- '.env',
914
- 'host.env',
915
- 'hosts.env',
916
917
  ]
917
918
  DEFAULT_NO_HISTORY = False
918
919
  DEFAULT_HISTORY_FILE = '~/.mssh_history'
@@ -140,13 +140,18 @@ to print the help message with current default values.
140
140
  Defaults are read from the following chain map stored as json files, top ones overwrite the bottom ones.:
141
141
  | `CONFIG_FILE_CHAIN` |
142
142
  | ------------------------------------------ |
143
- | `./multiSSH3.config.json` |
144
143
  | `~/multiSSH3.config.json` |
145
144
  | `~/.multiSSH3.config.json` |
146
145
  | `~/.config/multiSSH3/multiSSH3.config.json`|
147
146
  | `/etc/multiSSH3.d/multiSSH3.config.json` |
148
147
  | `/etc/multiSSH3.config.json` |
149
148
 
149
+ > The current directory is not searched: a cloned repo or an unpacked archive could otherwise change any setting, including which `ssh` runs. Use `--config_file` to load a config file from there; mssh prints a note when `./multiSSH3.config.json` exists (read automatically up to 6.26).
150
+ >
151
+ > Config and env files found on these default paths are only loaded when they are owned by you or root and nobody else can write to them (group write is fine when the group is your own private group). Others are skipped with a warning that shows the `chmod` fix. Files you name with `--config_file`, `--env_file` or `--env_files` are always loaded.
152
+ >
153
+ > `--store_config_file` writes the file readable by you only (`0600`), as it can hold passwords. The `/etc` locations above are written `0644` so every user can read them. An existing file's permissions are only ever tightened, and a file whose permissions cannot be restricted is left untouched (the config is printed instead).
154
+
150
155
  ### Generating / Storing Config File
151
156
  To store / generate a config file with the current command line options, you can use
152
157
  ```bash
@@ -160,7 +165,7 @@ mssh --store_config_file [STORE_CONFIG_FILE_PATH]
160
165
  >
161
166
  >`--generate_config_file` will output to stdout if `--config_file` is not specified.
162
167
 
163
- > Use `--store_config_file` without a path will store to `multiSSH3.config.json` in the current working directory.
168
+ > Without a path, `--store_config_file` writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
164
169
 
165
170
  You can modify the json file or use command line arguments to update values and store them as defaults.
166
171
  ```bash
@@ -172,7 +177,7 @@ will store
172
177
  "DEFAULT_CLI_TIMEOUT": "180"
173
178
  ...
174
179
  ```
175
- into `./multiSSH3.config.json`
180
+ into `~/.multiSSH3.config.json` (or the config file mssh loaded)
176
181
 
177
182
 
178
183
  > If you want to store password, it will be a plain text password in this config file. This will be better to supply it everytime as a CLI argument but you should really consider setting up public-key authentication.
@@ -234,7 +239,8 @@ When hostname need to be resolved, mssh will check in the following order:
234
239
  - Redo the whole range -> hostname resolution logic with the resolved env variable value.
235
240
  - hostname is in map generated from env_file(s) specified by `--env_files ENV_FILES`
236
241
  - Redo the whole range -> hostname resolution logic with the resolved env variable value.
237
- - Lookup using `socket.gethostbyname()` to query dns server. ( Slow! )
242
+ - Lookup using `socket.getaddrinfo()` to query dns server ( IPv4 preferred, IPv6 accepted ). Names are looked up in parallel.
243
+ - If the ssh config (`ssh -G`) maps the name to another `HostName` or through a `ProxyJump` / `ProxyCommand`, it is valid ( `#IP#` uses the `HostName`'s address when it resolves ). A catch-all block such as `Host *` only counts when it gives the name a `HostName` that resolves (e.g. `HostName %h.corp.example`), so typos are still rejected.
238
244
 
239
245
  > TLDR:
240
246
  >
@@ -257,12 +263,11 @@ When hostname need to be resolved, mssh will check in the following order:
257
263
  | `~/.zshrc` |
258
264
  | `~/host.env` |
259
265
  | `~/hosts.env` |
260
- | `.env` |
261
- | `host.env` |
262
- | `hosts.env` |
263
266
 
264
267
  Later files take precedence over earlier files.
265
268
 
269
+ > The current directory is not searched, as files there could redirect host aliases. Use `--env_files hosts.env` to add one. mssh points this out when a host name it cannot find is defined in `./.env`, `./host.env` or `./hosts.env` (read automatically up to 6.26).
270
+
266
271
  ### Example Env Hostname File
267
272
 
268
273
  An example hostname alias file will look like:
@@ -320,8 +325,9 @@ While leaving minimum 40 characters / 1 line for each host display by default. Y
320
325
  > ← or → : Move cursor
321
326
  > PgUp/Dn : Scroll history by 5
322
327
  > Home/End: Jump cursor
323
- > Esc : Clear line
328
+ > Esc : Clear / hide view
324
329
  > ```
330
+ > `Esc` clears the input line. On an empty input line it hides the live view; the commands keep running and their output is printed when they finish.
325
331
  > You can also toggle this help in curses by pressing `?` or `F1`.
326
332
 
327
333
  ### Command String Replacement
@@ -336,8 +342,6 @@ mssh will replace some magic strings in the command string with host specific va
336
342
  | `#USERNAME#` | Replaced with the username |
337
343
  | `#ID#` | Replaced with the ID of the host obj |
338
344
  | `#I# ` | Replaced with the index of the host |
339
- | `#PASSWD#` | Replaced with the password |
340
- | `#PASSWORD#` | Replaced with the password |
341
345
  | `#UUID#` | Replaced with the UUID of the host |
342
346
  | `#RESOLVEDNAME#`| Replaced with the resolved name |
343
347
  | `#IP#` | Replaced with the resolved IP |
@@ -355,6 +359,7 @@ Here details the options for multiSSH3 6.02 @ 2025-11-10
355
359
 
356
360
  ### `-p, --password PASSWORD` | _`DEFAULT_PASSWORD`_
357
361
  - You can specify the password for all hosts using this option. Although it is recommended to use SSH keys / store password in config file for authentication.
362
+ - Note: a password given on the command line is plain text. It can be seen by other local users (e.g. in `ps` and your shell history), is echoed in the `> mssh ...` line mssh prints at start, and is recorded in the history file (`-hf`, default `~/.mssh_history`) so the command can be replayed. mssh creates a new history file readable by its owner only (mode 600); an existing history file keeps its permissions. Use `-I, --no_history` to keep a command out of the history, or set `DEFAULT_PASSWORD` in a config file (also plain text, so keep that file private) to avoid typing it on the command line.
358
363
 
359
364
  ### `-k, --key, --identity [KEY]` | _`DEFAULT_IDENTITY_FILE`_
360
365
  - You can specify the identity file or folder to use for public key authentication. If a folder is specified, it will search for a key file inside the folder.
@@ -375,6 +380,8 @@ mssh -ea="--delete" -f ./data/ allServers /tmp/data/
375
380
 
376
381
  ### `-11, --oneonone` | _`DEFAULT_ONE_ON_ONE`_
377
382
  - Run commands in one-on-one mode, where each command corresponds to each host, front to back.
383
+ - Hosts are taken in the order they are given. A range or an environment variable expands in ascending order in its place, e.g. `b,a[1-2]` pairs the commands with `b`, `a1`, `a2`.
384
+ - Hosts skipped with `-X, --skip_hosts` are left out before pairing, so give one command per remaining host. An unreachable host keeps its command, which is skipped.
378
385
  - If command list length is not equal to expanded host list length, an error will be raised.
379
386
 
380
387
  ### `-f, --file FILE` | None
@@ -535,7 +542,7 @@ mssh -f ./data/ allServers /tmp/data/
535
542
  - Note: Timedout Hosts are considered unreachable.
536
543
  - By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
537
544
  - Unreachable hosts will be tried again when their timeout expires.
538
- - mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in a temperary file called __{username}_multiSSH3_UNAVAILABLE_HOSTS.csv in the system temp folder.
545
+ - mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in `unavailable_hosts.csv` in `$XDG_RUNTIME_DIR/multiSSH3/`, or else in a private `multiSSH3-<uid>` folder in the system temp folder ( cleared at reboot ). If neither can be used, they are only kept for the current run.
539
546
  - To force mssh to not use unreachable hosts from previous runs, you can use `-a, -nsu, --no_skip_unreachable` to set `skip_unreachable` to false.
540
547
 
541
548
  ### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
@@ -567,7 +574,7 @@ mssh -f ./data/ allServers /tmp/data/
567
574
  ### `--store_config_file [STORE_CONFIG_FILE]` | None
568
575
  - Store the current command line options to a config file.
569
576
  - Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
570
- - Outputs to `multiSSH3.config.json` in the current working directory if no path is specified.
577
+ - Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
571
578
 
572
579
  ### `--debug` | False
573
580
  - Enable debug mode.
@@ -691,7 +698,7 @@ options:
691
698
  -ef, --env_file ENV_FILE
692
699
  Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
693
700
  -efs, --env_files ENV_FILES
694
- The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env', '.env', 'host.env', 'hosts.env'])
701
+ The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env'])
695
702
  -m, --max_connections MAX_CONNECTIONS
696
703
  Max number of connections to use (default: 4 * cpu_count)
697
704
  -j, --json Output in json format. (default: False)
@@ -882,9 +889,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
882
889
  '~/.zshrc',
883
890
  '~/host.env',
884
891
  '~/hosts.env',
885
- '.env',
886
- 'host.env',
887
- 'hosts.env',
888
892
  ]
889
893
  DEFAULT_NO_HISTORY = False
890
894
  DEFAULT_HISTORY_FILE = '~/.mssh_history'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 6.25
3
+ Version: 6.27
4
4
  Summary: Run commands on multiple hosts via SSH
5
5
  Home-page: https://github.com/yufei-pan/multiSSH3
6
6
  Author: Yufei Pan
@@ -13,8 +13,6 @@ Classifier: Operating System :: MacOS
13
13
  Classifier: Operating System :: Microsoft :: Windows
14
14
  Requires-Python: >=3.6
15
15
  Description-Content-Type: text/markdown
16
- Requires-Dist: argparse
17
- Requires-Dist: ipaddress
18
16
  Dynamic: author
19
17
  Dynamic: author-email
20
18
  Dynamic: classifier
@@ -22,7 +20,6 @@ Dynamic: description
22
20
  Dynamic: description-content-type
23
21
  Dynamic: home-page
24
22
  Dynamic: license
25
- Dynamic: requires-dist
26
23
  Dynamic: requires-python
27
24
  Dynamic: summary
28
25
 
@@ -168,13 +165,18 @@ to print the help message with current default values.
168
165
  Defaults are read from the following chain map stored as json files, top ones overwrite the bottom ones.:
169
166
  | `CONFIG_FILE_CHAIN` |
170
167
  | ------------------------------------------ |
171
- | `./multiSSH3.config.json` |
172
168
  | `~/multiSSH3.config.json` |
173
169
  | `~/.multiSSH3.config.json` |
174
170
  | `~/.config/multiSSH3/multiSSH3.config.json`|
175
171
  | `/etc/multiSSH3.d/multiSSH3.config.json` |
176
172
  | `/etc/multiSSH3.config.json` |
177
173
 
174
+ > The current directory is not searched: a cloned repo or an unpacked archive could otherwise change any setting, including which `ssh` runs. Use `--config_file` to load a config file from there; mssh prints a note when `./multiSSH3.config.json` exists (read automatically up to 6.26).
175
+ >
176
+ > Config and env files found on these default paths are only loaded when they are owned by you or root and nobody else can write to them (group write is fine when the group is your own private group). Others are skipped with a warning that shows the `chmod` fix. Files you name with `--config_file`, `--env_file` or `--env_files` are always loaded.
177
+ >
178
+ > `--store_config_file` writes the file readable by you only (`0600`), as it can hold passwords. The `/etc` locations above are written `0644` so every user can read them. An existing file's permissions are only ever tightened, and a file whose permissions cannot be restricted is left untouched (the config is printed instead).
179
+
178
180
  ### Generating / Storing Config File
179
181
  To store / generate a config file with the current command line options, you can use
180
182
  ```bash
@@ -188,7 +190,7 @@ mssh --store_config_file [STORE_CONFIG_FILE_PATH]
188
190
  >
189
191
  >`--generate_config_file` will output to stdout if `--config_file` is not specified.
190
192
 
191
- > Use `--store_config_file` without a path will store to `multiSSH3.config.json` in the current working directory.
193
+ > Without a path, `--store_config_file` writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
192
194
 
193
195
  You can modify the json file or use command line arguments to update values and store them as defaults.
194
196
  ```bash
@@ -200,7 +202,7 @@ will store
200
202
  "DEFAULT_CLI_TIMEOUT": "180"
201
203
  ...
202
204
  ```
203
- into `./multiSSH3.config.json`
205
+ into `~/.multiSSH3.config.json` (or the config file mssh loaded)
204
206
 
205
207
 
206
208
  > If you want to store password, it will be a plain text password in this config file. This will be better to supply it everytime as a CLI argument but you should really consider setting up public-key authentication.
@@ -262,7 +264,8 @@ When hostname need to be resolved, mssh will check in the following order:
262
264
  - Redo the whole range -> hostname resolution logic with the resolved env variable value.
263
265
  - hostname is in map generated from env_file(s) specified by `--env_files ENV_FILES`
264
266
  - Redo the whole range -> hostname resolution logic with the resolved env variable value.
265
- - Lookup using `socket.gethostbyname()` to query dns server. ( Slow! )
267
+ - Lookup using `socket.getaddrinfo()` to query dns server ( IPv4 preferred, IPv6 accepted ). Names are looked up in parallel.
268
+ - If the ssh config (`ssh -G`) maps the name to another `HostName` or through a `ProxyJump` / `ProxyCommand`, it is valid ( `#IP#` uses the `HostName`'s address when it resolves ). A catch-all block such as `Host *` only counts when it gives the name a `HostName` that resolves (e.g. `HostName %h.corp.example`), so typos are still rejected.
266
269
 
267
270
  > TLDR:
268
271
  >
@@ -285,12 +288,11 @@ When hostname need to be resolved, mssh will check in the following order:
285
288
  | `~/.zshrc` |
286
289
  | `~/host.env` |
287
290
  | `~/hosts.env` |
288
- | `.env` |
289
- | `host.env` |
290
- | `hosts.env` |
291
291
 
292
292
  Later files take precedence over earlier files.
293
293
 
294
+ > The current directory is not searched, as files there could redirect host aliases. Use `--env_files hosts.env` to add one. mssh points this out when a host name it cannot find is defined in `./.env`, `./host.env` or `./hosts.env` (read automatically up to 6.26).
295
+
294
296
  ### Example Env Hostname File
295
297
 
296
298
  An example hostname alias file will look like:
@@ -348,8 +350,9 @@ While leaving minimum 40 characters / 1 line for each host display by default. Y
348
350
  > ← or → : Move cursor
349
351
  > PgUp/Dn : Scroll history by 5
350
352
  > Home/End: Jump cursor
351
- > Esc : Clear line
353
+ > Esc : Clear / hide view
352
354
  > ```
355
+ > `Esc` clears the input line. On an empty input line it hides the live view; the commands keep running and their output is printed when they finish.
353
356
  > You can also toggle this help in curses by pressing `?` or `F1`.
354
357
 
355
358
  ### Command String Replacement
@@ -364,8 +367,6 @@ mssh will replace some magic strings in the command string with host specific va
364
367
  | `#USERNAME#` | Replaced with the username |
365
368
  | `#ID#` | Replaced with the ID of the host obj |
366
369
  | `#I# ` | Replaced with the index of the host |
367
- | `#PASSWD#` | Replaced with the password |
368
- | `#PASSWORD#` | Replaced with the password |
369
370
  | `#UUID#` | Replaced with the UUID of the host |
370
371
  | `#RESOLVEDNAME#`| Replaced with the resolved name |
371
372
  | `#IP#` | Replaced with the resolved IP |
@@ -383,6 +384,7 @@ Here details the options for multiSSH3 6.02 @ 2025-11-10
383
384
 
384
385
  ### `-p, --password PASSWORD` | _`DEFAULT_PASSWORD`_
385
386
  - You can specify the password for all hosts using this option. Although it is recommended to use SSH keys / store password in config file for authentication.
387
+ - Note: a password given on the command line is plain text. It can be seen by other local users (e.g. in `ps` and your shell history), is echoed in the `> mssh ...` line mssh prints at start, and is recorded in the history file (`-hf`, default `~/.mssh_history`) so the command can be replayed. mssh creates a new history file readable by its owner only (mode 600); an existing history file keeps its permissions. Use `-I, --no_history` to keep a command out of the history, or set `DEFAULT_PASSWORD` in a config file (also plain text, so keep that file private) to avoid typing it on the command line.
386
388
 
387
389
  ### `-k, --key, --identity [KEY]` | _`DEFAULT_IDENTITY_FILE`_
388
390
  - You can specify the identity file or folder to use for public key authentication. If a folder is specified, it will search for a key file inside the folder.
@@ -403,6 +405,8 @@ mssh -ea="--delete" -f ./data/ allServers /tmp/data/
403
405
 
404
406
  ### `-11, --oneonone` | _`DEFAULT_ONE_ON_ONE`_
405
407
  - Run commands in one-on-one mode, where each command corresponds to each host, front to back.
408
+ - Hosts are taken in the order they are given. A range or an environment variable expands in ascending order in its place, e.g. `b,a[1-2]` pairs the commands with `b`, `a1`, `a2`.
409
+ - Hosts skipped with `-X, --skip_hosts` are left out before pairing, so give one command per remaining host. An unreachable host keeps its command, which is skipped.
406
410
  - If command list length is not equal to expanded host list length, an error will be raised.
407
411
 
408
412
  ### `-f, --file FILE` | None
@@ -563,7 +567,7 @@ mssh -f ./data/ allServers /tmp/data/
563
567
  - Note: Timedout Hosts are considered unreachable.
564
568
  - By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
565
569
  - Unreachable hosts will be tried again when their timeout expires.
566
- - mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in a temperary file called __{username}_multiSSH3_UNAVAILABLE_HOSTS.csv in the system temp folder.
570
+ - mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in `unavailable_hosts.csv` in `$XDG_RUNTIME_DIR/multiSSH3/`, or else in a private `multiSSH3-<uid>` folder in the system temp folder ( cleared at reboot ). If neither can be used, they are only kept for the current run.
567
571
  - To force mssh to not use unreachable hosts from previous runs, you can use `-a, -nsu, --no_skip_unreachable` to set `skip_unreachable` to false.
568
572
 
569
573
  ### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
@@ -595,7 +599,7 @@ mssh -f ./data/ allServers /tmp/data/
595
599
  ### `--store_config_file [STORE_CONFIG_FILE]` | None
596
600
  - Store the current command line options to a config file.
597
601
  - Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
598
- - Outputs to `multiSSH3.config.json` in the current working directory if no path is specified.
602
+ - Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
599
603
 
600
604
  ### `--debug` | False
601
605
  - Enable debug mode.
@@ -719,7 +723,7 @@ options:
719
723
  -ef, --env_file ENV_FILE
720
724
  Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
721
725
  -efs, --env_files ENV_FILES
722
- The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env', '.env', 'host.env', 'hosts.env'])
726
+ The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env'])
723
727
  -m, --max_connections MAX_CONNECTIONS
724
728
  Max number of connections to use (default: 4 * cpu_count)
725
729
  -j, --json Output in json format. (default: False)
@@ -910,9 +914,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
910
914
  '~/.zshrc',
911
915
  '~/host.env',
912
916
  '~/hosts.env',
913
- '.env',
914
- 'host.env',
915
- 'hosts.env',
916
917
  ]
917
918
  DEFAULT_NO_HISTORY = False
918
919
  DEFAULT_HISTORY_FILE = '~/.mssh_history'
@@ -5,7 +5,6 @@ multiSSH3.egg-info/PKG-INFO
5
5
  multiSSH3.egg-info/SOURCES.txt
6
6
  multiSSH3.egg-info/dependency_links.txt
7
7
  multiSSH3.egg-info/entry_points.txt
8
- multiSSH3.egg-info/requires.txt
9
8
  multiSSH3.egg-info/top_level.txt
10
9
  tests/test_cli_branches.py
11
10
  tests/test_cli_processing.py
@@ -17,17 +16,19 @@ tests/test_curses_branches.py
17
16
  tests/test_curses_event_loop.py
18
17
  tests/test_curses_tui.py
19
18
  tests/test_expand_hostnames.py
19
+ tests/test_file_trust.py
20
20
  tests/test_harness_smoke.py
21
21
  tests/test_helpers_extra.py
22
22
  tests/test_host.py
23
23
  tests/test_ipmi_lockout_wait.py
24
24
  tests/test_main_lifecycle.py
25
- tests/test_ordered_multiset.py
26
25
  tests/test_output_merge.py
27
26
  tests/test_run_command.py
28
27
  tests/test_run_command_branches.py
28
+ tests/test_run_command_characterization.py
29
29
  tests/test_run_on_hosts.py
30
30
  tests/test_run_on_hosts_modes.py
31
31
  tests/test_runtime_branch_matrix.py
32
32
  tests/test_smoke_optional.py
33
+ tests/test_stream_reader.py
33
34
  tests/test_unavailable_hosts.py