VScode中使用SFTP插件连接远程服务器进行文件修改

下载SFTP插件后,使用Ctrl+Shift+P。输入SFTP,选择第一个将会生成简短的默认配置文件

vscode配置SFTP连接


然后把sftp.json文件内内容换成以下配置:

{
    "host": "远程服务器IP地址",
    "port": 22,
    "username": "远程服务器登录名",
    "password": "远程服务器密码",
    "protocol": "sftp",
    "agent": null,
    "privateKeyPath": null,
    "passphrase": null,
    "passive": false,
    "interactiveAuth": true,
    "remotePath": "远程服务器路径,如(/usr/local/...)",
    "uploadOnSave": true,
    "syncMode": "update",
    "ignore": [
        "**/.vscode/**",
        "**/.git/**",
        "**/.DS_Store"
    ],
    "watcher": {
        "files": "glob",
        "autoUpload": true,
        "autoDelete": true
    }

}

在项目目录树中,找到下载(如下图),即可把服务器文件下载下来了,上面配置了  uploadOnSave 。在编辑文件保存后会自动上传到服务器,如果不需要则把配置文件改成false即可。

vscode配置SFTP连接

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2021-11-22
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-28
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
相关资源
相似解决方案