codelite icon indicating copy to clipboard operation
codelite copied to clipboard

[bug] : SFTP plugin not working anymore on Windows version 16.0.0 and 17.0.0

Open ChristopheH22 opened this issue 2 years ago • 26 comments

Hello,

I'm not able to use anymore the SFTP plugin on codelite 17.0.0, windows version. I always have this error when I test the connection : image

Version : 17.0.0 for windows ExtraPutty configure as client for SFTP

ChristopheH22 avatar Jan 28 '23 11:01 ChristopheH22

Hi,

The error indicates that the client's HostKeyAlgorithms don't match any of the server's, in this case ssh-rsa and ssh-dss (considered legacy algorithms/insecure).

Possible solutions:

  • update/reconfigure the server to use modern HostKeyAlgorithms
  • configure the client to use legacy HostKeyAlgorithms
  • use an older client

Regards,

llogick avatar Jan 29 '23 10:01 llogick

Thanks for the answer but to be honest I'm not sure to understand. Out of Codelite, I'm using extraPutty to connect to the server and it is working perfectly. In codelite, I configured extraPutty as the client to use for SFTP. I can only configure that, no other options. This worked like a charm until a certain version. Now in v16.0.0 and v17.0.0 I have this message when I test the connection and I'm not able to establish the connection. I'm ok to change something in my server configuration but this behavior appears to me as a regression since it was functional before.

ChristopheH22 avatar Jan 29 '23 11:01 ChristopheH22

btw, I did find this bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=1953591

Which has the exact same error you as (and CodeLite, too, is using libssh)

eranif avatar Jan 29 '23 11:01 eranif

No guarantees but you could try adding HostkeyAlgorithms +ssh-rsa to ~\.ssh\config.

llogick avatar Jan 29 '23 14:01 llogick

@nullptrdevs you mean on the server itself ?

My server is a SBC board (linux embedded) and currently the Openssh version used on it is 5.1. It is only supporting rsa + dss key algorithm. The solutions I see for the moment :

  • Try to recompile openssh for my linux board : out of my skills I think
  • Used a previous version of Codelite : it works. Version 15.0.0 is ok.
  • Try to copy paste libssh DLL of version 15.0.0 on version 17.0.0. Not done yet... do you think it will work ?

Anyway, thank you for your support.

ChristopheH22 avatar Jan 29 '23 20:01 ChristopheH22

Client side (edit or create the file %USERPROFILE%\.ssh\config), feel like libssh should be checking it.

llogick avatar Jan 29 '23 22:01 llogick

BTW, with this commit: https://github.com/eranif/codelite/commit/b1005a7d2b26552f48700a831f9cebebb46e2281 You should be able to alter the key algorithms

eranif avatar Jan 30 '23 22:01 eranif

Thank you @eranif ! Do you know when it will be possible to download a build/pre-build of codelite including this modification ?

ChristopheH22 avatar Jan 31 '23 07:01 ChristopheH22

I can probably upload a build in the next hour and will send you a link. This serves us both, as this way you can confirm that the fix works

eranif avatar Jan 31 '23 09:01 eranif

You can try this version (not public yet):

https://downloads.codelite.org/codelite/17.1.0/codelite-amd64-17.1.0.exe

eranif avatar Feb 01 '23 04:02 eranif

any feedback? does this build fixes your issue?

eranif avatar Feb 03 '23 08:02 eranif

Sorry @eranif I didn't had time to test it. I'll try today or tomorrow and let you know the result.

ChristopheH22 avatar Feb 03 '23 09:02 ChristopheH22

@eranif I used thhe version 17.1.0 and it is not working. According to your commit I have to set some environment variables if I'm not wrong. Here is the variables I used : image

Is it right ?

ChristopheH22 avatar Feb 03 '23 12:02 ChristopheH22

are you getting the same errors as before?

eranif avatar Feb 03 '23 12:02 eranif

the original error was about KEX kex error:... Did you try setting the environment variable SSH_OPTIONS_KEY_EXCHANGE?

eranif avatar Feb 03 '23 12:02 eranif

Here is the doc: https://api.libssh.org/stable/group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d

I have enabled these 3: SSH_OPTIONS_KEY_EXCHANGE SSH_OPTIONS_HOSTKEYS SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES

eranif avatar Feb 03 '23 12:02 eranif

I tried this config : image

But I still have the exact same issue when I test the connection : image

ChristopheH22 avatar Feb 03 '23 12:02 ChristopheH22

Looks like the SSH client (in CodeLite) does not apply the environment you defined in the above dialog...

  • You can try and set them in Windows environment and then launch CodeLite
  • Wait for a new CodeLite to try

eranif avatar Feb 03 '23 13:02 eranif

I have uploaded another installer. You can use the same link - this time, it should be able to apply the environment variables before launching the ssh

eranif avatar Feb 07 '23 16:02 eranif

Same issue with this last version. I have the same error message when I test the connection.

ChristopheH22 avatar Feb 10 '23 15:02 ChristopheH22

without steps on how to reproduce this, I am shooting in the dark here

eranif avatar Feb 10 '23 16:02 eranif

The only way to reproduce it on your side is to try to connect to a SSH server with old key alo (ssh-rsa or ssh-dss).

ChristopheH22 avatar Feb 10 '23 16:02 ChristopheH22

can you provide the server config?

eranif avatar Feb 10 '23 16:02 eranif

can you:

  • Run ssh from a terminal with -v and paste the output here?
  • Did you try adding this to your config file? HostkeyAlgorithms +ssh-rsa (as suggested above) On Windows, CodeLite is using this file: %HOMEPATH%\.ssh\config (if it does not exist, create it) Something like this:
Host 127.0.0.1
  HostName 127.0.0.1
  HostkeyAlgorithms +ssh-rsa

eranif avatar Feb 10 '23 16:02 eranif

On my linux board, ssh -v is giving this : image

On windows, I created a "config" file with the information you gave to me but I still have the same issue.

ChristopheH22 avatar Feb 10 '23 18:02 ChristopheH22

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs (within 5 days). Thank you for your contributions.

stale[bot] avatar Jun 18 '23 16:06 stale[bot]