CentOS 7 setup configuration proftpd Setup ftp server detailed tutorial

  • 2020-06-23 02:25:37
  • OfStack

proftpd full name: Professional FTP daemon is developed for the weaknesses of ES5en-ES6en. In addition to improved security, it also has many features that ES7en-ES8en does not have. It can run in ES9en-ES10en and xinetd modes. ProFTP has become the most popular FTP server software after ES13en-ES14en. More and more sites choose it to build secure and efficient FTP sites. ProFTP is easy to configure, and there are MySQL and Quota modules to choose from. < Extract baidu Encyclopedia >

By downloading the source code in this chapter are the way to install, can go to the website to download the latest version: http: / / www proftpd. org /

1. First, install lrzsz to copy files to the PATH of linux to build the server


yum install lrzsz

2. Upload and unzip the file

Upload the downloaded ES37en-1.3.6.tar.gz file to the specified path and use tar zxvf ES42en-1.3.6.tar.gz to unzip

3. The gcc compiler environment needs to be installed because of the source code installation


yum install gcc gcc-c++ autoconf automake

3. Configure and make installation and configuration file paths


./configure --prefix=/usr/local/proftpd --sysconfdir=/usr/local/proftpd

4, installation,


make&make install

5. Modify the configuration file to restrict anonymous users to upload and download it, but not delete it (this chapter does not describe the content of permission control in detail).


vi /usr/local/proftpd/proftpd.conf

# This is a basic ProFTPD configuration file (rename it to 
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.
ServerName           "Welcome to FTP Server"
ServerType           standalone
DefaultServer          on
# Port 21 is the standard FTP port.
Port              21
# Don't use IPv6 support by default.
UseIPv6             off
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask              022
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances          30
# Set the user and group under which the server will run.
User              nobody
Group              nobody
# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~
# Normally, we want files to be overwriteable.
AllowOverwrite     on
IdentLookups      off
UseReverseDNS      off
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
 AllowAll
</Limit>
# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous /home>
 User             ftp
 Group             ftp
 # We want clients to be able to login with "anonymous" as well as "ftp"
 UserAlias           anonymous ftp
 # Limit the maximum number of anonymous logins
 MaxClients          50
 # We want 'welcome.msg' displayed at login, and '.message' displayed
 # in each newly chdired directory.
 DisplayLogin         welcome.msg
 DisplayChdir         .message
 # Limit WRITE everywhere in the anonymous chroot
 <Limit DELE RMD>
  DenyAll
 </Limit>
</Anonymous>

6. Close the firewall


systemctl stop firewalld.service
systemctl disable firewalld.service

7. Start the server


/usr/local/proftpd/sbin/proftpd

Check to see if the process has started


[root@localhost ~]# ps -ef |grep proftpd
nobody  1140   1 0 12:13 ?    00:00:00 proftpd: (accepting connections)
root   3182 2270 0 12:50 pts/0  00:00:00 grep --color=auto proftpd 

8. Add to startup to avoid having to start manually after every reboot


vi /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
/usr/local/proftpd/sbin/proftpd

Due to in centos7 / etc/rc d/rc local permissions are reduced, so you need to add the executable permissions:


chmod +x /etc/rc.d/rc.local

conclusion


Related articles: