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.