Pure-ftpd installation
yum install
yum -y install pure-ftpd
Modify the configuration file
vim /etc/pure-ftpd/pure-ftpd.conf
ChrootEveryone yes BrokenClientsCompatibility no MaxClientsNumber 50 Daemonize yes MaxClientsPerIP 8 VerboseLog no DisplayDotFiles yes AnonymousOnly no NoAnonymous no SyslogFacility ftp DontResolve yes MaxIdleTime 15 PureDB /etc/pure-ftpd/pureftpd.pdb PAMAuthentication yes LimitRecursion 10000 8 AnonymousCanCreateDirs no MaxLoad 4 AntiWarez yes Umask 133:022 MinUID 1000 AllowUserFXP no AllowAnonymousFXP no ProhibitDotFilesWrite no ProhibitDotFilesRead no AutoRename no AnonymousCantUpload yes AltLog clf:/var/log/pureftpd.log PIDFile /var/run/pure-ftpd.pid MaxDiskUsage 99 CustomerProof yes
Create System User
useradd www
Changing owners owning group belongs:
chown -R www:www /data/www/wordpress
Create a user ftp
pure-pw useradd user005 -u www -d /data/www/wordpress
It appears for the user to create a new ftp password prompt:
pure-pw useradd user005 -u www -d /data/www/wordpress Password: Enter it again:
-u option to associate with the system user virtual user user005 www together, after that the use of user005 account login FTP, www identity will be read and downloaded files.
Behind the -d option to user005 account's home directory, so you can make user005 can only access their home directory / data / www / wordpress
Creating user information database file:
pure-pw mkdb
View a list of users:
pure-pw list
pure-pw list user005 /data/www/wordpress/./
Start pure-ftpd / add boot
systemctl start pure-ftpd systemctl enable pure-ftpd
Test Connection
ftp 127.0.0.1
[root@localhost pure-ftpd]# ftp 127.0.0.1 Connected to 127.0.0.1 (127.0.0.1). 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- 220-You are user number 1 of 50 allowed. 220-Local time is now 20:45. Server port: 21. 220-IPv6 connections are also welcome on this server. 220 You will be disconnected after 15 minutes of inactivity. Name (127.0.0.1:root): user005 331 User user005 OK. Password required Password: 230 OK. Current directory is / Remote system type is UNIX. Using binary mode to transfer files. ftp>
login successful
Add a new user ftp
pure-pw useradd user006 -u www -d /data/www/wordpress
pure-pw useradd user006 -u www -d /data/www/wordpress 输入密码 Password: Enter it again:
After you create a new ftp user, the user need to re-generate the database file, the new account to log on.
pure-pw mkdb
Delete account command:
pure-pw userdel user006
Modify the ftp user's password
pure-pw passwd user006 # Change Password Password: the Enter IT Again:
pure-pw mkdb # rebuild the database file
Modify the path of the user uploaded
pure-pw usermod user006 -d /data/www/web pure-pw mkdb
pure-pw show user006 # View User Information
[root@localhost ~]# pure-pw show user006 Login : user006 Password : $6$1eHOVB9O/aDbkn30$/ftGMK2dBTHlk.uqYoEYRZ6T.DKobaXjPTshLIMgpCdVbBSEBWpvOHtGxsLRRfFexiGse7tSdCiUlBl3wlPOF. UID : 1001 (www) GID : 1001 (www) Directory : /data/www/web/./ Full name : Download bandwidth : 0 Kb (unlimited) Upload bandwidth : 0 Kb (unlimited) Max files : 0 (unlimited) Max size : 0 Mb (unlimited) Ratio : 0:0 (unlimited:unlimited) Allowed local IPs : Denied local IPs : Allowed client IPs : Denied client IPs : Time restrictions : 0000-0000 (unlimited) Max sim sessions : 0 (unlimited)
Adjust pure-ftpd log file path, the default log write in / var / log / messages
~ This on demand, generally do not adjust ~
Modify /etc/rsyslog.conf
Cron.none behind this line by adding; ftp.none the ftp log information into a private, (I direct comments here, adding a new one.)
vim /etc/rsyslog.conf
... # * info;. Mail.none; authpriv.none; cron.none / var / log / messages * .info; mail.none; authpriv.none; cron.none; ftp.none / var / log / messages ftp * -. / var / log / pureftpd.log # pure-ftpd log output file ...
Note: Do not remove the / in front of the var - number , otherwise the log will record each copy in / var / log / messages and /var/log/pureftpd.log years.
Rsyslog restart to take effect
systemctl restart rsyslog.service
Modify the main port
vim /etc/pure-ftpd/pure-ftpd.conf
#Bind 127.0.0.1,21 changed to Bind 0.0.0.0,8121
Port modified to 8121
Restart pure-ftpd
systemctl restart pure-ftpd
PureFTP passive port settings
vim /etc/pure-ftpd/pure-ftpd.conf
# PassivePortRange 30000 50000 revised to 30000 50000 PassivePortRange delete the previous #