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
}
}