Install the ftp server in ubuntu (general configuration) 1: Install vsftpd ~ $ Sudo apt-get install vsftpd ubuntu10.10 is installed by yourself. This step is omitted. 2: Configure vsftpd 2.1 to modify the configuration file of vsftpd. Such configuration files are usually located in the/etc directory. ~ $ Sudo gedit/etc/vsftpd. many commands in the original conf file are commented out. You only need to enable the commands. The following are the commands that are enabled (each entry is described in the configuration file) listen = YES # server listening anonymous_enable = YES # Allow local_enable = YES for anonymous access # Allow write_enable = YES for local host access # Allow write anon_upload_enable = YES # Allow Anonymous upload. The default value is NO, if it is too troublesome, you can start it. I am not responsible for any problems ~ Allow = YES # Allow dirmessage_enable = YES # Allow xferlog_enable = YES # Allow connect_from_port_20 = YES # Allow Port 20 as the data transmission port secure_chroot_dir =/ var/run/vsftpd/emptypam_service_name = vsftpdrsa_cert_file =/etc/ssl/private/vsftpd. save the pem. 2.2 After ftp-related directories are installed, an ftp directory is added to/srv. At the same time, the system will add a user group named ftp. You can use ~ $ Sudo cat/etc/shadow view, such as ftp: *: 14993: 0: 99999: 7 :::. We create two directories named upload and download under the/srv/ftp directory for upload and download respectively. Next we will set the permissions for the directories we just created, as shown below: permissions/srv/ftp/upload/srv/ftp/download user group (ftp) read/write other users read/write execute the command :~ $ Sudo chmod 755/home/ftp ~ $ Sudo chmod 777/home/ftp/upload ~ $ Sudo chmod 755/home/ftp/download. On the one hand, we allow the user group ftp to access/home/ftp (anonymous access ); on the one hand, the user group is granted the ftp write right to/srv/ftp/upload, so users on the network can easily upload files, but note that when they upload files, only the root user has the permission to upload these files. That is to say, this directory can only be used for uploading and cannot be downloaded; in addition, the user group is granted the ftp read right to/home/ftp/download, and the files we copy to this directory usually have the read right for the user group, therefore, users on the network can only download files from this directory. This satisfies our pre-requirements. 3: Start vsftpd ~ $ Sudo service vsftpd start :~ $ Ps-e 2183? 00:00:00 vsftpd the most basic configuration of vsftp on the server has been completed, and vsftpd has been enabled. (Pay attention to your firewall configuration. You can directly disable the firewall as a simple test.) Of course, to disable the vsftpd process, you only need to execute it ~ $ Sudo service vsftpd stop. You can also use the command ~ $ Pgrep vsftpd to check whether the process vsftp exists. 4: vsftpd sets the user directory. If you have set an anonymous user, you can log on to the upload page ~ This can save ~ (1) Add sudo groupadd ftpgroup (2) Modify vsftpd. conf ~ $ Sudo gedit/etc/vsftpd. conf: Replace the following three rows # chroot_list_enable = YES # (default follows) # chroot_list_file =/etc/vsftpd/chroot_list with chroot_list_enable = YES # (default follows) chroot_list_file =/etc/vsftpd/chroot_list (3) add User ftpuser and set its directory to/home/nation/ftp/uploadsudo useradd-g ftpgroup-d/home/nation/ftp/upload-M ftpuser (Note: G: user's Group d: Specifies the location where the user's own directory is created. M: No default home directory is created, that is, the user does not have its own directory in/home.) (4) set the User Password passwd ftpuser (5) to edit the chroot_list file: sudo gedit/etc/vsftpd. the content of chroot_list is the ftp user name, and each user occupies one line. For example, ftpuser (6) restarts vsftpd: sudo service vsftpd start.