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