1. Update the Yum source
First, you need to update the system's Yum source, handy tool: http://help.aliyun.com/manual?spm=0.0.0.0.zJ3dBU&helpId=1692
2. Installing VSFTP
Installing vsftp with the Yum command
#yum Install Vsftpd-y
3. Add FTP Account and directory
Check the position of the nologin first, usually under/usr/sbin/nologin or/sbin/nologin.
Create an account using the following command, which specifies the home directory where/alidata/www/wwwroot is the user pwftp, and you can define your account name and directory yourself:
#useradd-D/alidata/www/wwwroot-s/sbin/nologin pwftp
Modify the account password:
#passwd pwftp
Modify permissions for the specified directory
#chown-R Pwftp.pwftp/alidata/www/wwwroot
4. 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:
Anonymous_enable=yes//Allow anonymous users to log in.
Local_enable=yes// allow local users to log in
Write_enable=yes// Turn on global upload permissions.
Chroot_local_user=yes//Restrict users to access their own root directory only
If this is yes then the Chroot_list_user will not have to worry about, this is whether to turn on the "exception of the user"
If it is on, then configure the Chroot_list_file file, the user in the file is not restricted access to other directories of users.
If the chroot_local_user=no is the opposite, this is the user who needs to be restricted.
Save changes, press ESC, enter: WQ
5. Modify the shell configuration (not necessary)
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
6. Start the VSFTP service and test the login
To start the VSFTP service with a command:
#service vsftpd Start
Then use the Account PWFTP test whether you can login ftp. The directory is/alidata/www/wwwroot.
Linux Open FTP Account