Skip to content

Channel.invoke_shell() failed with latest version of Openssh #1473

Open
@sureshkotapydev

Description

@sureshkotapydev

Troubleshooting steps
https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting-Steps

Terminal issue? please go through wiki
https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH

Please answer the following

"OpenSSH for Windows" version
8.0.0.0

Server OperatingSystem
Windows Server 2016 Standard Evaluation

Client OperatingSystem
CentOS Linux release 7.6.1810 (Core)

What is failing

Python 3.6.7 (default, Dec  5 2018, 15:02:05)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
>>> cl = paramiko.SSHClient()
>>> cl.set_missing_host_key_policy(paramiko.AutoAddPolicy())
>>> cl.connect(hostname=hostname, username=username, password=password)
>>> ch = cl.get_transport().open_session()
>>> ch.invoke_shell()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myenv/lib64/python3.6/site-packages/paramiko/channel.py", line 72, in _check
    return func(self, *args, **kwds)
  File "/home/myenv/lib64/python3.6/site-packages/paramiko/channel.py", line 230, in invoke_shell
    self._wait_for_event()
  File "/home/myenv/lib64/python3.6/site-packages/paramiko/channel.py", line 1208, in _wait_for_event
    raise e
paramiko.ssh_exception.SSHException: Channel closed.

Expected output
ch.invoke_shell() should be successful. This works in v7.7.2.0p1-Beta and below versions.

Actual output
paramiko.ssh_exception.SSHException: Channel closed

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