镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Open

Description

@nfetisov

(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.

Activity

  1. ferki commented on Oct 23, 2021

    @ferki
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA suggested idea for the project

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions