Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Tutorial

Makiko is an asynchronous SSH client library for Rust. It gives you a lot of control over the SSH connection, but this means that it is quite low-level.

In this tutorial, we will connect to a server, authenticate with a password or a public key, execute a command and open a tunnel. I will assume that you know Rust, have some experience with Tokio and have used SSH previously.

The code

If you want to follow along with the tutorial, create a new Rust project using Cargo:

$ cargo new hello_makiko
$ cd hello_makiko

And add the dependencies to Makiko and Tokio into your Cargo.toml:

[dependencies]
makiko = "0.2"
tokio = {version = "1.25", features = ["full"]}

You can also find complete code for each chapter in this tutorial in the examples/ directory in the Makiko repository.

In the next chapter, we will start writing the code in src/main.rs.

Next: Connecting to the server


Table of contents