Skip to content

avgrocks/async-ssh2-tokio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async-ssh2-tokio

Unit Test Status Lint Status

This library, async-ssh2-tokio, is a asynchronous and super-easy-to-use high level ssh client library for rust. This library is powered by thrussh.

Features

  • ssh host by password
  • execute command to remote host

Install

[dependencies]
tokio = "1"
async-ssh2-tokio = "0.2.1"

Example

use async_ssh2_tokio::client::{Client, Host, AuthMethod};
use async_ssh2_tokio::error::AsyncSsh2Error;
#[tokio::main]
async fn main() -> Result<(), AsyncSsh2Error> {
    let username = "username".to_string();
    // Key auth is under development. If you need this, then create github issue or contribute this.
    let password = AuthMethod::Password("password".to_string());

    let mut client = Client::new("localhost:22", username, password);
    client.connect().await?;
    let result = client.execute("echo test!!!").await?;
    assert_eq!(result.output, "test!!!\n");
    Ok(())
}

About

asynchronous and easy-to-use high level ssh client library for rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 97.4%
  • Shell 1.9%
  • Dockerfile 0.7%