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

Problems launching a distant sesseion [Session(-5)] Unable to exchange encryption keys #75

Closed
phalanx8 opened this issue Dec 5, 2022 · 4 comments
Labels
bug Something isn't working fixed-upstream Indicates the issue may be resolved by a later version of the plugin. inactive No discussion on issue in awhile old Issue is really old, so may no longer apply

Comments

@phalanx8
Copy link

phalanx8 commented Dec 5, 2022

Hello everyone,

as explained in the README.md :DistantLaunch {host} should launch a session. However i get this error:

ssh handshake with host:22: [Session(-5)] Unable to exchange encryption keys
callback error
stack traceback:
^I[C]: in ?
^I[C]: in function 'pcall'
^I.../packer/start/distant.nvim/lua/distant/editor/launch.lua:81: in function 'load'
^I.../packer/start/distant.nvim/lua/distant/editor/launch.lua:67: in function 'launch'
^I...e/pack/packer/start/distant.nvim/lua/distant/command.lua:177: in function 'launch'
^I[string ":lua"]:1: in main chunk
caused by: ssh handshake with host:22: [Session(-5)] Unable to exchange encryption keys
callback error
stack traceback:
^I[C]: in ?
^I[C]: in function 'pcall'
^I.../packer/start/distant.nvim/lua/distant/editor/launch.lua:81: in function 'load'
^I.../packer/start/distant.nvim/lua/distant/editor/launch.lua:67: in function 'launch'
^I...e/pack/packer/start/distant.nvim/lua/distant/command.lua:177: in function 'launch'
^I[string ":lua"]:1: in main chunk
caused by: ssh handshake with host:22: [Session(-5)] Unable to exchange encryption keys

My Setup:
OS: OSX
Network is reachable and ssh connection works when tried manually in the shell

@phalanx8 phalanx8 changed the title Problems launching a distant sesseion Problems launching a distant sesseion [Session(-5)] Unable to exchange encryption keys Dec 5, 2022
@chipsenkbeil
Copy link
Owner

I'm assuming you're using the main branch of distant.nvim? Or are you using v0.2?

The only fix to this, I think, is to be able to use an alternative ssh library. For v0.1 (main branch), we use libssh2. For v0.2, we use an updated version of distant that supports swapping the ssh library between libssh2 and libssh. It isn't documented yet, but you would be able to do something like :DistantLaunch ssh://{address} options="ssh.backend=libssh".

Related to #48.

@chipsenkbeil chipsenkbeil added bug Something isn't working fixed-upstream Indicates the issue may be resolved by a later version of the plugin. labels Dec 5, 2022
@chipsenkbeil
Copy link
Owner

Alternatively, if launching doesn't work, you can always start the distant server manually yourself and connect to it.

With the v0.1 (main) branch, you can do :DistantConnect {address} {port} and get prompted for the server's secret key. The secret key is printed out by the server when you start it.

@phalanx8
Copy link
Author

Hi Chip (again),
thanks for the help, but it didn't help me.
I was using v0.1.2 (tagged in packer). I tried your advise with following results:

  • :DistantLaunch ssh://{address} options="ssh.backend=libssh" gave me a failed to lookup address information: nodename nor servname provided, or not knwon. An error not listed in Issues yet. (didn't find smth related)

  • :DistantConnect {address} {port} gave me a Connection refused (os error 61) (weird?). I can however start nodejs server on eg. 8080 an access it through the browser.

I tried to distant launch to localhost which worked. However i couldn't enter dirs of files in DistantOpen buffer.

Then I tried the 0.2 version on localhost, connecting worked but spawning not? This happend after DistantLaunch and entering the password.

Failed (1): Failed to launch server
Caused by:
    Spawning distant failed [???]: error: Found argument 'nil' which wasn't expected, or isn't valid in this context

    USAGE:
        distant server listen [OPTIONS]

    For more information try --help

`DistantLaunch host With the remote server I got the error:

Failed (1): Failed to launch server
Caused by:
    Fatal: ssh handshake with remote:22: [Session(-5)] Unable to exchange encryption keys

However DistantConnect worked. The Navigation in DistantOpen didn't work. pattern not found actions.edit. And sometimes neovim closes when i DistantOpen.

@chipsenkbeil chipsenkbeil added inactive No discussion on issue in awhile old Issue is really old, so may no longer apply labels May 15, 2023
@chipsenkbeil
Copy link
Owner

Closing out as an outdated issue. You can try the v0.3 branch to see if it resolves any issues, otherwise this may also get resolved with chipsenkbeil/distant#193 for distant.

Nothing else that can be done in the neovim plugin itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed-upstream Indicates the issue may be resolved by a later version of the plugin. inactive No discussion on issue in awhile old Issue is really old, so may no longer apply
Projects
None yet
Development

No branches or pull requests

2 participants