yarest

HomePage: http://code.google.com/p/yarest/

Author: Mike Fled

Download: https://pypi.python.org/packages/source/y/yarest/yarest-0.5.0.zip

        ======
YAREST
======

YAREST is a cross-platform support tool for tunneling various desktop sharing
programs via SSH. Most any desktop sharing program that can be invoked from a
shell, or is already running, and uses a TCP port for communication should in
theory work, though currently only VNC and RDP have been tested and verified.

YAREST was designed, and written, to help those who help others.

This software is geared primarily towards technical providers that are looking
for a customizable cross-platform solution. To use the system an SSH server is
required; if you can comfortably setup and manage one or more servers that are
used purely for authentication and TCP forwarding by both your technicians and
end-users, then this software may be of service to you.


Features
========

- Extremely simple GUI for both your end-users and technicians

- Core yarest package exports all of the functionality independent of the GUI

- Usable with most any VNC variant, RDP, and likely other port based desktop sharing programs

- Requires only outbound connectivity for both technician and end-user when the SSH server is on a 3rd machine

- Supports multiple "connection profiles" to enable use of multiple SSH servers

- Supports executing your own custom code during sessions via the "SupportExtender" interface

- Includes an NSIS installer for Windows that can download and install the necessary Python dependencies


How It Works
============

The basic premise is simply this:

1. First entity starts the overall process by establishing a reverse SSH tunnel
   from a random server port number to their pre-configured local port number.

2. First entity delivers random port number, aka "access code", to the second
   entity. This could occur over the phone, e-mail, your own custom software,
   really fast courier pigeons, morse code, telepathy...anything you choose.

3. Second entity establishes a forward SSH tunnel from their pre-configured local
   port number to the "access code" server port, which links up the two tunnels.

4. Either or both entities disconnect the session when finished.


Code Example
============

The following two "connection profiles" and code snippets are intended to
represent the basic code needed for the scenario described directly above,
whereby the second entity is providing support to the first entity via RDP.

>>> [First Entity]
>>> ssh_server = my.support.server
>>> ssh_port = 22
>>> ssh_allow_unknown = True
>>> ssh_hostkeys = 
>>> ssh_compression = True
>>> support_port = 3389
>>> support_tunnel = reverse

>>> [Second Entity]
>>> ssh_server = my.support.server
>>> ssh_port = 22
>>> ssh_allow_unknown = True
>>> ssh_hostkeys = 
>>> ssh_compression = True
>>> support_port = 9999
>>> support_tunnel = forward
>>> support_exec = %SYSTEMROOT%\system32\mstsc.exe
>>> support_args = /v:localhost:%d /f

In the below code snippet assume:

- `your_config_file` contains exactly one connection profile, the "First Entity" one above
- `your_password` comes from the end-user in some manner
- `send_access_code_to_your_provider` delivers the "access code" to the other entity
- `user_clicked_disconnect` is some flag you set from elsewhere to end the session

>>> from yarest import ConnectionProfile, SupportEntity
>>>
>>> profiles = ConnectionProfile.read_from_file(your_config_file)
>>>
>>> firstentity = SupportEntity(profiles[0])
>>> firstentity.connect(your_password)
>>>
>>> access_code = firstentity.start_session()
>>> send_access_code_to_your_provider(access_code)
>>>
>>> user_clicked_disconnect = False
>>> while not user_clicked_disconnect:
>>>     continue
>>>
>>> firstentity.stop_session()

In the below code snippet assume:

- `your_config_file` contains exactly one connection profile, the "Second Entity" one above
- `your_password` comes from the end-user in some manner
- `access_code` was received from the first entity
- `user_clicked_disconnect` is some flag you set from elsewhere to end the session

>>> from yarest import ConnectionProfile, SupportEntity
>>>
>>> profiles = ConnectionProfile.read_from_file(your_conf