VSCODE使用sftp(作者:Natizyskunk)连接服务器

SFTP方式比较文本直接配置就好用,这次主要说明使用FTP的方式。

FTP方式

配置:

javascript 复制代码
{
    "name": "测试机",
    "protocol": "ftp",
    "host": "xxx.xxx.xxx.xxx",
    "port": 21,
    "username": "账号",
    "password": "密码",
    "remotePath": "/a/b/", // 路径一定要对,不对它也不会报错
    "ignore": [
        ".vscode",
        ".git",
        ".DS_Store"
    ],
    "uploadOnSave": true,
    "watcher": {
        "files": "**/*",
        "autoUpload": false,
        "autoDelete": true
    }
}

如果没有连接上,可以在设置里打开sftp的debug功能,查看输出。

连接上之后发现上传或更新文件非常的慢,那是因为没有给FTP服务指定被动地址,客户端需要等待解析这个地址。

修改Ftp服务配置

参考:https://github.com/Natizyskunk/vscode-sftp/issues/100

PureFTPd的配置:

javascript 复制代码
ForcePassiveIP             118.31.79.235

配置好后重启ftp服务后,速度就快了。

相关推荐
Mortalbreeze2 分钟前
软件包管理器yum和编辑器vim详解 —— 附带vim配置链接
linux·服务器
李日灐32 分钟前
< 7 > Linux 开发工具:git 版本控制器 和 cgdb/gdb 调试器
linux·运维·服务器·开发语言·git·调试器·gdb/cgdb
青木96044 分钟前
前后端开发调试运行技巧
linux·服务器·前端·后端·npm·uv
-星空下无敌1 小时前
IDEA 2025.3.1最新最全下载、安装、配置及使用教程(保姆级教程)
java·ide·intellij-idea
Gene_20221 小时前
ubuntu22.04安装Claude Code及其在vscode跑通
ide·vscode·arcgis
isaac.easy1 小时前
实战指南:CodeBuddy IDE × GLM-4.7 × Spec-Kit 构建智能化开发工作流
ide
cui_ruicheng1 小时前
Linux进程间通信(一):管道与IPC基础
linux·运维·服务器
shuangrenlong1 小时前
android studio突然一直importing卡住
android·ide·android studio
计算机安禾2 小时前
【Linux从入门到镜头】第29篇:文本处理三剑客(下)——awk 数据处理神器
linux·运维·服务器