Install an instance of a proFTPD installation

zhaozj2021-02-16  51

Install an instance of a proFTPD http://www.chinaUnix.net

purpose:

Install a proftpd to achieve the following requirements 1 Do not allow anonymous access. 2 Open an account, only the upload permission is available at the UPLOAD directory, can be resumed, can not be renamed and deleted.

Operation: 0 Switch to the root account [CODE: 1: DE92F96787] su root // Enter the root password. [/ Code: 1: de92f96787] 1 Download PrOFTPD Address: www.proftpd.org. Here we downloaded 1.2.9 version [Code: 1: de92f96787] wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.2.9.tar.gz [/ code: 1: de92f96787] 2 Install Proftpd Switch to the download directory, assume it / tmp / proFTPD, then [CODE: 1: DE92F96787] TAR ZXVF PrOFTPD-1.2.9.tar.gz // Decompression CD ProftPD-1.2.9 ./configure --PREFIX = / VAR / Proftpd --sysconfdir = / etc // Settings Installation Directory / VAR / PrOFTPD, Profile Directory / etc Make Make Install [/ Code: 1: DE92F96787] 3 New FTP private account is the special account mentioned above, here Take Skate / Skate (U / P) as an example. [Code: 1: de92f96787] groupadd skate usradd skate -g skate -d / var / ftp -s / sbin / nologin // set / var / ftp directory to FTP directory passwd skate // set Skate user password MKDIR / VAR / ftp / upload chown skate.skate / var / ftp / upload // set upload directory SKATE users can write [/ code: 1: de92f96787] 4 Set the profile of PrOFTPD Proftpd, is /etc/proftpd.conf [CODE : 1: de92f96787] vi /etc/proftpd.conf // Open PrOFTPD.CONF [/ code: 1: de92f96787] [code: 1: de92f96787] #### Specific configuration as follows ##### servername "test ftp Server ... "Servertype Standalone DefaultServer On) Port 21 Umask 022 # Maximum Thread MaxInstances 30 User Skate Group Skate

#DNS Reflection Usereverseedns Off Identlookups Off # Maximum Try Connection MaxLoginatTemPTS 3 # Each user thread MaxClientSperHost 2 # Maximum user MaxClients 20

Dirfakeuser on skate Dirfakegroup on skate deferwelcome on # log file location systemlog /var/log/proftpd.log serverident off

# Limit the Skate group of Skate users to log in to other directories (only in his home directory) DEFAULTROOT ~ SKATE, SKATE # Set only allowed 192.168.0 User Login # #Order, Deny # Allow from 192.168.0. # Deny from all #

# Setting only Skate users to log in, otherwise the system user can also log in to FTP # #order allow, deny #denyuser! Skate #

# 开 全 全 权 权 写 ALOWOVERWRITE ON AllowStorerestart ON # Allow fxp # allowForeignaddress on Allowall

# Set Skate User Limit # de De De De De De De De De De De De De De De De De De Direction > ##### End ###### [/ code: 1: de92f96787]

Press ESC after editing, then enter: x Save.

5 Start service Edit a startup script (this is from the online copy, not what I wrote, thank you for writing this script, very good, THX) [code: 1: de92f96787] vi /etc/rc.d/init .d / proFTPD [/ code: 1: de92f96787] ##### Script content start ####### #! / bin / sh # # Startup script forproftpd # # chkconfig : 345 85 15 # description: ProFTPD is an enhanced FTP server with / # a focus toward simplicity, security, and ease of configuration / # It features a very Apache-like configuration syntax, / # and a highly customizable server infrastructure, /. # including support for multiple 'virtual' FTP servers, / # anonymous FTP, and permission-based directory visibility # processname:. proftpd # config: /etc/proftpd.conf # # By: Osman Elliyasa # $ ID: PrOFTPD.INIT.D, V 1.7 2002/12/07 21:50:27 jwm eXP $

# Source Function Library.. /Etc/rc.d/init.d/functions

IF [-f / etc / sysconfig / proFTPD]; Then. / etc / sysconfig / proFTPD Fi # below this line sets environment variables, pay attention to setting up your proFTPD installation directory PATH = "$ PATH: / usr / local / sbin : / var / proFTPD / bin: / var / proftpd / sbin

# See "$ 1" in Start) Echo -n "Starting Protepd:" Daemon Proftpd $ Options Echo touch / var / limited / subs "Shutting Down Proftpd:" KillProc PrOFTPD ECHO RM -F / VAR / LOCK / SUBSYS / PrOFTPD ;; Status) Status Proftpd ;; Restart $ 0 STOP $ 0 Start ;; READ) Echo -n "Re-Reading Protepd Config:" KillProc Protepd-Hup Echo ;; suspend ) Hash ftpshut> / dev / null 2> & 1 IF [$? = 0]; Then IF [$ # -gt 1]; Then Shift echo -n "suspending with '$ *'" ftpshut $ * Else Echo -n "Suspending Now" FTPSHUT NOW "MAINTANANCE IN Progress" FI ELSE Echo -n "No Way To Suspend" Fi Echo ;; Resume) IF [-f / etc / shutmsg]; the echo -n "allowing sessions again "RM -F / ETC / SHUTMSG ELSE Echo -n" Was Not Suspended "Fi Echo ;;

*) Echo -n "USAGE: $ 0 {start | stop | restart | status | rad | resume" Hash ftpshutiff = = 1]; the echo '}' Else Echo '| suspend}' echo 'Suspend Accepts Additional Arguments Which are passed to ftpshut (8) 'Fi EXIT 1 ESACIF [$ # -gt 1]; Then Shift $ 0 $ * fi

EXIT 0 ####### The script ends ######## [/ code: 1: DE92F96787] Press ESC to enter: x Save.

Then add to the system service and start [CODE: 1: DE92F96787] ChkConfig --Add Profptd Service Proftpd Start [/ Code: 1: DE92F96787] You can use Service ProtePD Restart to recover ProftPD.

6 little experience to see Proftpd documentation translated by: Finally, a Special Command IS Allowed Which Can Be Used to Control Login Access: login connection or login to

The Server. Applying a to this pseudo-command can be used to allow or deny initial connection or login to the content. It has no

Effect, And is Ignored, WHEN USED IN A Context Other Than Server Config, Or (i.e. Using It in A Context

Is meaningless.

Translation: Finally, there is a special command to limit the landing, is login. In , you can prohibit or allow connections. However, if not in Server Config,

Or use it in , he will lose its utility, or it is ignored (for example, it is invalid in ).

PROFTPD feels better than the VSFTP functionality, mainly mastering segment basically applied, there is no problem. PrOFTPD document address http://www.proftpd.org/docs/. [/ code]

转载请注明原文地址:https://www.9cbs.com/read-18855.html

New Post(0)