how to interact with Paramiko's interactive shell session?

五迷三道 提交于 2019-11-27 09:10:44

I imported a file, interactive.py, found on Paramiko's GitHub. After importing it, I just had to change my code to this:

try:
    import interactive
except ImportError:
    from . import interactive

...
...

channel.invoke_shell()
interactive.interactive_shell(channel)
sshClient.close()

You can try disabling echo after invoking the remote shell:

channel.invoke_shell()
channel.send("stty -echo\n")

while True:
    command = raw_input() # no need for `$ ' anymore
    ... ...
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!