-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a configured SSHClient #1748
Comments
If this is OpenSSH specific, the functionality should reference it by name in the identifiers. Don't be fooled by prevalence of OpenSSH - while a good idea to use it as a reference, tying a project to it is IMO a bad idea. |
Well, Regardless, naming is a minor implementation detail. I just want to know if it's likely to be accepted if I spend the time to flesh it out and create a PR? |
@Dreamsorcerer you're right, I guess the naming is not that big of a deal. That question has to be answered by @bitprophet though. |
To give an idea of the implementation, this is my proof-of-concept I'm using in my project, which supports hostname, user and proxycommand from the config:
|
That level of thing tends to live in Fabric (fabfile.org) - it has a handy Connection class that will load up ssh config files by default: https://docs.fabfile.org/en/2.5/concepts/configuration.html#ssh-config - I'm open to improvements there, but in Paramiko's own Client (which is older and predates Fabric 2) I only really intend to put in outright bugfixes. |
I initially skipped Fabric, as it looks like a much larger, complex library, when I'm only looking for a small layer of abstraction (i.e. paramiko already has >90% of what's needed for this). But, I'll take another look. |
@Dreamsorcerer FWIW Fabric version 2 is being designed to be much more API friendly, meaning you can get away with just using a handful of classes instead of feeling forced into its entire way of doing things (as in v1). In this case, Connection is largely a more powerful wrapper around SSHClient. |
Any chance of some help with: fabric/fabric#2135 Still struggling to get my project converted over to Fabric due to this one problem of streaming input into a Fabric Connection. It works without issue using Paramiko, but Fabric just won't stream it over the connection. |
It would be nice to have a new class, something like
ConfiguredSSHClient
which automatically configures everything from an ssh config file.The documentation says that users of the library can use the config themselves, but it seems unnecessary to require everyone to reimplement this code. It would be ideal of Paramiko just worked closer to the Openssh client out of the box.
I've started an implementation of the suggested class, so would you consider including this if I produce a PR for it?
Suggested interface would be to initialise a new client with:
client = ConfiguredSSHClient(user_config, system_config)
It would then work the same as the
SSHClient
, except any arguments missing from theconnect()
call would be filled in by the config if they have a matching hostname.The text was updated successfully, but these errors were encountered: