[Linux program installation] FTP installation and data transfer on Windows (Ubuntu 18.04)

        I found a small host on a certain fish some time ago, and installed the ubuntu 18.04 system. In the process of using it, I found that it is inconvenient to transfer files between small hosts and ordinary computers, and the transfer speed of software such as MobaXterm is relatively slow, so I thought of using ftp to transfer files.

1. Introduction to FTP

        FTP is the English abbreviation of File Transfer Protocol (File Transfer Protocol), while the Chinese abbreviation is "Text Transfer Protocol". Used for bi-directional transmission of control files on the Internet.

      In the use of FTP, users often encounter two concepts: "download" (Download) and "upload" (Upload). "Downloading" a file means copying a file from a remote host to your own computer; "uploading" a file means copying a file from your own computer to a remote host. In Internet language, users can upload (download) files to (from) remote hosts through client programs.

2. Install the vsftpd server

sudo apt-get install vsftpd

3. Configuration environment

1. Configure the vsftpd.conf file

sudo vim /etc/vsftpd.conf
#将下面这些内容直接复制到该文件最末尾即可
write_enable=YES            # 开放本地用户的写权限
chroot_local_user=YES       # 在/etc/vsftpd.chroot_list文件中列出的用户,可以切换到其他目录;未在文件中列出的用户,不能切换到其他目录。
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
local_root=/home/zyt        # 设置本地用户登陆后的目录,默认为本地用户的主目录

2. Configure the user vsftpd.chroot_list file

sudo vim /etc/vsftpd.chroot_list

Put the names of users who are allowed to use this ftp server into this file.

 4. Restart verification

sudo /etc/init.d/vsftpd restart

You can use the following command to check whether ftp is working normally , and if active is displayed, it means it is working normally

service vsftpd status

Open the settings on the computer of the windows system, search for internet properties, and uncheck the circled areas in the figure: 

 

Please note: Before performing this step, make sure that your small host is in the same network segment as your Windows system computer (connected to the same router). If it is a virtual machine, make sure that the virtual machine is in bridging mode! ! !

Then use the ie browser  on your own computer (windows system) (must have this, like Google browser does not support) input (you need to use the ip address (linux system)) (you need to log in for the first time (do not Select anonymous login), enter the user name and password) :

ftp://ip地址/home/zyt(这里的路径是在前面 vsftpd.conf 文件设置的 local_root 路径)

 

Here, the Chinese characters are displayed as garbled characters. We need to convert the encoding of the web page to utf-8, but after converting, some of the original Chinese characters also become garbled characters. Let’s see.

 After successful access, open my computer, right-click and select "Add a network location" , and then enter ftp://linux system ip address: 21

( Do not choose  anonymous login, because anonymous login was not turned on in the previous configuration)

 

 After the creation is complete, if it succeeds, the local_root path specified in the vsftpd.conf file will be displayed at this time (Note: I specified the path twice here for more rigorousness)  

 If you want to upload and download files, you must log in first , otherwise the operation may fail. ( Do not choose anonymous login when logging in , because anonymous login was not turned on in the previous configuration)

 

 

 At this point, you can transfer files happily.

reference:

[Original] vsftpd reference manual - Ubuntu Chinese Forum

Vsftpd configuration chroot_list_enable, chroot_local_user, chroot_list_file description_Pleasant sheep love red wolf's blog-CSDN blog_chroot_list_file

Guess you like

Origin blog.csdn.net/weixin_48896613/article/details/127215986