liximomo / vscode-sftp

Super fast sftp/ftp extension for VS Code
MIT License
1.5k stars 264 forks source link

All configured authentication methods failed. #702

Open hardianlawi opened 4 years ago

hardianlawi commented 4 years ago

Do you read the FAQ?

Describe the bug All configured authentication methods failed.

To Reproduce

{
    "protocol": "sftp",
    "host": "host",
    "port": 22,
    "username": "hardianlawi",
    "passphrase": true,
    "privateKeyPath": "/Users/hardianlawi/.ssh/id_rsa",
    "remotePath": "/home/hardianlawi/test",
    "syncMode": "full",
    "uploadOnSave": true,
    "ignore": [
        ".vscode",
        ".git",
        ".DS_Store",
        "*data*",
        "*models*",
        "*outputs*",
        "**/*.csv",
        "**/*.feather",
        "**/.ipynb_checkpoints"
    ],
    "syncOption": {
        "delete": true,
        "update": true
    },
    "interactiveAuth": true
}
[12-12 09:42:57] [error] Error: [host]: All configured authentication methods failed
    at Client.<anonymous> (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/dist/extension.js:70:107548)
    at Client.emit (events.js:205:15)
    at doNextAuth (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/client.js:415:12)
    at tryNextAuth (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/client.js:484:5)
    at SSH2Stream.onUSERAUTH_FAILURE (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/client.js:597:5)
    at SSH2Stream.emit (events.js:200:13)
    at parsePacket (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:3772:10)
    at SSH2Stream._transform (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:694:13)
    at SSH2Stream.Transform._read (_stream_transform.js:189:10)
    at SSH2Stream._read (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:253:15)
    at SSH2Stream.Transform._write (_stream_transform.js:177:12)
    at doWrite (_stream_writable.js:417:12)
    at writeOrBuffer (_stream_writable.js:401:5)
    at SSH2Stream.Writable.write (_stream_writable.js:301:11)
    at Socket.ondata (_stream_readable.js:713:22)
    at Socket.emit (events.js:200:13)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:166:17) 

Expected behavior

Everything works fine.

Desktop (please complete the following information):

Extension Logs from Startup - required

  1. Open User Settings.

    • On Windows/Linux - File > Preferences > Settings
    • On macOS - Code > Preferences > Settings
  2. Set sftp.debug to true and reload vscode.
  3. Reproduce the problem, get the logs from View > Output > sftp.
