multiSSH3 6.26__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.
- {multissh3-6.26 → multissh3-6.27}/PKG-INFO +16 -17
- {multissh3-6.26 → multissh3-6.27}/README.md +15 -13
- {multissh3-6.26 → multissh3-6.27}/multiSSH3.egg-info/PKG-INFO +16 -17
- {multissh3-6.26 → multissh3-6.27}/multiSSH3.egg-info/SOURCES.txt +3 -2
- {multissh3-6.26 → multissh3-6.27}/multiSSH3.py +947 -522
- {multissh3-6.26 → multissh3-6.27}/setup.py +0 -4
- {multissh3-6.26 → multissh3-6.27}/tests/test_cli_branches.py +8 -8
- {multissh3-6.26 → multissh3-6.27}/tests/test_cli_processing.py +22 -0
- multissh3-6.27/tests/test_config_cli.py +233 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_curses_branches.py +13 -0
- multissh3-6.27/tests/test_expand_hostnames.py +397 -0
- multissh3-6.27/tests/test_file_trust.py +258 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_helpers_extra.py +19 -0
- multissh3-6.27/tests/test_host.py +45 -0
- multissh3-6.27/tests/test_main_lifecycle.py +380 -0
- multissh3-6.27/tests/test_run_command.py +333 -0
- multissh3-6.27/tests/test_run_command_characterization.py +221 -0
- multissh3-6.27/tests/test_run_on_hosts.py +176 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_run_on_hosts_modes.py +23 -3
- multissh3-6.27/tests/test_stream_reader.py +133 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_unavailable_hosts.py +152 -3
- multissh3-6.26/multiSSH3.egg-info/requires.txt +0 -2
- multissh3-6.26/tests/test_config_cli.py +0 -58
- multissh3-6.26/tests/test_expand_hostnames.py +0 -100
- multissh3-6.26/tests/test_host.py +0 -36
- multissh3-6.26/tests/test_main_lifecycle.py +0 -187
- multissh3-6.26/tests/test_ordered_multiset.py +0 -45
- multissh3-6.26/tests/test_run_command.py +0 -178
- multissh3-6.26/tests/test_run_on_hosts.py +0 -49
- {multissh3-6.26 → multissh3-6.27}/multiSSH3.egg-info/dependency_links.txt +0 -0
- {multissh3-6.26 → multissh3-6.27}/multiSSH3.egg-info/entry_points.txt +0 -0
- {multissh3-6.26 → multissh3-6.27}/multiSSH3.egg-info/top_level.txt +0 -0
- {multissh3-6.26 → multissh3-6.27}/setup.cfg +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_color_helpers.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_compact_hostnames.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_config_validate.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_curses_event_loop.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_curses_tui.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_harness_smoke.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_ipmi_lockout_wait.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_output_merge.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_run_command_branches.py +0 -0
- {multissh3-6.26 → multissh3-6.27}/tests/test_runtime_branch_matrix.py +0 -0
- {multissh3-6.26 → 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.
|
|
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
|
-
>
|
|
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
|
|
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.
|
|
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:
|
|
@@ -565,7 +567,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
565
567
|
- Note: Timedout Hosts are considered unreachable.
|
|
566
568
|
- By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
|
|
567
569
|
- Unreachable hosts will be tried again when their timeout expires.
|
|
568
|
-
- mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in
|
|
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.
|
|
569
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.
|
|
570
572
|
|
|
571
573
|
### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
|
|
@@ -597,7 +599,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
597
599
|
### `--store_config_file [STORE_CONFIG_FILE]` | None
|
|
598
600
|
- Store the current command line options to a config file.
|
|
599
601
|
- Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
|
|
600
|
-
-
|
|
602
|
+
- Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
|
|
601
603
|
|
|
602
604
|
### `--debug` | False
|
|
603
605
|
- Enable debug mode.
|
|
@@ -721,7 +723,7 @@ options:
|
|
|
721
723
|
-ef, --env_file ENV_FILE
|
|
722
724
|
Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
|
|
723
725
|
-efs, --env_files ENV_FILES
|
|
724
|
-
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'
|
|
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'])
|
|
725
727
|
-m, --max_connections MAX_CONNECTIONS
|
|
726
728
|
Max number of connections to use (default: 4 * cpu_count)
|
|
727
729
|
-j, --json Output in json format. (default: False)
|
|
@@ -912,9 +914,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
|
|
|
912
914
|
'~/.zshrc',
|
|
913
915
|
'~/host.env',
|
|
914
916
|
'~/hosts.env',
|
|
915
|
-
'.env',
|
|
916
|
-
'host.env',
|
|
917
|
-
'hosts.env',
|
|
918
917
|
]
|
|
919
918
|
DEFAULT_NO_HISTORY = False
|
|
920
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
|
-
>
|
|
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
|
|
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.
|
|
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:
|
|
@@ -537,7 +542,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
537
542
|
- Note: Timedout Hosts are considered unreachable.
|
|
538
543
|
- By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
|
|
539
544
|
- Unreachable hosts will be tried again when their timeout expires.
|
|
540
|
-
- mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in
|
|
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.
|
|
541
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.
|
|
542
547
|
|
|
543
548
|
### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
|
|
@@ -569,7 +574,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
569
574
|
### `--store_config_file [STORE_CONFIG_FILE]` | None
|
|
570
575
|
- Store the current command line options to a config file.
|
|
571
576
|
- Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
|
|
572
|
-
-
|
|
577
|
+
- Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
|
|
573
578
|
|
|
574
579
|
### `--debug` | False
|
|
575
580
|
- Enable debug mode.
|
|
@@ -693,7 +698,7 @@ options:
|
|
|
693
698
|
-ef, --env_file ENV_FILE
|
|
694
699
|
Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
|
|
695
700
|
-efs, --env_files ENV_FILES
|
|
696
|
-
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'
|
|
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'])
|
|
697
702
|
-m, --max_connections MAX_CONNECTIONS
|
|
698
703
|
Max number of connections to use (default: 4 * cpu_count)
|
|
699
704
|
-j, --json Output in json format. (default: False)
|
|
@@ -884,9 +889,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
|
|
|
884
889
|
'~/.zshrc',
|
|
885
890
|
'~/host.env',
|
|
886
891
|
'~/hosts.env',
|
|
887
|
-
'.env',
|
|
888
|
-
'host.env',
|
|
889
|
-
'hosts.env',
|
|
890
892
|
]
|
|
891
893
|
DEFAULT_NO_HISTORY = False
|
|
892
894
|
DEFAULT_HISTORY_FILE = '~/.mssh_history'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multiSSH3
|
|
3
|
-
Version: 6.
|
|
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
|
-
>
|
|
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
|
|
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.
|
|
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:
|
|
@@ -565,7 +567,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
565
567
|
- Note: Timedout Hosts are considered unreachable.
|
|
566
568
|
- By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
|
|
567
569
|
- Unreachable hosts will be tried again when their timeout expires.
|
|
568
|
-
- mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in
|
|
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.
|
|
569
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.
|
|
570
572
|
|
|
571
573
|
### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
|
|
@@ -597,7 +599,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
597
599
|
### `--store_config_file [STORE_CONFIG_FILE]` | None
|
|
598
600
|
- Store the current command line options to a config file.
|
|
599
601
|
- Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
|
|
600
|
-
-
|
|
602
|
+
- Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
|
|
601
603
|
|
|
602
604
|
### `--debug` | False
|
|
603
605
|
- Enable debug mode.
|
|
@@ -721,7 +723,7 @@ options:
|
|
|
721
723
|
-ef, --env_file ENV_FILE
|
|
722
724
|
Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
|
|
723
725
|
-efs, --env_files ENV_FILES
|
|
724
|
-
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'
|
|
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'])
|
|
725
727
|
-m, --max_connections MAX_CONNECTIONS
|
|
726
728
|
Max number of connections to use (default: 4 * cpu_count)
|
|
727
729
|
-j, --json Output in json format. (default: False)
|
|
@@ -912,9 +914,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
|
|
|
912
914
|
'~/.zshrc',
|
|
913
915
|
'~/host.env',
|
|
914
916
|
'~/hosts.env',
|
|
915
|
-
'.env',
|
|
916
|
-
'host.env',
|
|
917
|
-
'hosts.env',
|
|
918
917
|
]
|
|
919
918
|
DEFAULT_NO_HISTORY = False
|
|
920
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
|