vscode-sftp: [sftp] All configured authentication methods failed
Expected Behavior
Trying to upload file to server via sftp
Actual Behavior
Getting error saying all configured authentication methods failed
Steps to Reproduce the Problem
This is my sftp.json file:
{
"host": "example@example.com",
"port": 22,
"username": "example_username",
"password": "example_password",
"protocol": "sftp",
"agent": null,
"privateKeyPath": null,
"passphrase": null,
"passive": false,
"interactiveAuth": true,
"remotePath": "/example",
"uploadOnSave": false,
"syncMode": "update",
"watcher": {
"files": false,
"autoUpload": false,
"autoDelete": false
},
"ignore": [
"**/.vscode/**",
"**/.git/**",
"**/.DS_Store"
]
}
Specifications
- Version: 0.8.3
- Platform: Mac OS X El Capitan 10.11.6
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 29 (3 by maintainers)
In my case, server’s
/var/log/auth.logsaid,which lead to a solution by adding,
in
/etc/ssh/sshd_configand restartsshd.Seems newer Ubuntu 22.04 has changed default accepted key types and this plugin no longer worked despite
sshcommand working fine.I think the error messages it’s clear.
@StarlingMercedes go to sftp.json file and add this line:
"interactiveAuth": trueTake a look at my file:
Check your password.
Your ssh authentication failed. Check your sshd logs on your server. It has nothing to do with the extension.
The same password will ok when interactiveAuth is true, so I am sure there is a bug somewhere.
having same issue here
for me
interactiveAuthdoes not work but settingprivateKeyPathto myid_rsaworks.The same happened to me because I didn’t specified the private key path, my mistake.
I have enabled
interactiveAuthand the problem has goneWORK PERFECTLY !
This work
WSL Ubuntu 22.04 LTSlocal +Windows 10passwordremove insftp.jsonuse"privateKeyPath": "C:\\Users\\ANTON\\.ssh\\id_rsa",this solved the problem !
This worked for me, same exact issue.
Made modification in the server sshd config file /etc/ssh/sshd_config as below and it started working <quote> KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 Ciphers 3des-cbc,blowfish-cbc,aes128-cbc,aes128-ctr,aes256-ctr,aes192-cbc,aes256-cbc,arcfour </quote>
With a Ubuntu 22.04 Digital Ocean droplet I found that doing what @windware-ono suggested above was almost but not quite enough.
Looking at the
/var/log/auth.logwas very helpful but, looking at why it was failing I saw a different error. Per this answer i had to enable legacy support for diffie-hellman-group1-sha1 algorithm. After doing this I saw thekey type ssh-rsa not in PubkeyAcceptedAlgorithmserror… and so addedPubkeyAcceptedKeyTypes=+ssh-rsaas well and then it worked.So the changes in total was to add this to the bottom of
/etc/ssh/sshd_configand restart sshd. (systemctl restart sshd) after doing that sftp from vscode worked as I wanted.ALL of this should be added to the FAQ.
@marcosgugeler how im can active interactiveAuth ??