pub struct ServerOptions {Show 18 fields
pub address: String,
pub version: String,
pub banner: Option<String>,
pub banner_handler: Option<BannerHandler>,
pub host_key_path: Option<String>,
pub host_key_pem: Option<Vec<u8>>,
pub middlewares: Vec<Middleware>,
pub handler: Option<Handler>,
pub auth_handler: Option<Arc<dyn AuthHandler>>,
pub public_key_handler: Option<PublicKeyHandler>,
pub password_handler: Option<PasswordHandler>,
pub keyboard_interactive_handler: Option<KeyboardInteractiveHandler>,
pub idle_timeout: Option<Duration>,
pub max_timeout: Option<Duration>,
pub subsystem_handlers: HashMap<String, SubsystemHandler>,
pub max_auth_attempts: u32,
pub auth_rejection_delay_ms: u64,
pub allow_no_auth: bool,
}Expand description
Options for configuring the SSH server.
Fields§
§address: StringListen address.
version: StringServer version string.
Static banner.
Dynamic banner handler.
host_key_path: Option<String>Host key path.
host_key_pem: Option<Vec<u8>>Host key PEM data.
middlewares: Vec<Middleware>Middlewares to apply.
handler: Option<Handler>Main handler.
auth_handler: Option<Arc<dyn AuthHandler>>Trait-based authentication handler. If set, takes precedence over the callback-based handlers.
public_key_handler: Option<PublicKeyHandler>Public key auth handler (callback-based, for backward compatibility).
password_handler: Option<PasswordHandler>Password auth handler (callback-based, for backward compatibility).
keyboard_interactive_handler: Option<KeyboardInteractiveHandler>Keyboard-interactive auth handler.
idle_timeout: Option<Duration>Idle timeout.
max_timeout: Option<Duration>Maximum connection timeout.
subsystem_handlers: HashMap<String, SubsystemHandler>Subsystem handlers.
max_auth_attempts: u32Maximum authentication attempts before disconnection.
auth_rejection_delay_ms: u64Authentication rejection delay in milliseconds (timing attack mitigation).
allow_no_auth: boolAllow unauthenticated access when no auth handlers are configured.
When false (the default), connections are rejected if no auth
handlers (public key, password, keyboard-interactive, or trait-based)
are registered. Set to true only for development/demo servers
that intentionally allow anonymous access.
Trait Implementations§
Source§impl Clone for ServerOptions
impl Clone for ServerOptions
Source§fn clone(&self) -> ServerOptions
fn clone(&self) -> ServerOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more