[12-12 09:47:15] [debug] register command "Cancel All Transfer" from "./commandCancelAllTransfer.ts"
[12-12 09:47:15] [debug] register command "Config" from "./commandConfig.ts"
[12-12 09:47:15] [debug] register command "List Active Folder" from "./commandListActiveFolder.ts"
[12-12 09:47:15] [debug] register command "Open Ssh Connection" from "./commandOpenSshConnection.ts"
[12-12 09:47:15] [debug] register command "Set Profile" from "./commandSetProfile.ts"
[12-12 09:47:15] [debug] register command "Toggle Output Panel" from "./commandToggleOutputPanel.ts"
[12-12 09:47:15] [debug] register command "Upload Changed Files" from "./commandUploadChangedFiles.ts"
[12-12 09:47:15] [debug] register command "Delete Remote" from "./fileCommandDeleteRemote.ts"
[12-12 09:47:15] [debug] register command "Diff" from "./fileCommandDiff.ts"
[12-12 09:47:15] [debug] register command "Diff Active File" from "./fileCommandDiffActiveFile.ts"
[12-12 09:47:15] [debug] register command "Download" from "./fileCommandDownload.ts"
[12-12 09:47:15] [debug] register command "Download Active File" from "./fileCommandDownloadActiveFile.ts"
[12-12 09:47:15] [debug] register command "Download Active Folder" from "./fileCommandDownloadActiveFolder.ts"
[12-12 09:47:15] [debug] register command "Download File" from "./fileCommandDownloadFile.ts"
[12-12 09:47:15] [debug] register command "Download Folder" from "./fileCommandDownloadFolder.ts"
[12-12 09:47:15] [debug] register command "Download Force" from "./fileCommandDownloadForce.ts"
[12-12 09:47:15] [debug] register command "Download Project" from "./fileCommandDownloadProject.ts"
[12-12 09:47:15] [debug] register command "Edit In Local" from "./fileCommandEditInLocal.ts"
[12-12 09:47:15] [debug] register command "List" from "./fileCommandList.ts"
[12-12 09:47:15] [debug] register command "List All" from "./fileCommandListAll.ts"
[12-12 09:47:15] [debug] register command "Reveal In Explorer" from "./fileCommandRevealInExplorer.ts"
[12-12 09:47:15] [debug] register command "Reveal In Remote Explorer" from "./fileCommandRevealInRemoteExplorer.ts"
[12-12 09:47:15] [debug] register command "Sync Both Directions" from "./fileCommandSyncBothDirections.ts"
[12-12 09:47:15] [debug] register command "Sync Local To Remote" from "./fileCommandSyncLocalToRemote.ts"
[12-12 09:47:15] [debug] register command "Sync Remote To Local" from "./fileCommandSyncRemoteToLocal.ts"
[12-12 09:47:15] [debug] register command "Upload" from "./fileCommandUpload.ts"
[12-12 09:47:15] [debug] register command "Upload Active File" from "./fileCommandUploadActiveFile.ts"
[12-12 09:47:15] [debug] register command "Upload Active Folder" from "./fileCommandUploadActiveFolder.ts"
[12-12 09:47:15] [debug] register command "Upload File" from "./fileCommandUploadFile.ts"
[12-12 09:47:15] [debug] register command "Upload Folder" from "./fileCommandUploadFolder.ts"
[12-12 09:47:15] [debug] register command "Upload Force" from "./fileCommandUploadForce.ts"
[12-12 09:47:15] [debug] register command "Upload Project" from "./fileCommandUploadProject.ts"
[12-12 09:47:15] [info] config at /Users/hardianlawi/Projects/test {"remotePath":"/home/hardianlawi/test","uploadOnSave":true,"downloadOnOpen":false,"ignore":[".vscode",".git",".DS_Store","*data*","*models*","*outputs*","**/*.csv","**/*.feather","**/.ipynb_checkpoints"],"concurrency":4,"protocol":"sftp","connectTimeout":10000,"interactiveAuth":true,"secure":false,"remoteTimeOffsetInHours":0,"host":"host","port":22,"username":"******","passphrase":"******","privateKeyPath":"/Users/hardianlawi/.ssh/id_rsa","syncMode":"full","syncOption":{"delete":true,"update":true}}
[12-12 09:47:21] [trace] run command 'Sync Local To Remote'
[12-12 09:47:21] [trace] handle sync local ➞ remote for /Users/hardianlawi/Projects/test
[12-12 09:47:24] [debug] Local ident: 'SSH-2.0-ssh2js0.4.5'
[12-12 09:47:24] [debug] Client: Trying host on port 22 ...
[12-12 09:47:24] [debug] Client: Connected
[12-12 09:47:24] [debug] Remote ident: 'SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u1'
[12-12 09:47:24] [debug] Outgoing: Writing KEXINIT
[12-12 09:47:24] [debug] DEBUG: Comparing KEXINITs ...
[12-12 09:47:24] [debug] (local) KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
[12-12 09:47:24] [debug] (remote) KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
[12-12 09:47:24] [debug] KEX algorithm: ecdh-sha2-nistp256
[12-12 09:47:24] [debug] (local) Host key formats: ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
[12-12 09:47:24] [debug] (remote) Host key formats: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
[12-12 09:47:24] [debug] Host key format: ssh-ed25519
[12-12 09:47:24] [debug] (local) Client->Server ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com
[12-12 09:47:24] [debug] (remote) Client->Server ciphers: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[12-12 09:47:24] [debug] Client->Server Cipher: aes128-ctr
[12-12 09:47:24] [debug] (local) Server->Client ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com
[12-12 09:47:24] [debug] (remote) Server->Client ciphers: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[12-12 09:47:24] [debug] Server->Client Cipher: aes128-ctr
[12-12 09:47:24] [debug] (local) Client->Server HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1
[12-12 09:47:24] [debug] (remote) Client->Server HMAC algorithms: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[12-12 09:47:24] [debug] Client->Server HMAC algorithm: hmac-sha2-256
[12-12 09:47:24] [debug] (local) Server->Client HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1
[12-12 09:47:24] [debug] (remote) Server->Client HMAC algorithms: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[12-12 09:47:24] [debug] Server->Client HMAC algorithm: hmac-sha2-256
[12-12 09:47:24] [debug] (local) Client->Server compression algorithms: none,zlib@openssh.com,zlib
[12-12 09:47:24] [debug] (remote) Client->Server compression algorithms: none,zlib@openssh.com
[12-12 09:47:24] [debug] Client->Server compression algorithm: none
[12-12 09:47:24] [debug] (local) Server->Client compression algorithms: none,zlib@openssh.com,zlib
[12-12 09:47:24] [debug] (remote) Server->Client compression algorithms: none,zlib@openssh.com
[12-12 09:47:24] [debug] Server->Client compression algorithm: none
[12-12 09:47:24] [debug] Outgoing: Writing KEXECDH_INIT
[12-12 09:47:24] [debug] DEBUG: Checking host key format
[12-12 09:47:24] [debug] DEBUG: Checking signature format
[12-12 09:47:24] [debug] DEBUG: Verifying host fingerprint
[12-12 09:47:24] [debug] DEBUG: Host accepted by default (no verification)
[12-12 09:47:24] [debug] DEBUG: Verifying signature
[12-12 09:47:24] [debug] Outgoing: Writing NEWKEYS
[12-12 09:47:24] [debug] Outgoing: Writing SERVICE_REQUEST (ssh-userauth)
[12-12 09:47:24] [debug] Outgoing: Writing USERAUTH_REQUEST (none)
[12-12 09:47:24] [debug] Client: none auth failed
[12-12 09:47:24] [debug] Outgoing: Writing USERAUTH_REQUEST (publickey -- check)
[12-12 09:47:24] [debug] Client: publickey auth failed
[12-12 09:47:24] [debug] Outgoing: Writing USERAUTH_REQUEST (keyboard-interactive)
[12-12 09:47:24] [debug] Client: keyboard-interactive auth failed
[12-12 09:47:24] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION)
[12-12 09:47:24] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION)
[12-12 09:47:24] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION)
[12-12 09:47:24] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION)
[12-12 09:47:24] [error] Error: [host]: All configured authentication methods failed
    at Client.<anonymous> (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/dist/extension.js:70:107548)
    at Client.emit (events.js:205:15)
    at doNextAuth (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/client.js:415:12)
    at tryNextAuth (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/client.js:484:5)
    at SSH2Stream.onUSERAUTH_FAILURE (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/client.js:597:5)
    at SSH2Stream.emit (events.js:200:13)
    at parsePacket (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:3772:10)
    at SSH2Stream._transform (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:694:13)
    at SSH2Stream.Transform._read (_stream_transform.js:189:10)
    at SSH2Stream._read (/Users/hardianlawi/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:253:15)
    at SSH2Stream.Transform._write (_stream_transform.js:177:12)
    at doWrite (_stream_writable.js:417:12)
    at writeOrBuffer (_stream_writable.js:401:5)
    at SSH2Stream.Writable.write (_stream_writable.js:301:11)
    at Socket.ondata (_stream_readable.js:713:22)
    at Socket.emit (events.js:200:13)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
