Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Better error reporting when SSH failed to spawn #171

@Leandros

Description

@Leandros

I'm trying to connect to an EC2 from an Amazon Linux 2 VM. However, AL2 ships with an ancient OpenSSH version from 2017:

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017

This version doesn't yet support StrictHostKeyChecking=accept-new and quits with:

command-line line 0: unsupported option "accept-new".

However, when trying to create a new session, the error returned from SessionBuilder::launch_master is:

Err(
    Connect(
        Os {
            code: 2,
            kind: NotFound,
            message: "No such file or directory",
        },
    ),
)

Unfortunately, this gives zero indication of what went wrong. I had to step through the code and recreate the SSH invocation to find out that accept-new isn't supported.

I'd propose that the error returned also returns the stdout/stderr from the ssh invocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions