pub struct SshShell { /* fields omitted */ }
Represents a connection via SSH to a particular source.
Returns a shell connected via the default private key at $HOME/.ssh/id_rsa
to the given
SSH server as the given user.
SshShell::with_default_key("markm", "myhost:22")?;
Returns a shell connected via private key file key
to the given SSH server as the given
user.
SshShell::with_key("markm", "myhost:22", "/home/foo/.ssh/id_rsa")?;
Toggles dry run mode. In dry run mode, commands are not executed remotely; we only print
what commands we would execute. Note that we do connect remotely, though. This is off by
default: we default to actually running the commands.
Run a command on the remote machine, blocking until the command completes.
Note that command using sudo
will hang indefinitely if sudo
asks for a password.
Run a command on the remote machine, without blocking until the command completes. A handle
is returned, which one can join
on to wait for process completion.
Note that command using sudo
will hang indefinitely if sudo
asks for a password.
Attempt to reconnect to the remote until it reconnects (possibly indefinitely).
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static