如何将Paramiko stdin连接到控制台?

时间:2019-05-30 01:32:34

标签: python ssh pipe stdin paramiko

使用Paramiko软件包通过SSH运行命令。需要运行一个需要用户输入的应用程序,我如何才能将sys.stdin直接连接到通过Paramiko运行的应用程序,因此无论用户键入什么内容,它都将进入正在运行的应用程序。


stdin, stdout, stderr = ssh_client.exec_command('/tmp/input_required')

while not stdout.channel.exit_status_ready():
    print(stdout.read(1), end ='')

0 个答案:

没有答案