1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # 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(())
//! # }
//! ```
pub use ;
pub use ;
pub use CommandOutput;