vs code 插件 sftp 错误 Handshake failed: no matching client->server cipher 问题解决

版权声明:本文为博主原创文章,未经博主允许不得转载哦 (ÒωÓױ) https://blog.csdn.net/u012814856/article/details/81947349

一、引言

在 linux 的开发过程中,难免需要对服务器上的项目进行修改。能够 sftp 上服务器并且可以方便编辑文件的,可能还真是 UltraEdit 做的最好。

可是我喜欢 vs code。

正好 vs code 也有一个 sftp 插件。

可是,今天在使用 vs code 连接到服务器上的时候,出了这么一个错误:

Handshake failed: no matching client->server cipher 

问题出现的含义非常清晰,就是客户端与服务端没有一个统一的加密算法。

二、解决

解决这个问题的方法很简单,在 sftp.json 中增加如下配置信息:

"algorithms": {
    "kex": [
      "diffie-hellman-group1-sha1",
      "ecdh-sha2-nistp256",
      "ecdh-sha2-nistp384",
      "ecdh-sha2-nistp521",
      "diffie-hellman-group-exchange-sha256",
      "diffie-hellman-group14-sha1"
    ],
    "cipher": [
      "3des-cbc",
      "aes128-ctr",
      "aes192-ctr",
      "aes256-ctr",
      "aes128-gcm",
      "[email protected]",
      "aes256-gcm",
      "[email protected]"
    ],
    "serverHostKey": [
      "ssh-rsa",
      "ecdsa-sha2-nistp256",
      "ecdsa-sha2-nistp384",
      "ecdsa-sha2-nistp521"
    ],
    "hmac": [
      "hmac-sha2-256",
      "hmac-sha2-512",
      "hmac-sha1"
    ]
}

通过增加了这段配置信息,我成功 sftp 到了服务器,希望能够对你有一些帮助 ^_^

Enjoy It :)

猜你喜欢

转载自blog.csdn.net/u012814856/article/details/81947349