Repository navigation
fix: pass custom -c config to ssh via -F - #159
vulragrag-star wants to merge 1 commit into
Conversation
|
Thanks for this, #106 is a real pain point. One use case this would break, though: using I split my hosts by context and use sshs -c ~/.ssh/config.d/work.confToday this works: The host still connects, but with the wrong keys offered, silently, which is the kind of thing Since sshs already follows |
When -c/--config points at a non-default file and the default command template is used, inject ssh -F so Host aliases (and HostName/User/Port) from that file still resolve. Fixes connecting via aliases that only exist in the custom config (issue quantumsheep#106).
ca40e8f to
7fe90cd
Compare
|
Good catch, thanks. |
Summary
When
sshsis started with a custom-c/--configfile, Host aliases from that file were listed in the UI but the default connect command was stillssh "{{{name}}}". OpenSSH then looked only at the usual system/user configs, so aliases that only exist in the custom file failed to resolve (Could not resolve hostname/hostname contains invalid charactersfor quoted names).If the user left the default command template alone, build
ssh -F <config> "{{{name}}}"instead so the same file used to populate the list is also passed tossh. An explicit-t/--templateis left unchanged. OpenSSH accepts a single-F; when several custom paths are given, the last non-system path is used.Fixes #106.
Test plan
cargo test --bin sshs tests::-cinjects-F-tis left alone