一、前言

本文主要记录了Sublime Text编辑器下的SFTP/FTP的安装使用,方便linux和windows下的文件编辑,只是简单的记录,有不足之处,还望指教。

二、Linux和windows下的文件共享方式

1.Samba

2.FTP

3.NFS

4.WinSCP

5.sshfs

关于sshfs的方式,本人试过之后,可依然不成功,也可能是本人sublime text编辑器的问题,所以用了sftp/ftp插件的方式,感兴趣的朋友,可参考下面方式自己动手试试

https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh

三、SFTP/FTP插件的安装

1.sublime下的配置

①.ctrl+shift+p 呼出搜索框,输入 install package;

回车,再次输入 FTP,找到SFTP/FTP插件安装即可

②.成功后,点击菜单 File->SFTP/FTP->Setup Server来生成一个配置文件,修改后,保存即可

注意保存的路径是 菜单 Preferences > Browse Packages… 下的 User/sftp_servers 目录里面

下面是我的配置,一般只需配置

服务器,用户名,密码,以及连接路径

 1 {
 2     // The tab key will cycle through the settings when first created
 3     // Visit http://wbond.net/sublime_packages/sftp/settings for help
 4     
 5     // sftp, ftp or ftps
 6     "type": "ftp",
 7 
 8     "sync_down_on_open": true,
 9     "sync_same_age": true,
10     
11     "host": “xxx",
12     "user": "xxx",
13     "password": "xxx",
14     //"port": "21",
15     
16     "remote_path": "/home/xxx",
17     //"file_permissions": "664",
18     //"dir_permissions": "775",
19     
20     //"extra_list_connections": 0,
21 
22     "connect_timeout": 30,
23     //"keepalive": 120,
24     //"ftp_passive_mode": true,
25     //"ftp_obey_passive_host": false,
26     //"ssh_key_file": "~/.ssh/id_rsa",
27     //"sftp_flags": ["-F", "/path/to/ssh_config"],
28     
29     //"preserve_modification_times": false,
30     "remote_time_offset_in_hours": 1,
31     //"remote_encoding": "utf-8",
32     //"remote_locale": "C",
33     //"allow_config_upload": false,
34 }
View Code

相关文章: