SSH¶
The ssh
method gives a subshell pointed at the remote host. The API works as normal when in the context of a remote machine, although
the code executes client side.
Path
objects keep track of what machine they are for, and can be mixed and matched. This lets you express operations unambiguously:
1 2 3 4 5 6 7 |
|
Executing remote commands¶
You can execute commands remotely and access their output locally:
1 2 3 |
|
Downloading files¶
The wget
method normally downloads files to the machine where the script is run. For a remote shell, it will download directly to the
remote machine, without a roundtrip locally. It does this by executing curl
remotely. Progress tracking, error propagation, custom
headers and so on work as normal, so the API doesn't change.
Explicit scope and lifetime management¶
1 2 3 4 5 6 7 |
|
Threading¶
SSH sessions are not thread safe.