ba0f3 / ssh2.nim

Async SSH, SCP and SFTP client for Nim, using libssh2 wrapper [WIP]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ssh2.nim

High level async SSH, SCP and SFTP client for Nim, using libssh2 wrapper

Usage

import asyncdispatch, ssh2, ssh2/scp

proc main() {.async.} =
  var client = newSSHClient()
  defer: client.disconnect()
  await client.connect("127.0.0.1", "root", Port(2222), password="root")
  echo await client.execCommand("uptime")

waitFor main()

Development

In order to run tests, you can use a Docker instance with sshd installed.

For example:

# Host: 127.0.0.1
# Port: 2222
# Username: root
# Password: root

docker run -d --name test_sshd -p 2222:22 rastasheep/ubuntu-sshd:16.04

About

Async SSH, SCP and SFTP client for Nim, using libssh2 wrapper [WIP]

License:MIT License


Languages

Language:Nim 100.0%