lmrc-ssh 0.3.16

SSH client library for the LMRC Stack - comprehensive library for executing remote SSH commands programmatically
Documentation
//! # SSH Manager
//!
//! A comprehensive Rust library for executing SSH commands programmatically.
//!
//! ## Features
//!
//! - Simple and intuitive API for SSH connections
//! - Execute remote commands with ease
//! - Flexible authentication (password, public key)
//! - Comprehensive error handling
//! - Well-documented with examples
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use lmrc_ssh::{SshClient, AuthMethod};
//!
//! # fn main() -> Result<(), lmrc_ssh::Error> {
//! // Connect with password authentication
//! let mut client = SshClient::new("example.com", 22)?
//!     .with_auth(AuthMethod::Password {
//!         username: "user".to_string(),
//!         password: "pass".to_string(),
//!     })
//!     .connect()?;
//!
//! // Execute a command
//! let output = client.execute("ls -la")?;
//! println!("Output: {}", output.stdout);
//! # Ok(())
//! # }
//! ```
//!
//! ## Examples
//!
//! ### Password Authentication
//!
//! ```rust,no_run
//! use lmrc_ssh::{SshClient, AuthMethod};
//!
//! # fn main() -> Result<(), lmrc_ssh::Error> {
//! let mut client = SshClient::new("192.168.1.100", 22)?
//!     .with_auth(AuthMethod::Password {
//!         username: "admin".to_string(),
//!         password: "secret".to_string(),
//!     })
//!     .connect()?;
//!
//! let result = client.execute("whoami")?;
//! println!("Current user: {}", result.stdout);
//! # Ok(())
//! # }
//! ```
//!
//! ### Public Key Authentication
//!
//! ```rust,no_run
//! use lmrc_ssh::{SshClient, AuthMethod};
//!
//! # fn main() -> Result<(), lmrc_ssh::Error> {
//! let mut client = SshClient::new("example.com", 22)?
//!     .with_auth(AuthMethod::PublicKey {
//!         username: "user".to_string(),
//!         private_key_path: "/home/user/.ssh/id_rsa".to_string(),
//!         passphrase: None,
//!     })
//!     .connect()?;
//!
//! let result = client.execute("hostname")?;
//! println!("Hostname: {}", result.stdout);
//! # Ok(())
//! # }
//! ```

mod client;
mod error;
mod output;

pub use client::{AuthMethod, SshClient};
pub use error::{Error, Result};
pub use output::CommandOutput;