jacobsvante / bgtunnel Goto Github PK
View Code? Open in Web Editor NEWInitiate SSH tunnels in the background in python
License: MIT License
Initiate SSH tunnels in the background in python
License: MIT License
Any change bgtunnel will support password logins and not just ssh key files?
Today bgtunnel's connection validation method expects the server to write to stdout on a successful connection. Not every server does this so @hamiltont introduced #6 which allows passing in expect_hello=False
to bgtunnel.open
and thus bypassing the validation method. This workaround was added to 0.3.6
.
Perhaps something is written to stdout but the buffer is not flushed. Look this up.
I may be incorrect here, but I don't believe bgtunnel works with python2.6 (EDIT: Requirements make this clear that 2.6 is not supported).
Is it possible to either
I'm testing this python module.
Sometimes I have an exceptio "bgtunnel.SSHTunnelError: stdin is not a tty", and sometimes the same script starts successfully. When I have the exception, if i try a another to start it, the script is running ...
I link the script with whom I'm doing my test :
import docker
import bgtunnel
def list_images(host, port):
forwarder = bgtunnel.open(ssh_user="root", ssh_address=host, host_port=str(port))
client = docker.Client(base_url="http://localhost:{0}".format(forwarder.bind_port)
return client.images()
if __name__ == '__main__':
print list_images("192.168.10.135", 5555)
If you can explain me, how to ensure that the exception doesn't appear ?
Hi!
I read docs but i can't find function to close exists connection. Each connection auto close or I must close? How do I close its?
Thanks
I'm trying to relocate the ssh keys to another folder instead of the default on Linux. Currently I can use the identity_file kwarg to specify which private key file to use, but this only works if the known_hosts file is still in its original folder.
I've tried making a config file with both the identity file and known hosts file paths specified, but this does not work as the identity_file:
IdentityFile *path1*
UserKnownHostsFile *path2*
Is there a way to specify the known_hosts location, or a config file?
Edit:
Per the ssh manual page specifying the config is an existing option:
-F configfile
Specifies an alternative per-user configuration file. If a
configuration file is given on the command line, the
system-wide configuration file (/etc/ssh/ssh_config) will
be ignored. The default for the per-user configuration
file is ~/.ssh/config. If set to βnoneβ, no configuration
files will be read.
It looks like this could be added very similarly to how identity_file is.
An additional/alternative option is to add -o
, which allows (among other things) UserKnownHostsFile
to be specified:
-o option
Can be used to give options in the format used in the
configuration file. This is useful for specifying options
for which there is no separate command-line flag. For full
details of the options listed below, and their possible
values, see ssh_config(5).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.