Install vsftpd under Centos 7

This article mainly introduces a concise tutorial on installing and configuring vsftp in CentOs7. Friends who need it can refer to

One, vsftp installation articles

 code show as below:

# Install vsftpd
yum -y install vsftpd
# Start
systemctl vsftpd. service start
# Start
chkconfig vsftpd on

Two, vsftp related commands service articles
code show as below:
# Start the ftp service
systemctl start vsftpd.service
# View the ftp service status
systemctl status vsftpd.service
# Restart the ftp service
systemctl restart vsftpd.service
# Close the ftp service
systemctl stop vsftpd.service


Three, vsftp configuration articles The
code is as follows:
#Enter the vsftpd configuration file
vim /etc/vsftpd/vsftpd.conf
# Forbid anonymous users anonymous login
anonymous_enable=NO
# Allow local users to log in
local_enable=YES
# Let the logged-in user have write permissions (upload, delete)
write_enable=YES
# Default umask
local_umask=022
# Save the log of the transmission record to /var/log/vsftpd.log
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=NO
# Allow ASCII mode upload
ascii_upload_enable=YES
# Allow ASCII mode download
ascii_download_enable= YES
# Use port 20 to transfer data
connect_from_port_20=YES
# Welcome banner
ftpd_banner=Welcome to use my test ftp server.
# The next three configurations are very important
# chroot_local_user is set to YES, then all users will be chrooted by default,
# that is, the user directory is restricted to their home and cannot be changed upwards.
# chroot_list_enable is set to YES, which makes the chroot user list valid.
# ★Super important: If chroot_local_user is set to YES, then chroot_list_file
# is a user who is not chrooted (you can change the directory upwards)
# ★Super important: If chroot_local_user is set to NO, then chroot_list_file
# In the set file, Is a chrooted user (cannot change the directory upwards)
chroot_list_enable=YES
# touch /etc/vsftpd/chroot_list create a new
chroot_list_file=/etc/vsftpd/chroot_list
use_localtime=YES
# run on ipv4 in standalone mode
listen=YES
# PAM authentication service name , The default here is vsftpd, this pam file has been created when vsftpd is installed,
# in /etc/pam.d/vsftpd, according to the settings in this pam file, /etc/vsftpd/ftpusers
# users in the file will be prohibited Log in to the ftp server, such as a sensitive user like root, so you have to ban other users
# When logging in, you can also add the user to /etc/vsftpd/ftpusers.
pam_service_name=vsftpd
# Restart vsftpd
systemctl restart vsftpd.service

IV. vsftp user articles
# Create user
useradd -d /home/data/www -s /sbin/nologin -M ftpuser
# Set user to folder
chown -R ftpuser/home/data/www
# Set permissions
chmod-R 777 /home/data/www
# Add password
passwd www-> password-> confirm password

5. The next step is very important. If it is not closed, FTP will not be able to upload and download things.


vim /etc/selinux/config

#SELINUX=enforcing #Comment out

#SELINUXTYPE=targeted #Comment out

SELINUX=disabled #increase

:wq! #Save and exit

setenforce 0 #Make the configuration effective immediately



Guess you like

Origin blog.csdn.net/mzjmc123/article/details/53908712