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

Better error reporting when SSH failed to spawn #171

Open
Leandros opened this issue Nov 26, 2024 · 1 comment
Open

Better error reporting when SSH failed to spawn #171

Leandros opened this issue Nov 26, 2024 · 1 comment

Comments

@Leandros
Copy link

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.

@NobodyXu
Copy link
Member

We do have code to parse error from output.

Err(Error::interpret_ssh_error(&output))

However it seems that this does not catch unknown option error, we can definitely add that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants