Enum libssh_rs::SshOption[][src]

pub enum SshOption {
    Hostname(String),
    Port(u16),
    LogLevel(LogLevel),
    Socket(RawSocket),
    BindAddress(String),
    User(Option<String>),
    SshDir(Option<String>),
    KnownHosts(Option<String>),
    ProxyCommand(Option<String>),
    AddIdentity(String),
    Timeout(Duration),
}
Expand description

Allows configuring different aspects of a Session. You always need to set at least SshOption::Hostname.

Variants

Hostname(String)

Tuple Fields

0: String

The hostname or ip address to connect to

Port(u16)

Tuple Fields

0: u16

The port to connect to

LogLevel(LogLevel)

Tuple Fields

Socket(RawSocket)

Tuple Fields

The pre-opened socket. You don’t typically need to provide this. Don’t forget to set the hostname as the hostname is used as a key in the known_host mechanism.

BindAddress(String)

Tuple Fields

0: String

The address to bind the client to

User(Option<String>)

Tuple Fields

The username for authentication If the value is None, the username is set to the default username.

SshDir(Option<String>)

Tuple Fields

Set the ssh directory If the value is None, the directory is set to the default ssh directory. The ssh directory is used for files like known_hosts and identity (private and public key). It may include “%s” which will be replaced by the user home directory.

KnownHosts(Option<String>)

Tuple Fields

Set the known hosts file name If the value is None, the directory is set to the default known hosts file, normally ~/.ssh/known_hosts. The known hosts file is used to certify remote hosts are genuine. It may include “%d” which will be replaced by the user home directory.

ProxyCommand(Option<String>)

Tuple Fields

Configures the ProxyCommand ssh option, which is used to establish an alternative transport to using a direct TCP connection

AddIdentity(String)

Tuple Fields

0: String

Add a new identity file (const char *, format string) to the identity list. By default identity, id_dsa and id_rsa are checked. The identity used to authenticate with public key will be prepended to the list. It may include “%s” which will be replaced by the user home directory.

Timeout(Duration)

Tuple Fields

Set a timeout for the connection

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.