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

Couldn't start a terminal for pent_ngm: All configured authentication methods failed #357

Closed vmkalbskopf closed 1 year ago

vmkalbskopf commented 1 year ago

I can't connect from my Ubuntu 22.08 workstation to another Linux server.

ssh -V

OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022`

Here's my settings.json

{
    "workbench.colorTheme": "Solarized Dark",
    "sshfs.configs": [
        {
            "name": "pent_ngm",
            "label": "pent_ngm",
            "host": "host1",
            "root": "/scratch/ngm_exome_pipeline/",
            "username": "victor",
            "agent": "$SSH_AUTH_SOCK"
        }
    ],
    "sshfs.configpaths": [

    ]
}

I have tried specifying the private key instead of the agent, but I get exactly the same results.

Here's the logs from the Output:

[INFO]    
Created output channel for vscode-sshfs
When posting your logs somewhere, keep the following in mind:
  - While the logging tries to censor your passwords/passphrases/..., double check!
    Maybe you also want to censor out e.g. the hostname/IP you're connecting to.
  - If you want to report an issue regarding authentication or something else that
    seems to be more of an issue with the actual SSH2 connection, it might be handy
    to reconnect with this added to your User Settings (settings.json) first:
      "sshfs.flags": [ "DEBUG_SSH2" ],
    This will (for new connections) also enable internal SSH2 logging.

[INFO]    Calculated config flags: {"fs_notify_errors":[true,"Fix for issue #282"]}
[INFO]    Extension activated, version 1.25.0, mode 1
[DEBUG]   Running VS Code version 1.72.0 {
    "node": "16.14.2",
    "v8": "10.2.154.15-electron.0",
    "uv": "1.43.0",
    "zlib": "1.2.11",
    "brotli": "1.0.9",
    "ares": "1.18.1",
    "modules": "106",
    "nghttp2": "1.45.1",
    "napi": "8",
    "llhttp": "6.0.4",
    "openssl": "1.1.1",
    "cldr": "40.0",
    "icu": "70.1",
    "tz": "2021a3",
    "unicode": "14.0",
    "electron": "19.0.17"
}
[INFO]    Loading configurations...
[DEBUG]     Added configuration pent_ngm from [1]
[INFO]    Found 1 configurations
[INFO]    Command received to open a terminal for FileSystemConfig(pent_ngm)
[INFO]    [createConnection(pent_ngm,config)] Creating a new connection for 'pent_ngm'
[INFO]    Calculating actual config
[DEBUG]     Final configuration:
{
    "name": "pent_ngm",
    "label": "pent_ngm",
    "host": "host1",
    "root": "/scratch/ngm_exome_pipeline/",
    "username": "victor",
    "agent": "/run/user/1000/keyring/ssh",
    "_location": 1,
    "_locations": [
        1
    ],
    "_calculated": {
        "name": "pent_ngm",
        "label": "pent_ngm",
        "host": "host1",
        "root": "/scratch/ngm_exome_pipeline/",
        "username": "victor",
        "agent": "$SSH_AUTH_SOCK",
        "_location": 1,
        "_locations": [
            1
        ]
    },
    "port": 22
}
[INFO]    [createSocket(pent_ngm)] Creating socket
[DEBUG]   [createSocket(pent_ngm)] Connecting to host1:22
[ERROR]   [createSSH(pent_ngm)] Error: All configured authentication methods failed
JSON: {"level":"client-authentication"}
Error: All configured authentication methods failed
    at _e (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:96296)
    at Ie (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:99197)
    at USERAUTH_FAILURE (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:88383)
    at 51 (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:238130)
    at e.exports.D (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:109909)
    at D.decrypt (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:201682)
    at e.exports.H [as _parse] (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:109433)
    at e.exports.parse (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:113236)
    at Socket.<anonymous> (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:95036)
    at Socket.emit (node:events:526:28)
Logged at:
    at e.exports.emit (node:events:526:28)
    at _e (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:96398)
    at Ie (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:99197)
    at USERAUTH_FAILURE (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:88383)
    at 51 (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:238130)
Reported by logger createSSH(pent_ngm)
[ERROR]   Error while creating terminal:
Error: All configured authentication methods failed
JSON: {"level":"client-authentication"}
Error: All configured authentication methods failed
    at _e (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:96296)
    at Ie (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:99197)
    at USERAUTH_FAILURE (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:88383)
    at 51 (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:238130)
    at e.exports.D (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:109909)
    at D.decrypt (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:201682)
    at e.exports.H [as _parse] (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:109433)
    at e.exports.parse (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:113236)
    at Socket.<anonymous> (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/14f8.extension.js:1:95036)
    at Socket.emit (node:events:526:28)
Logged at:
    at m.commandTerminal (/home/victor/.vscode-oss/extensions/kelvin.vscode-sshfs-1.25.0-universal/dist/extension.js:11:29508)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async n._executeContributedCommand (/snap/codium/273/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:90:111316)
CR4567 commented 1 year ago

Hi I have the same issue. Did you find any solution for this? I'm not sure what this error is about.

rdica commented 1 year ago

Ditto, this was working fine up until a few weeks ago.

rdica commented 1 year ago

I've narrowed it down to Fedora 36+ and Ubuntu 22.04 destinations rejecting the connection attempts. I can reach Fedora 35, Ubuntu 16/18/20 LTS servers fine.

Check your SSH key. If its ssh-rsa, thats likely the reason it's getting rejected.

Found this https://unix.stackexchange.com/questions/721606/ssh-server-gives-userauth-pubkey-key-type-ssh-rsa-not-in-pubkeyacceptedalgorit

It may guide you to a fix.

CR4567 commented 1 year ago

you're absolutely right. I changed the key to ssh-ed25519 and now it's working. Maybe for others who are finding this Thread, my issue was with homeassistant version 2022.12.7 and the official ssh add-on

SchoofsKelvin commented 1 year ago

In the future, this issue would be easier to solve with debug logs, as that should report e.g. details about the authentication process.

Looks like this was due to the remote system rejecting the key type without it reporting (through the ssh2 library I use) about this problem, hence a generic error about authentication failing.