ctrl+shift+p->pci(package control install package)->sftp(下载sftp插件)
看到网络上有的教程是如下图设置,但是无法保存。
于是进行第二种方法,根目录右键,打开之后
主要设置host,user,password,port,remote_path
例如 host:40.125.208.172
user:grace
password:admin
port sftp默认22
要确保能连接上哦,
remote_path:'/www/wwwroot/40.125.208.172/',这个是远程服务器路径
碰到的几个报错,例如can't not find folder,permission denied,然后又是各种查资料,有的确实是因为权限不够或是什么的,但是我这个结果后面发现是remote_path路径写错了。
在文件中右键,然后就可以对文件进行操作啦。
有时候会提示sftp要购买什么的,可以在如下图所示设置
找到的资料
{
"email": "[email protected]",
"product_key": "d419f6-de89e9-0aae59-2acea1-07f92a"
}
{
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "sftp",
"save_before_upload": true,//上传前保存在本地
"upload_on_save": false, //保存时是否自动上传,否
"sync_down_on_open": false,//在本地是否打开某个文件自动下载服务器中的,否
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "example.com", //服务器名字
"user": "username", //用户名
//"password": "password",
//"port": "22",
"remote_path": "/example/path/",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}
}
字段释义参考https://wbond.net/sublime_packages/sftp/settings