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)

The hostname or ip address to connect to

Tuple Fields of Hostname

0: String
Port(u16)

The port to connect to

Tuple Fields of Port

0: u16
LogLevel(LogLevel)

Tuple Fields of LogLevel

0: LogLevel
Socket(RawSocket)

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.

Tuple Fields of Socket

0: RawSocket
BindAddress(String)

The address to bind the client to

Tuple Fields of BindAddress

0: String
User(Option<String>)

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

Tuple Fields of User

0: Option<String>
SshDir(Option<String>)

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.

Tuple Fields of SshDir

0: Option<String>
KnownHosts(Option<String>)

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.

Tuple Fields of KnownHosts

0: Option<String>
ProxyCommand(Option<String>)

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

Tuple Fields of ProxyCommand

0: Option<String>
AddIdentity(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.

Tuple Fields of AddIdentity

0: String
Timeout(Duration)

Set a timeout for the connection

Tuple Fields of Timeout

0: Duration

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.