CentOS installation using FTP server-side program proftpd tutorial

Time:2020-9-26

Installation:

Installing the EPEL package

Copy code

The code is as follows:

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Yum installing proftpd

Copy code

The code is as follows:

yum install proftpd

PS: method of compiling and installing proftpd

Copy code

The code is as follows:

wget ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.proftpd.net/distrib/source/proftpd-1.3.1.tar.gz
tar xzvf proftpd-1.3.1.tar.gz
cd proftpd-1.3.1
./configure –with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql \
–with-includes=/usr/include/mysql \
–with-libraries=/usr/lib/mysql
make && make install

Set boot up

Copy code

The code is as follows:

chkconfig –level 3 proftpd on

Proftpd Management:
start-up

Copy code

The code is as follows:

proftpd:service proftpd start

stop it

Copy code

The code is as follows:

proftpd:service proftpd stop

restart

Copy code

The code is as follows:

proftpd:service proftpd restart

heavy load

Copy code

The code is as follows:

proftpd:service proftpd reload

Configuration file / etc/ proftpd.conf The syntax can be checked by the proftpd – T6 instruction.

Add FTP users and user groups

Copy code

The code is as follows:

groupadd -g 5500 ftpgroup
adduser -u 5500 -s /bin/false -d /bin/null -c “proftpd user” -g ftpgroup ftpuser

Add virtual user
First, we need to set the configuration file / etc/ proftpd.conf 。
Add the following code to the configuration file:

Copy code

The code is as follows:

AuthUserFile /etc/ftpd.passwd
AuthGroupFile /etc/ftpd.group

Turn off detection / etc / shells:

Copy code

The code is as follows:

RequireValidShell off

Set virtual user authentication only:

Copy code

The code is as follows:

AuthOrder mod_auth_file.c

Ban PAM certification:

Copy code

The code is as follows:

PersistentPasswd off
AuthPAM off

Restrict changes to the root directory:

Copy code

The code is as follows:

DefaulRoot ~

After setting the configuration file according to the above requirements, we use the ftpasswd tool to add virtual users. First, download the tool.

Copy code

The code is as follows:

cd /usr/sbin/
wget http://www.castaglia.org/proftpd/contrib/ftpasswd
chmod +x ftpasswd

The format of the ftpasswd tool is as follows:

Copy code

The code is as follows:

# ftpasswd –passwd –name {username} –file /etc/ftpd.passwd –uid {5000} –gid {5000} –home /var/ftp/username-home/ –shell /bin/false
# ftpasswd –group –name group1 –file /etc/ftpd.group –gid 5000 –member username

Recommended Today

Build HTTP service with C + + Mongoose

Mongoose source code address:https://github.com/cesanta/mo… Mongoose user manual:https://www.cesanta.com/devel… Mngoose set up HTTP service #include <string> #include “mongoose.h” using namespace std; static const char *s_http_port = “8000”; static void ev_handler(mg_connection *nc, int ev, void *ev_data) { struct http_message *hm = (struct http_message *) ev_data; if (ev == MG_EV_HTTP_REQUEST) { std::string uri; if (hm->uri.p && hm->uri.p[0] == ‘/’) […]