-
Notifications
You must be signed in to change notification settings - Fork 157
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
Using ssh client config #108
Comments
No, sorry, there's no way to support an OpenSSH-format "config" file right now. The problem is that there are a really large number of configuration settings supported by OpenSSH which there are no direct equivalents of in AsyncSSH, and so even if I had code which could parse that file, I wouldn't be able to apply many of the settings. Applying some settings and ignoring others seems like it could cause problems in many cases, so I don't plan on supporting that. AsyncSSH requires you to provide all these settings in the form of arguments to it directly in Python. There is support for other file formats such as authorized_keys and known_hosts, as well as the key files themselves, but in all of those cases AsyncSSH is able to fully understand the contents of these files. |
Thx for explanation. It isn't a problem to write config parsing myself actually.. for line in file.readlines():
if line.startswith('HostName'):
host = line.split()[1]
elif line.startswith('User'):
user = line.split()[1] |
If you have a very simple config file without any "Host" or "Match" lines, parsing like the above might work, but to properly parse all of the options in an SSH config file is a lot more involved than what you show here. Take a look at the ssh_config(5) man page for more details. Even if I were to add support for Host and Match sections, though, there are nearly 100 directives which are supported by OpenSSH, and while many of the things they control are also features available in AsyncSSH, there would not be a one-to-one mapping of all of these configuration settings. More importantly, there are a number of OpenSSH directives which really have no direct counterpart in AsyncSSH at all such as BatchMode, the various Canonicalize options on hostnames, CompressionLevel, and the various Control options for setting up a "master" SSH process to multiplex through, to name just a few. |
No no, i meant that i can do it myself =) i didn't write it like "look it is easy, make it pls" |
Ah, gotcha - sounds good! |
Is there a way to use ~/.ssh/config where are a lot of settings in
asyncssh.connect('just_name_of_settings')
?I don't see such possibility in source. So do you have a plan to implement such feature?
The text was updated successfully, but these errors were encountered: