test ftp
yum install -y lftp
lftp testuser1@127.0.0.1
lftp testuser2@127.0.0.1
Execute the command ls to see if the output is normal
If it is not normal, check the logs cat /var/log/messages and cat /var/log/secure
Install the filezilla client software under windows for testing
(cat -E /etc/vsftpd/vsftpd_login plus -E can check whether there are spaces and whether it is the last line)
(/etc/init.d/vsftpd restart)
If you want xshell to have ftp similar functions
1. Change the new session protocol to: SFTP
2.ctrl alt F → install xftp
after installation
systemctl stop vsftpd
! natstat
ctrl alt F
Use pure-ftpd to build ftp service
//yum source does not include pure-ftpd, you need to install epel extension source
yum install -y epel-release
yum install -y pure-ftpd
vim /etc/pure-ftpd/pure-ftpd.conf//Find the line pureftpd.pdb and delete the # at the beginning of the line
systemctl stop vsftpd //To avoid port conflicts, close vsftpd first
systemctl start pure-ftpd //Start pure-ftpd
mkdir /data/ftp //Create an account test directory. What pure-ftpd uses is not the system account of LINUX, but the virtual account.
useradd -u 1010 pure-ftp
chown -R pure-ftp:pure-ftp /data/ftp
pure-pw useradd ftp_usera -u pure-ftp -d /data/ftp
//-u associates the virtual user ftp_user1 with the system user pure-ftp, that is to say, after using the ftp_user1 account to log in to ftp, it will read or download files as pure-ftp. The directory after -d is the home directory of the ftp_user1 account, so that ftp_user1 can only access its home directory /data/ftp. It has not been completed yet, and the most critical step is to create a user information database file:
pure-pw mkdb //Create user information database file
touch /data/ftp/nan.txt
The test is as follows:
[root@localhost ~]# lftp ftp_usera@127.0.0.1
Password:
lftp ftp_usera@127.0.0.1:~> ls
drwxr-xr-x 2 1010 pure-ftp 21 Jan 8 13:22 .
drwxr-xr-x 2 1010 pure-ftp 21 Jan 8 13:22 ..
-rw-r--r-- 1 0 0 0 Jan 8 13:22 nan.txt
lftp [email protected]:/> put /etc/fstab
501 bytes transferred
lftp [email protected]:/> ls
drwxr-xr-x 2 1010 pure-ftp 34 Jan 8 13:25 .
drwxr-xr-x 2 1010 pure-ftp 34 Jan 8 13:25 ..
-rw-r--r-- 1 1010 pure-ftp 501 Nov 5 18:55 fstab
-rw-r--r-- 1 0 0 0 Jan 8 13:22 nan.txt
pure-pw list/userdel/usermod/passwd