Basic ssh tunnel utilities, and convenience functions for tunneling zeromq connections.
Open a tunneled connection from a 0MQ url.
For use inside tunnel_connection.
Returns: | (url, tunnel) – The 0MQ url that has been forwarded, and the tunnel object |
---|---|
Return type: | (str, object) |
Create an ssh tunnel using command-line ssh that connects port lport on this machine to localhost:rport on server. The tunnel will automatically close when not in use, remaining open for a minimum of timeout seconds for an initial connection.
This creates a tunnel redirecting localhost:lport to remoteip:rport, as seen from server.
keyfile and password may be specified, but ssh config is checked for defaults.
Parameters: |
|
---|
launch a tunner with paramiko in a subprocess. This should only be used when shell ssh is unavailable (e.g. Windows).
This creates a tunnel redirecting localhost:lport to remoteip:rport, as seen from server.
If you are familiar with ssh tunnels, this creates the tunnel:
ssh server -L localhost:lport:remoteip:rport
keyfile and password may be specified, but ssh config is checked for defaults.
Parameters: |
|
---|
Selects and return n random ports that are available.
Attempt to make an ssh connection without a password. This is mainly used for requiring password input only once when many tunnels may be connected to the same server.
If paramiko is None, the default for the platform is chosen.
Connect a socket to an address via an ssh tunnel.
This is a wrapper for socket.connect(addr), when addr is not accessible from the local machine. It simply creates an ssh tunnel using the remaining args, and calls socket.connect(‘tcp://localhost:lport‘) where lport is the randomly selected local port of the tunnel.