# 好用的VSCode的SFTP插件

# 1 简介

试了几款SFTP插件,觉得这款比较好用,推荐一下。不过它已经是很受欢迎的了,权当记录一下用法吧。

主要功能有:

查看远程服务器文件;

本地和远程文件对比;

上传下载;

多远程服务器配置等。

# 2 使用

Ctrl+Shift+PCmd+Shift+P 然后输入SFTP: config配置远程服务器。

配置单个远程服务器:

{
    "name": "My Server",
    "host": "localhost",
    "protocol": "sftp",
    "port": 22,
    "username": "larry",
    "password": "password", 
    "remotePath": "/Users/larry",
    "uploadOnSave": true
}

配置多个远程服务器,分别使用密码和private key:

[
  {
    "name": "pkslow",
    "context": "pkslow",
    "host": "www.pkslow.com",
    "protocol": "sftp",
    "port": 22,
    "username": "pkslow",
    "password": "password",
    "remotePath": "/home/pkslow"
  },
  {
    "name": "www.pkslow.com",
    "context": "www.pkslow.com",
    "host": "www.pkslow.com",
    "protocol": "sftp",
    "port": 22,
    "username": "root",
    "privateKeyPath": "~/.ssh/id_rsa",
    "remotePath": "/root"
  }
]

如果遇到以下问题:

Error while signing data with privateKey: error:06000066:public key routines:OPENSSL_internal:DECODE_ERROR #594

请查看:https://github.com/liximomo/vscode-sftp/issues/594


参考:

GitHub home (opens new window)

GitHub Wiki (opens new window)

上次更新: 2023/8/18 23:39:36