Crate swarm_ssh

source ·
Expand description

Swarm SSH

Manage remote computers via ssh protocol.

Login

use diagnostic_quick::QResult;
use swarm_ssh::SwarmSSH;

async fn test_password() -> QResult<SwarmSSH> {
    SwarmSSH::login_password("192.168.1.100:22", "root", "password").await
}

Upload

use std::path::PathBuf;
use diagnostic_quick::QResult;
use swarm_ssh::SwarmSSH;

async fn test_password() -> QResult {
    let ssh = SwarmSSH::login_password("192.168.1.100:22", "root", "password").await?;
    let path = PathBuf::from("Cargo.toml");
    ssh.upload_task(&path, "/tmp/Cargo.toml")?.execute().await?;
    Ok(())
}

Download

use diagnostic_quick::QResult;
use swarm_ssh::SwarmSSH;

async fn test_password() -> QResult<SwarmSSH> {
    SwarmSSH::login_password("192.168.1.100:22", "root", "password").await
}

Structs

Create a download task, note that the execute command needs to be [DownloadTask::activated]
Create a download task, note that the execute command needs to be [DownloadTask::activated]
Create a download task, note that the execute command needs to be [DownloadTask::activated]
Connect to a remote computer via the ssh protocol.
Create a download task, note that the execute command needs to be [DownloadTask::activated]