I. Software Download
Proftpd-1.3.0rc3.tar.gz
Http://www.proftpd.org/
Site: http://www.proftpd.de/
Ii. decompress, compile and install
# Decompress
[Root @ localhost/] # tar zvxf proftpd-1.3.0rc3.tar.gz
[Root @ localhost/] # proftpd-1.3.0rc3 CD
# Compile and install the tool (install it in the/usr/local/ProFTPD directory and change the directory as needed)
[Root @ localhost proftpd-1.3.0rc3] #./configure -- prefix =/usr/local/ProFTPD
[Root @ localhost proftpd-1.3.0rc3] # Make
[Root @ localhost proftpd-1.3.0rc3] # make install
3. Create ftp users and related permissions (which can be configured as needed)
1. create user groups and users
[Root @ localhost/] # groupadd ftpusers # Add an ftpusers Group
[Root @ localhost/] # useradd-D/tools-G ftpusers-S/sbin/nologin softsoul
# Add a user named softsoul to the ftpusers group, set the directory to/tools, and upload the software exclusively.
[Root @ localhost/] # useradd-D/var/www/html-G ftpusers-S/sbin/nologin websoul # Add a user named websoul to the ftpusers group, directory set to/var/www/html, dedicated for Web Server
2. Create an upload directory
# If you have configured the Web server and the/var/www/html directory already exists, you only need to modify the directory permissions as follows (you can also operate on the GUI)
[Root @ localhost/] # chgrp-r ftpusers/var/www/html # change the wwwroot group to the ftpusers Group
[Root @ localhost/] # chmod-r 775/var/www/html # Set permissions. The ftpusers group has read and write permissions on the folder, other users only have read and execute permissions (do not have execution permissions; otherwise, the Web browser cannot)
[Root @ localhost/] # mkdir tools # create the tools directory under the root directory as the Software Directory
[Root @ localhost/] # chgrp-r ftpusers tools # change the ownership group of tools to the ftpusers Group
[Root @ localhost/] # chmod-r 775/tools # Set permissions
Iii. FTP Server Configuration
# If it is the same as a rookie, we recommend that you use gedit to open/usr/local/ProFTPD/etc/ProFTPd. conf on the GUI for configuration. We recommend that you back up data before configuration.
[Root @ localhost/] # vi/usr/local/ProFTPD/etc/ProFTPd. conf
# The following is the configuration of ProFTPD. conf.
# This is a basic ProFTPD configuration file (rename it
# '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 "Soul's FTP server"
Servertype Standalone
Defaultserver on
# Port 21 is the standard FTP port.
Port 21
# 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 shoshould use an inetd Server
# That allows you to limit maximum number of processes per service
# (Such as xinetd ).
Maxinstances 30 # Up to 30 ProFTPD PIDs
Maxhostsperuser 1 "sorry, you may not connect more than one time" # Each IP allows only one connection
Maxclientsperuser 1 "only one such user at a time" # each account can log on to each client at most once
Maxclientsperhost 1 "sorry, you may not connect more than one time" # only one account can be logged on to the same client
# 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 ~ Ftpuser # Restrict ftpusers group users to their own directories
# Normally, we want files to be overwriteable.
Allowoverwrite on # Whether overwrite is allowed
# Bar use of site chmod by default
<Limit site_chmod>
Denyall
</Limit>
# Only ftpusers group users can log on via FTP
<Limit login>
Denyall
Allowgroup ftpuser
</Limit>
# Set all permissions for the/var/www/html directory of the websoul account
<Directory/var/www/html>
<Limit all>
Allowuser websoul
</Limit>
</Directory>
# Set all permissions for the/tools directory of the account softsoul
<Directory/tools>
<Limit all>
Allowuser softsoul
</Limit>
</Directory>
# Limit the maximum number of Anonymous logins
Maxclients 10 # A maximum of 10 online users are allowed
# We want 'Welcome. MSG 'displayed at login, and'. message' displayed
# In each newly chdired directory.
Displaylogin welcome. MSG # When a user logs on, the welcome word information in welcome. MSG is displayed.
Displayfirstchdir. Message # When the user converts the directory, the information in. Message is displayed.
# (The above welcome information does not seem to be successful after the test, so it is depressing ,,,,,)
Serverident off # Shield server version information
Maxloginattempts 3 # maximum number of connections
Wtmplog on # Whether to record FTP in the log. If not, you can set it to off to shield log.
Timeoutidle 600 # client idel time setting. The default value is 600 seconds.
Allowretrieverestart on # resumable data transfer is allowed during download (the resumable data transfer is available by default, but not set)
Allowstorerestart on # resumable upload
# Let ProFTP support the popular fxp transmission mode, which is not supported by default.
Allowforeignaddress on
Passiveports 49152 65534 # port can also be specified as your favorite
# The following are configurations related to anonymous users. Set them as needed. Because I do not need to log on to anonymous users, all of them are out of the screen.
# A Basic anonymous configuration, no upload directories. If you do not
# Want anonymous users, simply delete this entire <anonymous> section.
# <Anonymous ~ Ftp>
# 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 10
# We want 'Welcome. MSG 'displayed at login, and'. message' displayed
# In each newly chdired directory.
# Displaylogin welcome. msg
# Displayfirstchdir. Message
# Limit write everywhere in the anonymous chroot
# <Limit write>
# Denyall
# </Limit>
# </Anonymous>
4. Run ProFTPD automatically upon startup
# If you need to set ProFTPD to automatically start when the system starts, run the following command to copy the Startup file:
# Cp./contrib/Dist/RPM/ProFTPd. init. d/etc/rc. d/init. d/ProFTPD
# Modify the executable attributes of the script:
[Root @ localhost/] # chmod + x/etc/rc. d/init. d/ProFTPD
* ********* Some articles on the Internet contain the following content, you can refer ****************************
Then edit/etc/rc. d/init. d/functions:
Modify
Export Path = "/sbin:/usr/sbin:/bin:/usr/x11r6/bin"
Is
Export Path = "/sbin:/usr/sbin:/bin:/usr/x11r6/bin:/usr/local/sbin"
Note: If you use the -- prefix option when running the./cofigure command to specify to install ProFTPD in the/usr/sbin directory, you do not need to modify the fuctions file.
**************************************** ***********************************
==== This section is the content I modified based on my actual situation. Select either of them from the above section. Let's give it a try ====
Edit/etc/rc. d/init. d/ProFTPD
Modify
Path = "$ path:/usr/local/sbin"
Is
Path = "$ path:/usr/local/ProFTPD/sbin"
========================================================== ========================================================== ======
# Run the following command:
[Root @ localhost/] # chkconfig -- level 35 ProFTPD on
# Then, after the next system is started, ProFTPD will automatically start.
# Run the following command to start ProFTPD:
[Root @ ftpd/] #/etc/rc. d/init. d/ProFTPD start
In this case, run the following command to test whether ProFTPD runs properly:
[Root @ homeserver USR] # ftp 192.168.1.20
Connected to 192.168.1.20.
220 192.168.1.20 FTP Server Ready
500 auth not understood
500 auth not understood
Kerberos_v4 rejected as an authentication type
Name (192.168.1.20: Phoebus): softsoul
331 Password required for softsoul.
Password:
230 user softsoul logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
Ftp>