Centos build Ftp server

1, check whether the installed vsftpd
vsftpd -version

2, install vsftpd
yum -y install vsftpd

3, New Ftp directory
mkdir / usr / local / localftp

4, create a new user and specify login to access folders (ftpname that you are going to build username, you can play yourself a)
useradd -d / usr / local / localftp -s / bin / bash ftpname

5, add a password for the new user
passwd ftpname

6, add the user groups
groupadd ftpgroup

7, change folder access rights
-R & lt ftpname chown: ftpgroup / usr / local / localftp 

. 8, the firewall services add ftp
firewall-cmd --permanent --zone=public --add-service=ftp
--reload-cmd Firewall 

. 9, modify the configuration file
vim /etc/vsftpd/vsftpd.conf

content
# Remove the front Notes 
chroot_local_user = YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
ascii_upload_enable=YES ascii_download_enable=YES 

#文件末尾添加
allow_writeable_chroot=YES

/ Etc / vsftpd / chroot_list this file does not exist, it is necessary to manually create! ! !

   Save and restart vsftpd

systemctl restart vsftpd.service 

Note:
1. If you do not see the list of files, turn off SELinux

Solution: Turn off SELinux

View SELinux status: / usr / sbin / sestatus -v # If SELinux status parameter is enabled is the open state

Method One: temporary closure (not reboot)

setenforce 0 # Set SELinux become permissive mode
#setenforce 1 becomes enforcing mode setting SELinux

 

Method two: modify the configuration files need to restart the machine

Modify / etc / selinux / config file

The SELINUX = enforcing changed SELINUX = disabled

You can restart the machine

 

2, xftp reported abnormal connection "can not display the remote folder"

 

 √ remove the reconnection



Guess you like

Origin www.cnblogs.com/niuniu0108/p/12416723.html