Hello! Started to use asyncssh a couple of days ago, so excuse any mistake on my side.
async def run_reverse_client():
"""Make an outbound connection and then become an SSH server on it"""
key = await load_agent_keys()
conn = await asyncssh.connect(host, client_keys=key)
conn = await asyncssh.connect_reverse(
'localhost', port=8022, tunnel=conn, server_host_keys=key,
process_factory=handle_request, encoding=None)
await conn.wait_closed()
File "/usr/local/lib/python3.7/site-packages/asyncssh/connection.py", line 6539, in connect_reverse
conn_factory, 'Opening reverse SSH connection to')
File "/usr/local/lib/python3.7/site-packages/asyncssh/connection.py", line 223, in _connect
await conn.wait_established()
File "/usr/local/lib/python3.7/site-packages/asyncssh/connection.py", line 2107, in wait_established
await self._waiter
File "/usr/local/lib/python3.7/site-packages/asyncssh/connection.py", line 915, in data_received
while self._inpbuf and self._recv_handler():
File "/usr/local/lib/python3.7/site-packages/asyncssh/connection.py", line 1151, in _recv_packet
processed = handler.process_packet(pkttype, seq, packet)
File "/usr/local/lib/python3.7/site-packages/asyncssh/packet.py", line 215, in process_packet
self._packet_handlers[pkttype](self, pkttype, pktid, packet)
File "/usr/local/lib/python3.7/site-packages/asyncssh/kex_dh.py", line 239, in _process_init
self._perform_reply(host_key, host_key.public_data)
File "/usr/local/lib/python3.7/site-packages/asyncssh/kex_dh.py", line 214, in _perform_reply
self._send_reply(key_data, key.sign(h))
File "/usr/local/lib/python3.7/site-packages/asyncssh/kex_dh.py", line 170, in _send_reply
self._format_server_key(), String(sig))
File "/usr/local/lib/python3.7/site-packages/asyncssh/packet.py", line 60, in String
return len(value).to_bytes(4, 'big') + value
TypeError: object of type 'coroutine' has no len()
I have more code running ssh + sftp and it works great (on this same remote host).