17 questions
0
votes
1
answer
82
views
AsyncSSH Basic SFTP Server permission error - connection fails
I'm trying to implement a very basic sftp server in python with asyncssh to be used during a unittest. I want to use a custom path to set the root of the sftp server and it would be better to set a ...
1
vote
0
answers
166
views
How to kill a command started via asyncssh as root?
I'm struggling with asyncssh again trying to kill a process started as root:
import asyncio
import asyncssh
async def main() -> None:
async with asyncssh.connect("localhost", ...
1
vote
0
answers
158
views
asyncio requests (aiohttp, aioftp, etc) in a class-based design
I am trying to move my codebase over to asyncio and aiohttp, aioftp, etc. I've been led to believe that the clients should be reused for multiple requests instead of opening a new one each time. For ...
0
votes
1
answer
124
views
how to display parallel output results within Jupyter Notebook, using AsyncSSH + IPyWidget?
ChatGPT is running in circles now and it keeps failing at the task: having multiple boxes monitoring in real time the output of a remote python script.
So far, here is the notebook code:
import ...
0
votes
1
answer
2k
views
Python asyncssh equivalent of paramiko Channel to display SSH prompt
I'm trying to establish an interactive SSH shell using asyncssh. So far I have the following code:
import asyncio, asyncssh, sys
async def run_client():
async with asyncssh.connect(
HOST, ...
1
vote
1
answer
94
views
Why does step-wise async iteration in separate tasks behave differently than without tasks?
I just isolated a strange behavior I've observed, but now I'm out of ideas.
My script asynchronously iterates over the stdout stream of a process which has been spawned via ssh (asyncssh) in a kind of ...
1
vote
0
answers
317
views
How to reliably terminate a process started via asyncssh?
I have the following snippet starting a long-going process locally via ssh:
from asyncio import gather, run
import asyncssh
async def listen(stream):
async for line in stream:
print(line)
...
0
votes
0
answers
869
views
OSError: [Errno 24] Too many open files - Async Programing in Python
I am all new to asynchronous programing in Python. I am enhancing part of my code to work asynchronously where the rest of the code works synchronously. The part I am enhancing asynchronously is to ...
1
vote
0
answers
437
views
Transfer files directly from one SFTP server to another?
I have files within directories that needs to be transferred from one SFTP server to another. Common ways I have found are to download the files from server 1 and then transfer them to server 2. My ...
1
vote
0
answers
207
views
Downloading large datafrom SFTP server to Google Cloud Storage using AsyncSSH fails
I'm using Python's AsyncSSH library to download files from an SFTP server and upload them to Google Cloud Storage using Cloud Functions. The code works fine when the number of files and directories is ...
0
votes
1
answer
669
views
How to do interactive "su -c command -" with AsyncSSH
I have successfully executed su -c whoami - using paramiko like such:
def amiroot(ssh: paramiko.client.SSHClient, root_pass: str) -> bool:
session = ssh.get_transport().open_session()
...
0
votes
1
answer
436
views
Sending ASCII Control codes with asyncssh
I am writing a small test script that exercises asyncssh facilities. One of the test scenarios is running ping localhost process and then sending CTRL+\ to report intermediary summary. However I have ...
0
votes
0
answers
727
views
How to send Ctrl + / to the stdin in Linux via byte string in Python?
I know I can send b'\x03' to send CTRL + C to Linux but I don't know the code for CTRL + \. What resource covers CTRL + <key>?
By way of background, I am writing a small test script that ...
3
votes
1
answer
688
views
asyncio loops: how to implement asynio in an existing python program - and share variables/data?
My application needs remote control over SSH.
I wish to use this example: https://asyncssh.readthedocs.io/en/latest/#simple-server-with-input
The original app is rather big, using GPIO and 600lines of ...
1
vote
0
answers
2k
views
How to run a process in asyncssh and watch its output forever?
I created a simple asyncssh app that starts a process that runs continuously. I would like to get all stdout from the app as it runs but for some reason it ends part ways. I'm not sure if this means ...
8
votes
4
answers
10k
views
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, sys
async ...
1
vote
1
answer
1k
views
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 make ...