ssh X11管理機能を通過するParamiko pythonモジュールを使用できません。
ssh -X オプションを使用したかのように使用したいと思います。
いくつかの解決策を試しましたが、私のシステムでは何も機能しません。
これが私が試したコードです:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(AutoAddPolicy())
client.connect(machineName, username=xxx, password=xxx)
t = client.get_transport ()
chan = t.open_session ()
chan.request_x11 ()
chan.set_combine_stderr (True)
chan.exec_command (xxxxx) # the command that should display a X11 window
bufsize = -1
stdin = chan.makefile('wb', bufsize)
stdout = chan.makefile('rb', bufsize)
stderr = chan.makefile_stderr('rb', bufsize)
for line in stdout:
print '... ' + line.strip('\n')
client.close()
私も試しました(exec_commandの代わりに):
chan.get_pty("vt100", 80, 50)
chan.invoke_shell()
chan.send(xxxxx) # the command that should display a X11 window
残念ながら、X11 ウィンドウが正常に表示されるはずの瞬間にアプリケーションがフリーズします。備考 : X11 ウィンドウを表示せずにコマンドを起動すると、完全に機能します。
よろしくお願いします。