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 dianli: All configured authentication methods failed #261

Closed sakurarain99 closed 3 years ago

sakurarain99 commented 3 years ago

After installing the SSH FS plug-in, an error occurred. The following is my connection configuration: "sshfs.configs": [ { "name": "power", // "group": "create.power", "host": "xxx.xx.xxx.130", "port": 22, "root": "/", "username": "root", "password": "root123", "agent": "$SSH_AUTH_SOCK" } ],

sakurarain99 commented 3 years ago

What causes this? Is there any solution?

SchoofsKelvin commented 3 years ago

This issue would be easier to solve with debug logs, so please follow these steps:

At first glance, it looks like you're trying to use a password, but also specified agent. When an agent is specified and available, the extension will try to (only) use that agent, even if it fails. That's currently a limitation of the underlying ssh2 library, but might get resolved in the future.

sakurarain99 commented 3 years ago

Where is output > SSH FS?

SchoofsKelvin commented 3 years ago

VS Code has an Output view/pane, by default accessible with Ctrl + Shift + U: image After you opened that view, use the dropdown to select SSH FS. extension needs to be already activated, but just viewing the SSH FS sidebar pane will already activate it

sakurarain99 commented 3 years ago

[DEBUG] [ssh2(dianli)] DEBUG: Parser: HMAC size:32 [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAVERIFY [DEBUG] [ssh2(dianli)] DEBUG: Parser: Verifying MAC [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC) [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_FAILURE [DEBUG] [ssh2(dianli)] DEBUG: Client: none auth failed [DEBUG] [ssh2(dianli)] DEBUG: Outgoing: Writing USERAUTH_REQUEST (password) [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16) [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKET [DEBUG] [ssh2(dianli)] DEBUG: Parser: Decrypting [DEBUG] [ssh2(dianli)] DEBUG: Parser: pktLen:60,padLen:6,remainLen:48 [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATA [DEBUG] [ssh2(dianli)] DEBUG: Parser: Decrypting [DEBUG] [ssh2(dianli)] DEBUG: Parser: HMAC size:32 [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAVERIFY [DEBUG] [ssh2(dianli)] DEBUG: Parser: Verifying MAC [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC) [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_FAILURE [DEBUG] [ssh2(dianli)] DEBUG: Client: password auth failed [DEBUG] [ssh2(dianli)] DEBUG: Outgoing: Writing USERAUTH_REQUEST (keyboard-interactive) [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16) [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKET [DEBUG] [ssh2(dianli)] DEBUG: Parser: Decrypting [DEBUG] [ssh2(dianli)] DEBUG: Parser: pktLen:60,padLen:6,remainLen:48 [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATA [DEBUG] [ssh2(dianli)] DEBUG: Parser: Decrypting [DEBUG] [ssh2(dianli)] DEBUG: Parser: HMAC size:32 [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAVERIFY [DEBUG] [ssh2(dianli)] DEBUG: Parser: Verifying MAC [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC) [DEBUG] [ssh2(dianli)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_FAILURE [DEBUG] [ssh2(dianli)] DEBUG: Client: keyboard-interactive auth failed [ERROR] [createSSH(dianli)] All configured authentication methods failed Logged at: at T. (/home/sakura/.vscode/extensions/kelvin.vscode-sshfs-1.20.1/dist/2.extension.js:1:5991) at T.emit (events.js:315:20) at F (/home/sakura/.vscode/extensions/kelvin.vscode-sshfs-1.20.1/dist/0.extension.js:1:22077) at q (/home/sakura/.vscode/extensions/kelvin.vscode-sshfs-1.20.1/dist/0.extension.js:1:23098) at ae.Q (/home/sakura/.vscode/extensions/kelvin.vscode-sshfs-1.20.1/dist/0.extension.js:1:24656) Reported from createSSH(dianli) [DEBUG] [ssh2(dianli)] DEBUG: Outgoing: Writing DISCONNECT (BY_APPLICATION)

sakurarain99 commented 3 years ago

The password can be confirmed

SchoofsKelvin commented 3 years ago

According to those logs, it does try to log in with the password, but the server replies with a failure. If you're sure the password is correct, I can only think of a few causes:

You could perhaps take a look at your server's sshd logs (depending on your OS, these might be in some "security logs" or a journal) while potentially even running sshd with LogLevel set to DEBUG3 or similar. Should you share these logs, be sure to thoroughly go through them, as the debug log levels can start logging some very sensitive information.

sakurarain99 commented 3 years ago

Well, thank you

SchoofsKelvin commented 3 years ago

Since you closed the issue, I assume you found the cause and how to fix it?