aboutsummaryrefslogtreecommitdiffstats
path: root/arthur/apis/netcup/ssh.py
blob: 6245f8fef926c10d932fb6549da39ac7da949edf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import asyncssh

from arthur.config import CONFIG


async def rce_as_a_service(command: str) -> asyncssh.SSHCompletedProcess:
    """Run the given command on the configured server."""
    async with asyncssh.connect(
        username=CONFIG.ssh_username,
        host=CONFIG.ssh_host,
    ) as conn:
        result = await conn.run(command)
    return result