I do not manage to use the Paramiko python module passing through its ssh X11 management functionality.
I would like to use it as if I used the ssh -X option.
I have tried several solution but nothing work on my system.
Here is the code I tried:
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()
I also tried (instead of the exec_command) :
chan.get_pty("vt100", 80, 50)
chan.invoke_shell()
chan.send(xxxxx) # the command that should display a X11 window
Unfortunately, my application freezes at the moment that the X11 window should normally appear. Remark : If I launch a command without a X11 window displaying, it works perfectly.
Thank you for your help,
Regards