Skip to content

Paramiko ssh connection giving lots of residue output #2242

@basu45

Description

@basu45

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

import paramiko client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(host=host, username=username, password=password) channel = client.invoke_shell() While channel.send_ready(): channel.send('who am i\n') While channel.rec_ready(): Output=channel.recv(1024).decode() Print(Output) 

The issue is when we are using paramiko to connect to windows 2019 vm with invoke_shell() we are getting a lot of residue/garbage output.
The output is similar to
(https://stackoverflow.com/questions/61381631/read-buffer-data-continuously-running-on-remote-windows-command-prompt?noredirect=1&IQ=1)

And also the output is repeated multiple times.

Checked with bitvise ssh server it works fine with bitvise server

Tried with different version of openssh but same issue.

Any suggestions to get the clean output and non repeated/duplicate output

Expected behavior

Clean output

Actual behavior

"b'\x1b[2J\x1b[2J\x1b[1;1H\x1b[0;39;24;27;37;40mMicrosoft Windows [Version 10.0.1482] \n\x1b[2;1H(c) 2016 Microsoft Corporation. All rights reserved. \n\n\x1b[4;1Hadministrator@win C:\Users\Administrator>whoami \x1b[2J\x1b[4;54Hwhoami \x1b[4;55Hhoami \x1b[4;56Hoami \x1b[4;57Hami \x1b[4;58Hmi \x1b[4;59Hi \x1b[4;60H \x1b[5;1H' "

Error details

No response

Environment data

PSversion. 5.1.17763.5933 PsEdition. Desktop PSCompatibleVersions. {1.0,2.0,30.,4.0.....} BuildVersion. 10.0.17763.5993 CLRVersion. 4.0.30319.42000 WSManStackVersion. 3.0 PSRemotingProtocolVersion. 2.3 Serialisation version. 1.1.0.1

Version

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions