Skip to content
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

Do not set by default SSH port when using Net::OpenSSH #1495

Open
nfetisov opened this issue Jun 22, 2021 · 1 comment
Open

Do not set by default SSH port when using Net::OpenSSH #1495

nfetisov opened this issue Jun 22, 2021 · 1 comment
Labels
feature request A suggested idea for the project

Comments

@nfetisov
Copy link

(R)?ex can't parse complex OpenSSH configuration file, i.e. with host templates, includes, etc.
Net::OpenSSH use OpenSSH library and handle complex .ssh/config right like OpenSSH itself.

So if (R)?ex can find port for SSH connection inside (simple plain) .ssh/config - let's use this port value,
and if it can't - do not force port to 22/tcp so Net::OpenSSH can try to find it by itself (or failover to the
same 22/tcp inside Net::OpenSSH).

This allows complex OpenSSH configs, and resolves related #1209 and #1229 and #1458 issues.

@nfetisov nfetisov added the feature request A suggested idea for the project label Jun 22, 2021
@ferki
Copy link
Member

ferki commented Oct 23, 2021

Thanks for your report!

This issue does not fully follow the project's expectations, so I'd like to take this chance to kindly link our Contributing guide, specifically the section about GitHub issues and pull requests.

Please follow the issue template to provide all expected information either by editing the opening post here, or by opening a new issue instead of this one.


It's a correct observation that we'd need to drop the default port value in Rex::Interface::Connection::OpenSSH while we work towards a solution for the overall goal of "don't interfere with ssh config parsing results in Rex when Net::OpenSSH is in use" story. It wouldn't solve the full story in itself, though.

The full picture of the puzzle contains a a few more pieces: add a feature flag to opt-in/out of the new behavior, restructure the code so it becomes testable, drop all default values for connection options (not just port), still ensure that Rex config is respected, etc.

I'd like to open another issue later which describes the overall situation better, and also groups the related issues together (including this one), and then address the root cause instead of just one of the symptoms (e.g. port handling).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A suggested idea for the project
Projects
None yet
Development

No branches or pull requests

2 participants