First, the configuration steps
1. Installing VSFTP
Installing vsftp with the Yum command
#yum Install Vsftpd-y
2. Add FTP Account and directory
determine the location of the nologin, usually under/usr/sbin/nologin or/sbin/nologin, and then use the following command to create the account, which specifies the root directory where HOME/FTP01 is the user ftp01. You can define your account name and directory yourself:
#useradd-D home/ftp01-s/sbin/nologin FTP01
3. Modify the password for this account:
#passwd YourPassword
4. Modify permissions for the specified directory
#chown-R FTP01.FTP01/HOME/FTP01
5. Configure Vsftp
Edit the Vsftp configuration file with the following command:
#vi/etc/vsftpd/vsftpd.conf
Change "Anonymous_enable=yes" in the configuration file to "Anonymous_enable=no"
Remove the comment symbol before the following configuration:
Local_enable=yes
Write_enable=yes
Chroot_list_enable=no
Chroot_local_user=no
At this point, all users can switch to a different directory.
Save changes, press ESC, enter: WQ
6. Modify the shell configuration
VI Edit/etc/shells, if there is no/usr/sbin/nologin or/sbin/nologin in the file (depending on the current system configuration) is appended.
7. Start the VSFTP service and test the login
To start the VSFTP service with a command:
#service vsftpd Start
Then use the Account FTP01 test whether you can login ftp. The directory is HOME/FTP01.
Second, detailed user rights
The following effects can be achieved with chroot_list_enable and chroot_local_user=yes/no:
1, when Chroot_list_enable=yes,chroot_local_user=yes, in the/etc/vsftpd/chroot_list file listed in the user, you can switch to a different directory, not listed in the file users, You cannot switch to a different directory.
2. When Chroot_list_enable=yes,chroot_local_user=no, users listed in the/etc/vsftpd/chroot_list file cannot switch to a different directory, and users who are not listed in the file You can switch to a different directory.
3, when Chroot_list_enable=no,chroot_local_user=yes, all users can not switch to other directories.
4, when Chroot_list_enable=no,chroot_local_user=no, all users can switch to other directories.
Open FTP service under Linux