[ANN] LibSSH.jl: a Julia wrapper for libssh

Heyo heyo :wave:

So I’ve been working on writing a wrapper for the libssh library recently, and I think it’s ready-ish enough for others to use (if they dare :octopus:).

Source: GitHub - JuliaWeb/LibSSH.jl: A Julia wrapper for libssh.
Docs: https://juliaweb.github.io/LibSSH.jl

TL;DR: this lets you do SSH things programmatically. Here’s a peek of the API:

import LibSSH as ssh

session = ssh.Session("foo.com")
ssh.userauth_password(session, "password")
close(session)

And a bigger example here: Examples · LibSSH

Libssh (the C library) can work in both a blocking and non-blocking mode. LibSSH.jl sets everything to use the non-blocking mode by default and it’s fully compatible with Julia’s event loop, so you can safely call all of the high-level functions without needing to worry about them blocking. The low-level functions are pure wrappers to the C functions and may block or otherwise do strange things (check the excellent libssh docs before using them).

Disclaimer: the package is still young and there may be bugs and missing functionality :upside_down_face: (well ok, there’s definitely lots of missing functionality)
Having said that, the implementation of the SSH protocol itself is entirely delegated to libssh, which is a fairly trusted library, so I’m mildly confident that there’s at least no severe security issues.

18 Likes

v0.6.0 has been released, the big change for this one is SFTP support so you can do terrible things to remote files: SFTP · LibSSH

5 Likes