shouguicai commented 4 years ago

same to me, do u find the solution ?

ChicBrother commented 4 years ago

me too , same problem . after update to the newest version of vsc .

didn't find any solution yet .

Carlos-Freire commented 4 years ago

[SOLVED!!!]

The solution, for me (MacOs Mojave / VS Code 1.43.9), has included two steps:

I hope it's help.


More simple, but same problem. { "name": "MyLocalhost, "host": "192.168.1.11", "protocol": "sftp", "port": 22, "username": "myusername", "password": "mypass", "remotePath": "/Applications/XAMPP/xamppfiles/htdocs/proped_migra/", "uploadOnSave": false }

Output: [03-11 17:28:58] [debug] Local ident: 'SSH-2.0-ssh2js0.4.5' [03-11 17:28:58] [debug] Client: Trying 192.168.1.11 on port 22 ...

[03-11 17:28:58] [debug] Client: Connected

no conection problem, ok?

[03-11 17:28:59] [debug] Remote ident: 'SSH-2.0-OpenSSH_6.9' [03-11 17:28:59] [debug] Outgoing: Writing KEXINIT [03-11 17:28:59] [debug] DEBUG: Comparing KEXINITs ... [03-11 17:28:59] [debug] (local) KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 [03-11 17:28:59] [debug] (remote) KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 [03-11 17:28:59] [debug] KEX algorithm: ecdh-sha2-nistp256 [03-11 17:28:59] [debug] (local) Host key formats: ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 [03-11 17:28:59] [debug] (remote) Host key formats: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [03-11 17:28:59] [debug] Host key format: ssh-ed25519 [03-11 17:28:59] [debug] (local) Client->Server ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com [03-11 17:28:59] [debug] (remote) Client->Server ciphers: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [03-11 17:28:59] [debug] Client->Server Cipher: aes128-ctr [03-11 17:28:59] [debug] (local) Server->Client ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com [03-11 17:28:59] [debug] (remote) Server->Client ciphers: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [03-11 17:28:59] [debug] Server->Client Cipher: aes128-ctr [03-11 17:28:59] [debug] (local) Client->Server HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1 [03-11 17:28:59] [debug] (remote) Client->Server HMAC algorithms: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [03-11 17:28:59] [debug] Client->Server HMAC algorithm: hmac-sha2-256 [03-11 17:28:59] [debug] (local) Server->Client HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1 [03-11 17:28:59] [debug] (remote) Server->Client HMAC algorithms: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [03-11 17:28:59] [debug] Server->Client HMAC algorithm: hmac-sha2-256 [03-11 17:28:59] [debug] (local) Client->Server compression algorithms: none,zlib@openssh.com,zlib [03-11 17:28:59] [debug] (remote) Client->Server compression algorithms: none,zlib@openssh.com [03-11 17:28:59] [debug] Client->Server compression algorithm: none [03-11 17:28:59] [debug] (local) Server->Client compression algorithms: none,zlib@openssh.com,zlib [03-11 17:28:59] [debug] (remote) Server->Client compression algorithms: none,zlib@openssh.com [03-11 17:28:59] [debug] Server->Client compression algorithm: none [03-11 17:28:59] [debug] Outgoing: Writing KEXECDH_INIT [03-11 17:28:59] [debug] DEBUG: Checking host key format [03-11 17:28:59] [debug] DEBUG: Checking signature format [03-11 17:28:59] [debug] DEBUG: Verifying host fingerprint [03-11 17:28:59] [debug] DEBUG: Host accepted by default (no verification) [03-11 17:28:59] [debug] DEBUG: Verifying signature [03-11 17:28:59] [debug] Outgoing: Writing NEWKEYS [03-11 17:28:59] [debug] Outgoing: Writing SERVICE_REQUEST (ssh-userauth)

[03-11 17:28:59] [debug] Outgoing: Writing USERAUTH_REQUEST (none) [03-11 17:28:59] [debug] Client: none auth failed [03-11 17:28:59] [debug] Outgoing: Writing USERAUTH_REQUEST (password) [03-11 17:28:59] [debug] Client: password auth failed

My password and my username is the same on Sublime SFTP and FileZilla - both ok to connect on localhost server.

[03-11 17:28:59] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION) [03-11 17:28:59] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION) [03-11 17:28:59] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION) [03-11 17:28:59] [debug] Outgoing: Writing DISCONNECT (BY_APPLICATION)

Any sugestion? Thanks in advanced. Carlos

shouguicai commented 4 years ago

me too , same problem . after update to the newest version of vsc .

didn't find any solution yet .

i find a solution:

  1. ssh-copy-id to copy local ssh key to remote
  2. add "agent": "$SSH_AUTH_SOCK" in config
donglixp commented 4 years ago

similar problem after upgrading

carlosa3dm commented 3 years ago

I have same problem too. vscode 1.52.1 liximomo 1.12.9

local server: ubuntu 20.04.1 lts remote server: fedora release 33 ssh local client: 8.2p1-4ubuntu0.1 ssh remote server: OpenSSH_8.4p1, OpenSSL 1.1.1h FIPS 22 Sep 2020

any advance of this issue? thanks.

carlosa3dm commented 3 years ago

I fixed it commenting this line in sshd_config

Include /etc/crypto-policies/back-ends/opensshserver.config

nicknijenhuis commented 3 years ago

For me it was solved by not using an = sign in my password. Could be that there is an encoding issue here.

ghost commented 3 years ago

I'll add this to the backlog.