Enum SshOption

Source
pub enum SshOption {
Show 21 variants Hostname(String), Port(u16), LogLevel(LogLevel), Socket(RawFd), BindAddress(String), User(Option<String>), SshDir(Option<String>), KnownHosts(Option<String>), ProxyCommand(Option<String>), AddIdentity(String), Timeout(Duration), IdentityAgent(Option<String>), KeyExchange(String), HostKeys(String), PublicKeyAcceptedTypes(String), CiphersCS(String), CiphersSC(String), HmacCS(String), HmacSC(String), ProcessConfig(bool), GlobalKnownHosts(Option<String>),
}
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

§

Port(u16)

The port to connect to

§

LogLevel(LogLevel)

§

Socket(RawFd)

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)

The address to bind the client to

§

User(Option<String>)

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

§

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.

§

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.

§

ProxyCommand(Option<String>)

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

§

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.

§

Timeout(Duration)

Set a timeout for the connection

§

IdentityAgent(Option<String>)

§

KeyExchange(String)

Set the key exchange method to be used. ex: ecdh-sha2-nistp256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

§

HostKeys(String)

Set the preferred server host key types. ex: ssh-rsa,rsa-sha2-256,ssh-dss,ecdh-sha2-nistp256

§

PublicKeyAcceptedTypes(String)

Set the preferred public key algorithms to be used for authentication as a comma-separated list. ex: ssh-rsa,rsa-sha2-256,ssh-dss,ecdh-sha2-nistp256

§

CiphersCS(String)

Set the symmetric cipher client to server as a comma-separated list.

§

CiphersSC(String)

Set the symmetric cipher server to client as a comma-separated list.

§

HmacCS(String)

Set the MAC algorithm client to server as a comma-separated list.

§

HmacSC(String)

Set the MAC algorithm server to client as a comma-separated list.

§

ProcessConfig(bool)

Set it to false to disable automatic processing of per-user and system-wide OpenSSH configuration files.

§

GlobalKnownHosts(Option<String>)

Set the global known hosts file name If the value is None, the directory is set to the default known hosts file, normally /etc/ssh/ssh_known_hosts. The known hosts file is used to certify remote hosts are genuine.

Trait Implementations§

Source§

impl Debug for SshOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.