SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

key exchange algorithm - settings #236

Closed Hentze0808 closed 3 years ago

Hentze0808 commented 3 years ago

Hi

I am having problems with the add on for VS code. It promts for user and then fails with this message.: Couldn't start a terminal for mymi: Handshake failed: no matching key exchange algorithm

Is there any fix for this..?

Maybe somewhere where I can add the Algorithms..?

Thanks in andvance.! /Ragnar

SchoofsKelvin commented 3 years ago

Can you post the SSH FS log? It is available under Output > SSH FS. While it should censor passwords/passphrases, I recommend checking it for (other) sensitive data first.

Which key algorithms does your server support? I use an external module called ssh2 to handle the actual SSH connection (apart from some proxy stuff), which might not support your key algorithm.

Hentze0808 commented 3 years ago

Sure! I use this with other SSH configs. Ciphers 3des-cbc KexAlgorithms +diffie-hellman-group1-sha1

And log says: [INFO] Command received to open a terminal for FileSystemConfig(mymi) [INFO] [createConnection(mymi,config)] Creating a new connection for 'mymi' [INFO] Calculating actual config [DEBUG] Final configuration: { "name": "mymi", "host": "SECRET", "_location": 2, "_locations": [ 2 ], "_calculated": { "name": "mymi", "host": "SECRET", "_location": 2, "_locations": [ 2 ] }, "username": "root" } [INFO] [createSocket(mymi)] Creating socket [DEBUG] [createSocket(mymi)] Connecting to SECRET:22 [INFO] [createSSH(mymi)] Creating SSH session over the opened socket [ERROR] [createSSH(mymi)] Handshake failed: no matching key exchange algorithm Logged at: at T. (c:\Users\RAHEN.vscode\extensions\kelvin.vscode-sshfs-1.19.1\dist\2.extension.js:1:9079) at T.emit (events.js:223:5) at ae. (c:\Users\RAHEN.vscode\extensions\kelvin.vscode-sshfs-1.19.1\dist\0.extension.js:717:121) at ae.emit (events.js:228:7) at c:\Users\RAHEN.vscode\extensions\kelvin.vscode-sshfs-1.19.1\dist\0.extension.js:4945:179 Reported from createSSH(mymi)

If more info is needed, I will give what I know.

SchoofsKelvin commented 3 years ago

According to this, these two are supported, although not enabled by default.

You should be able to enable them by opening your settings.json (wherever your SSH FS config is stored, in your case it seems to be your workspace file) and add these two fields:

"sshfs.configs": [
        {
            "name": "mymi",
            "algorithms": {
                "kex": ["diffie-hellman-group1-sha1"],
                "cipher": ["3des-cbc"]
            }
        }
]

You might have to add serverHostKey, hmac and compress if the underlying library I use doesn't like you only overwriting kex and cipher.