Home >System Tutorial >LINUX >Specific method to install vsftpd on Centos7

Specific method to install vsftpd on Centos7

王林
王林forward
2024-04-10 09:07:14544browse

Centos7安装vsftpd 的具体方法

1. Install vsftpd through yum
yum install -y vsftpd
2. Modify the configuration file of vsftpd
vi /etc/vsftpd/vsftpd.conf

Modify the configuration file as follows:

1.Anonymous access is not allowed
anonymous_enable=NO
2. Allow the use of local accounts for FTP user login verification
local_enable=YES
3. Prevent users from leaving the home directory

When chroot_list_enable=YES, chroot_local_user=YES, users listed in the /etc/vsftpd.chroot_list file can switch to other directories; users not listed in the file cannot switch to other directories.

chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

Add

at the end of the configuration file
allow_writeable_chroot=YES

Otherwise an error will be reported

500 OOPS: vsftpd: refusing to run with writable root inside chroot()

If /etc/vsftpd/chroot_list does not exist, you need to create this file

vi /etc/vsftpd/chroot_list

:wq Just save and exit.

4. Set the upload and download functions to support ASCII mode.
ascii_upload_enable=YES
ascii_download_enable=YES

Finally: wq save changes and restart vsftpd

systemctl restart vsftpd.service
3. Create a new FTP user
useradd -d /var/ftp/public_root -g ftp -s /sbin/nologin ftpuser

Change the FTP user password

passwd ftpuser

The above is the detailed content of Specific method to install vsftpd on Centos7. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete