There’s no sign in the log here of you passing in the command “systeminfo”. In fact, it appears to be trying to start an interactive shell:
980 2020-05-27 09:35:05.189 debug1: server_input_channel_req: channel 0 request shell reply 1
980 2020-05-27 09:35:05.189 debug1: session_by_channel: session 0 channel 0
980 2020-05-27 09:35:05.189 debug1: session_input_channel_req: session 0 req shell
980 2020-05-27 09:35:05.189 Starting session: shell for administrator from 10.55.136.25 port 35686 id 0
980 2020-05-27 09:35:05.189 debug2: fd 9 setting O_NONBLOCK
980 2020-05-27 09:35:05.189 debug2: fd 10 setting O_NONBLOCK
980 2020-05-27 09:35:05.189 debug2: fd 11 setting O_NONBLOCK
980 2020-05-27 09:35:05.189 debug2: fd 12 setting O_NONBLOCK
980 2020-05-27 09:35:05.189 debug2: fd 13 setting O_NONBLOCK
980 2020-05-27 09:35:05.189 debug2: fd 14 setting O_NONBLOCK
980 2020-05-27 09:35:05.189 debug3: shell: "c:\\windows\\system32\\cmd.exe"
980 2020-05-27 09:35:05.189 debug3: shell_option: /c
980 2020-05-27 09:35:05.189 debug3: exec_command: (null)
If you are calling "stdin, stdout, stderr = await conn.open_session()", it would make sense that it would be requesting a shell and not trying to execute a command, as the open_session() call takes the command to run as an optional argument. By not specifying a command there, it defaults to requesting a shell. Can you share a more complete version of the code calling AsyncSSH?
Immediately after this, the log shows:
980 2020-05-27 09:35:05.189 debug3: send packet: type 100
This is MSG_CHANNEL_FAILURE, which explains why AsyncSSH is reporting that it got an error opening the session. After that, the log shows the usual cleanup as the connection is being shut down.
One other thing I notice is that you appear to be attempting to start a shell as “administrator”. Could there be a permissions issue where Windows is not allowing SSH to do that? When you tested opening a session with a regular SSH client, were you attempting to log in as “administrator”?
The other thing I notice is that it is running cmd.exe with he “/c” option, which says to carry out the command and then stop.However, there is no command here, so perhaps that’s the reason for the failure.
If you change your call to "stdin, stdout, stderr = await conn.open_session(’systeminfo’)", does that change anything?
I’d also suggest comparing the server logs between the AsyncSSH case and the working case to see what differences are present.