Mkdir/var/FTP // (create an FTP directory) chown FTP/var/FTP // (make the user FTP the owner of/var/FTP, and anonymous access will be disabled later, therefore, this step is required) chmod o-x/var/FTP/* (revoking the user's FTP permission to execute all files under/var/FTP/, which makes it safer. */Passwd FTP // (set the user's FTP password) Vim/etc/password // (edit the password file and change the FTP home directory to/var/FTP) vim/etc/vsftpd. conf // (compile the main configuration file of the F series vsftpd, anonymous_enable = No, Listen = yes) Service vsftpd start // (start vsftpd) chkconfig vsftpd on // (set vsftpd to be started when the system starts)
Controls whether users are allowed to switch to the parent directory
By default, after logging on to FTP, a local user can use the CD command to switch to another directory, which brings security risks to the system.
You can use the following three configuration files to control user directory switching. Chroot_list_enable = Yes/No (NO) sets whether to enable the user list file specified by the chroot_list_file configuration item. The default value is no.
Chroot_list_file =/etc/vsftpd. chroot_list is used to specify the user list file, which is used to control which users can switch to the parent directory of the user's home directory.
Chroot_local_user = Yes/No (NO) is used to specify whether users in the user list file are allowed to switch to the parent directory. The default value is no.
The following effects can be achieved through combination:
① When chroot_list_enable = Yes, chroot_local_user = Yes, in/etc/vsftpd. users listed in the chroot_list file can switch to other directories. Users not listed in the file cannot switch to other directories.
② When chroot_list_enable = Yes, chroot_local_user = No, in/etc/vsftpd. users listed in the chroot_list file cannot switch to other directories. Users not listed in the file can switch to other directories.
③ When chroot_list_enable = No, chroot_local_user = Yes, all users cannot switch to other directories.
④ When chroot_list_enable = No and chroot_local_user = No, all users can switch to other directories.