阅读背景:

Python Paramiko - 在退出之前等待传递命令的更多输出

来源:互联网 

I have the following code

我有以下代码

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.client.AutoAddPolicy())
privatekeyfile = 'PK_FILE_PATH'
username ="USERNAME"
mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile)
client.connect(hostname= IP, username=username, pkey=mykey)
command = SERVER_COMMAND

stdin, stdout, stderr = client.exec_command(command)
while not stdout.channel.exit_status_ready():
  if stdout.channel.recv_ready():
    stdoutLines = stdout.readlines()
print stdoutLines
client = 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: