1. Install vsftpd
yum -y install vsftpd
2. Edit the vsftpd configuration file
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf-bakecho ‘‘ > /etc/vsftpd/vsftpd.confvi /etc/vsftpd/vsftpd.conf
Add the following content:
Listen = Yes
Background = Yes
Anonymous_enable = No
Local_enable = Yes
Write_enable = Yes
Local_umask = 022
Anon_upload_enable = No
Anon_mkdir_write_enable = No
Dirmessage_enable = Yes
Xferlog_enable = Yes
Connect_from_port_20 = Yes
Chown_uploads = No
Xferlog_file =/var/log/vsftpd. Log
Xferlog_std_format = Yes
Async_abor_enable = Yes
Ascii_upload_enable = Yes
Ascii_download_enable = Yes
Ftpd_banner = welcome to hao32 FTP servers
Pam_service_name = vsftpd
Chroot_local_user = No
Chroot_list_enable = Yes
Chroot_list_file =/etc/vsftpd. chroot_list
Run the following command
touch /etc/vsftpd/vsftpd.chroot_listservice vsftpd start
If the following sentence appears:
Starting vsftpd For vsftpd: [OK]
Indicates the operation is successful.
3. Add a user
useradd ftpuser -d /home/ftp -s /sbin/nologin
passwd ftpuser
echo ‘ftpuser‘ >> /etc/vsftpd/vsftpd.chroot_list
service vsftpd restart