how to interact with Paramiko's interactive shell session?

前端 未结 2 1503
长情又很酷
长情又很酷 2020-12-06 04:08

I have some Paramiko code where I use the invoke_shell method to request an interactive ssh shell session on a remote server. Method is outlined here: invoke_shell()

2条回答
  •  天涯浪人
    2020-12-06 04:28

    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
        ... ...
    

提交回复
热议问题