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)

Most upvoted comments

In my case, server’s /var/log/auth.log said,

key type ssh-rsa not in PubkeyAcceptedAlgorithms

which lead to a solution by adding,

PubkeyAcceptedKeyTypes=+ssh-rsa

in /etc/ssh/sshd_config and restart sshd.

Seems newer Ubuntu 22.04 has changed default accepted key types and this plugin no longer worked despite ssh command working fine.

I think the error messages it’s clear.

@StarlingMercedes go to sftp.json file and add this line:

"interactiveAuth": true

Take a look at my file:

{
    "name": "My Site",
    "host": "my.ftp.net",
    "protocol": "sftp",
    "port": 5022,
    "username": "myftpuser",
    "password": "mypassword",
    "remotePath": "/home",
    "uploadOnSave": true,
    "interactiveAuth": true
}

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 interactiveAuth does not work but setting privateKeyPath to my id_rsa works.

The same happened to me because I didn’t specified the private key path, my mistake.

I have enabled interactiveAuth and the problem has gone

In my case, server’s /var/log/auth.log said,

key type ssh-rsa not in PubkeyAcceptedAlgorithms

which lead to a solution by adding,

PubkeyAcceptedKeyTypes=+ssh-rsa

in /etc/ssh/sshd_config and restart sshd.

Seems newer Ubuntu 22.04 has changed default accepted key types and this plugin no longer worked despite ssh command working fine.

WORK PERFECTLY !

In my case, server’s /var/log/auth.log said,

key type ssh-rsa not in PubkeyAcceptedAlgorithms

which lead to a solution by adding,

PubkeyAcceptedKeyTypes=+ssh-rsa

in /etc/ssh/sshd_config and restart sshd.

Seems newer Ubuntu 22.04 has changed default accepted key types and this plugin no longer worked despite ssh command working fine.

This work WSL Ubuntu 22.04 LTS local + Windows 10 password remove in sftp.json use "privateKeyPath": "C:\\Users\\ANTON\\.ssh\\id_rsa",

In my case, server’s /var/log/auth.log said,

key type ssh-rsa not in PubkeyAcceptedAlgorithms

which lead to a solution by adding,

PubkeyAcceptedKeyTypes=+ssh-rsa

in /etc/ssh/sshd_config and restart sshd.

Seems newer Ubuntu 22.04 has changed default accepted key types and this plugin no longer worked despite ssh command working fine.

this solved the problem !

In my case, server’s /var/log/auth.log said,

key type ssh-rsa not in PubkeyAcceptedAlgorithms

which lead to a solution by adding,

PubkeyAcceptedKeyTypes=+ssh-rsa

in /etc/ssh/sshd_config and restart sshd.

Seems newer Ubuntu 22.04 has changed default accepted key types and this plugin no longer worked despite ssh command working fine.

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.log was 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 the key type ssh-rsa not in PubkeyAcceptedAlgorithms error… and so added PubkeyAcceptedKeyTypes=+ssh-rsaas well and then it worked.

So the changes in total was to add this to the bottom of /etc/ssh/sshd_config and restart sshd. (systemctl restart sshd) after doing that sftp from vscode worked as I wanted.

#Legacy changes
KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc
PubkeyAcceptedKeyTypes=+ssh-rsa

ALL of this should be added to the FAQ.

@marcosgugeler how im can active interactiveAuth ??