CentOS 7 Configuration FTP (VSFTPD)

Source: Internet
Author: User

CentOS 7 Configuration FTP (VSFTPD)

1-First switch to root user

$ su
# Enter root password

2-Create FTP folder, current location is/ftp, can be customized
# CD/
# mkdir FTP

3-Installing VSFTPD with Yum
# yum-y Install FTP vsftpd

4-View the path to the configuration file
# RPM-QC VSFTPD

5-Backing up the original configuration file
# cd/etc/vsftpd/
# CP vsftpd.conf Vsftpd.conf.backup

6-Create password plaintext file (Vftpuser for subsequent created guest account name, customizable)
# Vi/etc/vsftpd/vftpuser.txt
The contents of the file are as follows: Odd behavior user name even behavior password
TestUser
123

7-Create a password DB file based on the password plaintext
# db_load-t-T hash-f/etc/vsftpd/vftpuser.txt/etc/vsftpd/vftpuser.db

8-View Password data file
# file/etc/vsftpd/vftpuser.db

9-Create a VSFTPD Guest account, create a password
# useradd-d/ftp-s/sbin/nologin Vftpuser
# passwd Vftpuser
Enter password

10-Modify the/etc/pam.d/vsftpd file to comment out all configuration of auth and account, add the following content
# VI/ETC/PAM.D/VSFTPD
Auth Required pam_userdb.so Db=/etc/vsftpd/vftpuser
Account Required Pam_userdb.so Db=/etc/vsftpd/vftpuser

11-Modify the/etc/vsftpd/vsftpd.conf file to change the #anonymous_enable=yes to Anonymous_enable=no
(Note that there is no # after change) to add the following at the bottom
# vi/etc/vsftpd/vsftpd.conf
Virtual_use_local_privs=yes
Guest_enable=yes
Guest_username=vftpuser (Note that the account here is the Guest account name created above)
Chroot_local_user=yes
Allow_writeable_chroot=yes

12-Set VSFTPD boot
# Systemctl Enable VSFTPD

13-Restart VSFTPD service
# systemctl Restart VSFTPD

14-Configuring Firewalls and SELinux
# firewall-cmd--permanent--zone=public--add-service=ftp
# Firewall-cmd--reload
# Getsebool-a | grep FTP
# setsebool-p Ftpd_full_access on

15-View VSFTPD service status
# SYSTEMCTL Status Vsftpd.service

16-Change the FTP user to the Guest account created above
# chown vftpuser/ftp/

CentOS 7 Configuration FTP (VSFTPD)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.