Open FloLaco opened 1 year ago
Is this something still useful?
Is this something still useful?
Not sure, no one's ever asked for this but this user, and since the method he was pursuing was not a scalable answer, and he didn't address the comments, we haven't merged it
Related Issue
Fixes https://github.com/ronf/asyncssh/issues/520
Description
When using variables in ssh config file like
%h
or%p
,asyncssh
is doing token substitution with host address and port. But sincesuzieq
is creating anasyncssh
options before trying to connect to device,asyncssh
is not aware about host and port info.Type of change
New Behavior
The goal is to postpone ssh config file parsing at the
asyncssh.connect()
time, where host and port is known. There is another way, explained in the comments section....
Contrast to Current Behavior
Actually, when building the options, substitution look like this :
nc -X 5 -x 127.0.0.1:2226 '' 22
Instead ofnc -X 5 -x 127.0.0.1:2226 X.X.X.X 22
...Discussion: Benefits and Drawbacks
It's very usefull for supporting multiplexing ssh session with OpenSSH options without adding such feature to
suzieq
...
Proposed Release Note Entry
asyncssh
OpenSSH token substitution (%h, %p) by postponing parsing ssh config file....
Comments
There's two way to fix this issue, the other way is to provide
host
andport
information toasyncssh
when building ssh options. I tested both and it works, but I prefer the way to postpone config parsing in theasyncssh.connect()
call instead of doing parsing before and pass the result toasyncssh.connect()
.Second way like this :
Example of ssh config file :
Double Check
develop
branch.develop
branch.--signoff
applied