import asyncio, asyncssh, sys
# term_type = [ xterm , vt100] - tested both
async def run_client():
async with asyncssh.connect('localhost', username="CCCC", password='XXSD') as conn:
await conn.run(term_type='vt100', stdin=sys.stdin,
stdout=sys.stdout, stderr=sys.stderr)
try:
asyncio.get_event_loop().run_until_complete(run_client())
except (OSError, asyncssh.Error) as exc:
sys.exit('SSH connection failed: ' + str(exc))