diff options
Diffstat (limited to 'arthur/apis/netcup/ssh.py')
-rw-r--r-- | arthur/apis/netcup/ssh.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arthur/apis/netcup/ssh.py b/arthur/apis/netcup/ssh.py new file mode 100644 index 0000000..6245f8f --- /dev/null +++ b/arthur/apis/netcup/ssh.py @@ -0,0 +1,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 |