TypeError: A Future or coroutine is required

I try make auto-reconnecting ssh client on asyncssh. (SshConnectManager must stay in background and make ssh sessions when need) class SshConnectManager(object): def __init__(self, host, username,...

Print ssh lines as soon as they arrive with python - asyncssh

When using asyncssh, i would like to print the outputs line as soon as they arrive. In the example, it wait for the command to completer import asyncio, asyncssh, sys @asyncio.coroutine def...

Installation of asyncio and asyncssh on python 2.7

I want to run multiple ssh connections using python2.7,asyncioand asyncssh. Trying to find out how to install these packages, I came to know that my python version should be python3 or above and...

“async with” in Python 3.4

The Getting Started docs for asyncssh give the following hello example: import asyncio, asyncssh, sys async def run_client(): async with asyncssh.connect('localhost') as conn: result...

Handle Success/Error Responses from ssh2 using Promises

I'm building a node.js app which in production will act as a SSH client to many servers, some of which may be inaccessible at any given time. I'm trying to write a function which attempts to run a...

asyncssh - how to create listener while still getting user inputs

I am working with network equipment, i writing a program that uses asyncssh to do ssh to network device. The network device sends sometimes updates via the session using broadcast. What i am...

Using a coroutine for Python's Cmd class input stream

The problem I am facing is that: I have an asynchronous method Calling plain-old python code I cannot change Which calls back a plain-old python method Which needs to call async code using...

python; asyncio async for statement

Here is a block of code from: https://github.com/ronf/asyncssh/blob/master/examples/math_server.py#L38 async def handle_client(process): process.stdout.write('Enter numbers one per line, or...

AsyncSSH Create SFTP Client Error- too many values to unpack

I am using the asyncssh library in a Sanic application (running the Asyncio Event loop) to create an SFTP client connection. In my code I am doing this: class MyClass: async def connect(self,...

AsyncSSH saving output to list in Python

I'm trying to use AsyncSSH module to execute a command and capture the output for further processing. I was following the examples on the official documentation but they all print() the result, I...

Run commands on remote server with asyncssh

I'm trying to check how much space i have on my remote server, so i'm using df command. But i have no idea why i can't run it with asyncssh Only one command witch i can run is ls. That is what...

[asyncssh]: Reverse ssh tunnels with python asyncssh

I am looking to use asyncssh with python3.7 (asyncio) Here is what I want to build: A remote device would be running a client that does a call-home to a centralized server. I want the server to be...

Asyncssh fails to create channel with multiple processes

I am trying to use asyncssh and asyncio.gather to execute multiple concurrent ssh commands. For example: import asyncio, asyncssh, sys async def run(ssh, cmd): return (await ssh.run(cmd,...

Python: concurrently pending on async coroutine and synchronous function

I'd like to establish an SSH SOCKs tunnel (using asyncssh) during the execution of a synchronous function. When the function is done I want to tear down the tunnel and exit. Apparently some async...

AsyncSSH SFTP example seems to be downloading files in sequentially instead of asynchronously

I copied the example code from the https://asyncssh.readthedocs.io/en/latest/#sftp-client website and changed it slightly to work for my requirement. I was able to connect to the SFTP site and...

Use AsyncSSH to collect files from multiple computers

I have a program, which collects various log-files from multiple computers into a single ZIP-file on the client machine. It is currently using Fabric and I'd like to rewrite it with AsyncSSH to...

How to enter password on asyncssh.run("sudo su") and continue to input commands?

In the python 3 script I need to enter a few commands under root priveleges via asyncssh. Something like this code sample: async with asyncssh.connect(host=IP, port=PORT, username=ORDINARY_USER,...

Can not connect via AsyncSSH, error Host key is not trusted

When I run this script I receive SSH connection failed: Host key is not trusted error, but even connect to this host to take the key, keep to receive this error. import asyncio, asyncssh,...