First, preface
This article mainly records the sublime text editor under the SFTP/FTP installation and use, convenient for Linux and Windows file editing, just a simple record, there are shortcomings, but also hope to advise.
Ii. how to share files under Linux and Windows
1.Samba
2.FTP
3.NFS
4.WinSCP
5.sshfs
About SSHFS Way, I tried after, can still not succeed, also may be I sublime text editor of the problem, so with the sftp/ftp plug-in way, interested friends, can refer to the following ways to try their own hands
Https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
Third, the installation of SFTP/FTP plug-in
Configuration under 1.sublime
①.ctrl+shift+p Call out the search box, enter the install package;
Enter FTP again, find the SFTP/FTP plug-in installation
②. After successful, click menu File->sftp/ftp->setup Server to generate a profile, modify, save it
Note the saved path is the menu Preferences > Browse Packages ... Under the User/sftp_servers directory
Here is my configuration, generally just configure
Server, user name, password, and connection path
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
③. Click menu File->sftp/ftp->browse Server to connect to the server
You can also use Ctrl+alt + r+b to open
Iv. configuration under Linux
Because the SFTP/FTP plug-in is used, the server needs to open the appropriate services, and create the appropriate users and user groups, etc.
1. Installation of the service opens
1. Check whether FTP service is installed
rpm -qa |grep vsftpd
2. Install if it is not installed (of course, it can be installed in many ways)
yum -y install vsftpd
3. Open service
sudo /etc/init.d/vsftpd start
2. Creation of the user
1. Add user group
Groupadd - G 501 FTP / / when adding a user group, specify the user group ID number
(view user group information cat / etc / group)
2. Add user
Useradd - D / home / ftp - G 501 - M FTP / / when adding a user, create the user's home directory and specify the user group ID number
(view user information cat / etc / passwd)
3. Set user password
Passwd XXX
(check the user password file cat / etc / shadow)
Of course, you need to make sure that when you use an FTP user connection, modify the appropriate directory or file, to ensure that the FTP user has the appropriate permissions.
Sublime text using the Sftp/ftp plugin