tunel.ssh package

Submodules

tunel.ssh.commands module

tunel.ssh.ssh module

class tunel.ssh.ssh.Tunnel(server, **kwargs)[source]

Bases: object

An ssh tunnel provides a route for the user to interact with an application This basically enables local port forwarding (called an ss tunnel) using the library Paramiko.

execute(cmd, login_shell=False, quiet=False, stream=False, xserver=False)[source]

Execute a command via ssh and a known, named connection.

execute_or_fail(cmd, success_code=0, quiet=False)[source]

Execute a command, show the command preview, only continue on success.

print_output(output, success_code=0, quiet=False)[source]

Given an output dict, print and color appropriately.

scp_from(src, dest)[source]

Copy a file from the server to local

scp_to(src, dest)[source]

Copy a file onto the server

shell(cmd=None, interactive=False)[source]

Pass the process over to shell

tunnel(machine=None, port=None, remote_port=None, socket=None, app=None)[source]

Given a remote and local port, open a tunnel. If an isolated node ssh is done, the name of the machine is required too.

tunnel_login_node(port=None, remote_port=None, socket=None, app=None)[source]

Create a tunnel directly to the login node (e.g., a Singularity app)

Module contents