vscode配置SFTP连接

vscode配置SFTP连接


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

 

下载SFTP插件后,使用Ctrl+Shift+P。输入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即可。
在这里插入图片描述

posted on 2020-09-16 17:56  JesseWeng  阅读(3071)  评论(0编辑  收藏  举报

导航