xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #1486: proxy_sessions.py

File proxy_sessions.py, 790 bytes (added by Denis01, 4 years ago)
Line 
1# This file is part of Xpra.
2# Copyright (C) 2017 Antoine Martin <antoine@devloop.org.uk>
3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
4# later version. See the file COPYING for details.
5import paramiko
6
7
8def sessions_create():
9        print("SESSION CALL")
10        comm_string="xpra start --bind-tcp=0.0.0.0:10000 --start-child=/bin/gedit --exit-with-children --auth=none"
11        ip_serv_1="127.0.0.1"
12        host_secret="111"
13        user_id="111"
14       
15        client = paramiko.SSHClient()
16        client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
17        client.connect(hostname=ip_serv_1, username=user_id, password=host_secret, port=22)
18        stdin, stdout, stderr = client.exec_command(comm_string)
19        data = stdout.read() + stderr.read()
20        print (data)
21       
22        client.close()
23 
24#sessions_create()