Environment: CentOS 7
yum install
yum install -y vsftpd
increase user
# Home directory is / the WWW and set nologin useradd -d / www -s / sbin / nologin / the WWW # Change Password passwd the WWW
Configuration (/etc/vsftpd/vsftpd.conf)
anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 anon_upload_enable=NO dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES chown_uploads=YES xferlog_file=/var/log/xferlog xferlog_std_format=YES ascii_upload_enable=YES ascii_download_enable=YES chroot_local_user=YES listen=YES listen_ipv6=NO pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES allow_writeable_chroot=YES
Start Service
Start vsftpd systemctl
# Set boot
systemctl enable vsftpd
An error was encountered --1
530 Login incorrect.
solution
Edit the file /etc/pam.d/vsftpd
#%PAM-1.0S session optional pam_keyinit.so force revoke auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed # 注释这行 #auth required pam_shells.so auth include password-auth account include password-auth session required pam_loginuid.so session include password-auth
An error was encountered - 2
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
solution
Edit the file /etc/vsftpd/vsftpd.conf
# Add this line
allow_writeable_chroot = YES