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

Cannot connect through SSH: [Session(-43)] Failed getting banner #240

Closed
itaranto opened this issue Feb 1, 2024 · 6 comments
Closed

Cannot connect through SSH: [Session(-43)] Failed getting banner #240

itaranto opened this issue Feb 1, 2024 · 6 comments

Comments

@itaranto
Copy link

itaranto commented Feb 1, 2024

Cannot connect through SSH neither via distant connect or distant launch.

The error I get is:

Failed to connect to server

Caused by:
    Fatal: ssh handshake with localhost:22: [Session(-43)] Failed getting banner

I see the follwing in the manager logs (journalctl --user -u distant-manager.service):

Started distant-manager.service - distant-manager.
Usage: sss_ssh_knownhostsproxy [-?k] [-?|--help] [--usage] [-p|--port=INT]
        [-d|--domain=STRING] [-k|--pubkey] HOST [PROXY_COMMAND]

It seems the parameters passed to sss_ssh_knownhostsproxy aren't quite right.

Unfortunately, running the manger with distant manager service start --user --log-level trace doesn't seem to show how sss_ssh_knownhostsproxy is being invoked.

Environment:
distant version: 0.20.0
OpenSSH version: 9.0p1
SSSD version: 2.9.4
OS: Fedora 38

@itaranto itaranto changed the title [Session(-43)] Failed getting banner Cannot connect through SSH: [Session(-43)] Failed getting banner Feb 1, 2024
@chipsenkbeil
Copy link
Owner

This seems to happen with some ssh servers and our use of some C ssh libraries. Until #193 is implemented, you can try switching the ssh client library used as described in the options for ssh.

Specifically, change the ssh.backend to libssh. I have to do this when using distant at work:

distant connect ssh://example.com --options 'backend=libssh'

The default backend is ssh2 as a client library. Both have issues, which hopefully will be resolved by switching to a native Rust implementation in the future.

@itaranto
Copy link
Author

itaranto commented Feb 2, 2024

This seems to happen with some ssh servers and our use of some C ssh libraries. Until #193 is implemented, you can try switching the ssh client library used as described in the options for ssh.

Specifically, change the ssh.backend to libssh. I have to do this when using distant at work:

distant connect ssh://example.com --options 'backend=libssh'

The default backend is ssh2 as a client library. Both have issues, which hopefully will be resolved by switching to a native Rust implementation in the future.

Good to know then.

Regarding switching to backend=libssh, that made the error go away but it still doesn't work. All I get is a number being printed to stdout, for example:

$ distant connect ssh://foo@bar --options 'backend=libssh,verbose=true'
Password:
1941100921

Also, after checking, I realized I didn't have libssh2 installed in the first place. But after installing it the "banner" error remains the same. I guess that's because distant statically links libssh2.

@chipsenkbeil
Copy link
Owner

The number is the ID of the connection after succeeding. Did you try distant fs read . or distant shell?

@itaranto
Copy link
Author

itaranto commented Feb 2, 2024

The number is the ID of the connection after succeeding. Did you try distant fs read . or distant shell?

Right 🤦‍♂️ I should have read the docs 😄

distant shell worked like a charm.

@chipsenkbeil
Copy link
Owner

Glad it worked for you!

Copy link

github-actions bot commented Mar 4, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants