Package x2go :: Module sftpserver :: Class X2goRevFwTunnelToSFTP
[frames] | no frames]

Class X2goRevFwTunnelToSFTP

source code

        object --+            
                 |            
threading._Verbose --+        
                     |        
      threading.Thread --+    
                         |    
  rforward.X2goRevFwTunnel --+
                             |
                            X2goRevFwTunnelToSFTP

A reverse fowarding tunnel with an sFTP server at its endpoint. This blend of a Paramiko/SSH reverse forwarding tunnel is used to provide access to local X2go client folders from within the the remote X2go server session.

Instance Methods
 
__init__(self, server_port, ssh_transport, auth_key=None, session_instance=None, logger=None, loglevel=56)
Start a Paramiko/SSH reverse forwarding tunnel, that has an sFTP server listening at the endpoint of the tunnel.
source code
 
run(self)
This method gets run once an X2goRevFwTunnelToSFTP has been started with its start() method.
source code

Inherited from rforward.X2goRevFwTunnel: __del__, cancel_port_forward, notify, pause, resume, stop_thread

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from threading.Thread: daemon, ident, name

Inherited from object: __class__

Method Details

__init__(self, server_port, ssh_transport, auth_key=None, session_instance=None, logger=None, loglevel=56)
(Constructor)

source code 

Start a Paramiko/SSH reverse forwarding tunnel, that has an sFTP server listening at the endpoint of the tunnel.

Parameters:
  • server_port (int) - the TCP/IP port on the X2go server (starting point of the tunnel), normally some number above 30000
  • ssh_transport (paramiko.Transport instance) - the X2goSession's Paramiko/SSH transport instance
  • auth_key (paramiko.RSAKey instance) - Paramiko/SSH RSAkey object that has to be authenticated against by the remote sFTP client
  • logger (X2goLogger instance) - you can pass an X2goLogger object to the X2goRevFwTunnelToSFTP constructor
  • loglevel (int) - if no X2goLogger object has been supplied a new one will be constructed with the given loglevel
Overrides: object.__init__

run(self)

source code 

This method gets run once an X2goRevFwTunnelToSFTP has been started with its start() method. Use X2goRevFwTunnelToSFTP.stop_thread() to stop the reverse forwarding tunnel again (refer also to its pause() and resume() method).

X2goRevFwTunnelToSFTP.run() waits for notifications of an appropriate incoming Paramiko/SSH channel (issued by X2goRevFwTunnelToSFTP.notify()). Appropriate in this context means, that its starting point on the X2go server matches the class's property server_port.

Once a new incoming channel gets announced by the notify() method, a new X2goRevFwSFTPChannelThread instance will be initialized. As a data stream handler, the function x2go_rev_forward_sftpchannel_handler() will be used.

The channel will last till the connection gets dropped on the X2go server side or until the tunnel gets paused by an X2goRevFwTunnelToSFTP.pause() call or stopped via the X2goRevFwTunnelToSFTP.stop_thread() method.

Overrides: threading.Thread.run