### Install ProFTPD and make install Source: http://www.proftpd.org/docs/contrib/mod_digest.html Standard build and installation steps for ProFTPD after configuring with desired modules. ```bash $ make $ make install ``` -------------------------------- ### Complete Installation Steps Source: http://www.proftpd.org/docs/contrib/mod_readme.html After configuring ProFTPD, run 'make' to compile the source code and 'make install' to install ProFTPD and its modules. ```bash $ make $ make install ``` -------------------------------- ### Install ProFTPD and mod_ifversion Source: http://www.proftpd.org/docs/contrib/mod_ifversion.html After configuring ProFTPD, use 'make' and 'make install' to build and install the server with the included modules. ```bash make make install ``` -------------------------------- ### Build and Install ProFTPD Source: http://www.proftpd.org/docs/contrib/mod_radius.html Standard commands to build and install ProFTPD after configuration. ```bash $ make $ make install ``` -------------------------------- ### Build and Install mod_rewrite Module (DSO) Source: http://www.proftpd.org/docs/contrib/mod_rewrite.html After configuring ProFTPD with DSO support, use 'make' to build the server and then 'make install' to install it. This is typically done from the ProFTPD source directory. ```bash make make install ``` -------------------------------- ### Build and Install ProFTPD Modules Source: http://www.proftpd.org/docs/contrib/mod_log_forensic.html Standard commands to build and install ProFTPD after configuring modules. ```bash $ make $ make install ``` -------------------------------- ### Install ProFTPD Executables Source: http://www.proftpd.org/docs/howto/Compiling.html After successful compilation, navigate to the ProFTPD source directory and run 'make install' to install the compiled executables. ```bash $ cd proftpd-_version_/ $ make install ``` -------------------------------- ### Example of ShaperSession Downshares and Upshares Source: http://www.proftpd.org/docs/contrib/mod_shaper.html This example demonstrates setting different share adjustments for downloads and uploads on a per-session basis. ```apache ShaperSession downshares +2 upshares -3 ``` -------------------------------- ### Configure AuthUserFile with Name and Home Restrictions Source: http://www.proftpd.org/docs/modules/mod_auth_file.html This example demonstrates how to configure AuthUserFile with restrictions on user names and home directories. User names must start with 'ftp', and home directories cannot start with '/home'. ```apache AuthUserFile /etc/ftpd/passwd name ^ftp home !^/home ``` -------------------------------- ### Install ProFTPD and mod_deflate Source: http://www.proftpd.org/docs/contrib/mod_deflate.html Standard commands to build and install ProFTPD after configuring it with mod_deflate. ```bash $ make $ make install ``` -------------------------------- ### Example init.d Script for ProFTPD Source: http://www.proftpd.org/docs/howto/Stopping.html A basic shell script to start, stop, and restart ProFTPD in standalone mode. It checks for the PID file and uses kill signals for management. ```bash #!/bin/sh # ProFTPD files FTPD_BIN=/usr/local/sbin/proftpd FTPD_CONF=/usr/local/etc/proftpd.conf PIDFILE=/var/run/proftpd.pid # If PIDFILE exists, does it point to a proftpd process? if [ -f $PIDFILE ]; then pid=`cat $PIDFILE` fi if [ ! -x $FTPD_BIN ]; then echo "$0: $FTPD_BIN: cannot execute" exit 1 fi case $1 in start) if [ -n "$pid" ]; then echo "$0: proftpd [PID $pid] already running" exit fi if [ -r $FTPD_CONF ]; then echo "Starting proftpd..." $FTPD_BIN -c $FTPD_CONF else echo "$0: cannot start proftpd -- $FTPD_CONF missing" fi ;; stop) if [ -n "$pid" ]; then echo "Stopping proftpd..." kill -TERM $pid else echo "$0: proftpd not running" exit 1 fi ;; restart) if [ -n "$pid" ]; then echo "Rehashing proftpd configuration" kill -HUP $pid else echo "$0: proftpd not running" fi ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0 ``` -------------------------------- ### Install mod_ifsession from Source Source: http://www.proftpd.org/docs/contrib/mod_ifsession.html Compile and install mod_ifsession by configuring ProFTPD with the --with-modules=mod_ifsession option, then running make and make install. ```bash $ ./configure --with-modules=mod_ifsession $ make $ make install ``` -------------------------------- ### Example mod_radius and mod_quotatab_radius Configuration Source: http://www.proftpd.org/docs/contrib/mod_radius.html An example configuration showing how to set up mod_radius and mod_quotatab_radius, including server details, logging, and static quota limits. ```apache QuotaLimitTable radius: QuotaTallyTable file:/home/tj/proftpd/devel/build/cvs/etc/ftpquota.tallytab # mod_radius attributes RadiusEngine on RadiusAuthServer localhost:1812 testing123 5 RadiusLog /var/ftpd/log/radius.log # This sets unchanging quota limit values, rather than using custom attributes # from a RADIUS server RadiusQuotaInfo false soft 3.0 2.0 1.0 7 8 9 ``` -------------------------------- ### Install mod_wrap2 Modules Source: http://www.proftpd.org/docs/contrib/mod_wrap2.html Commands to configure, build, and install mod_wrap2 with specified modules. ```bash $ ./configure --with-modules=_wrap-modules_ $ make $ make install ``` -------------------------------- ### Install mod_ctrls Module Source: http://www.proftpd.org/docs/modules/mod_ctrls.html Compile and install the `mod_ctrls` module by enabling it during the configure step, followed by make and make install. ```bash $ ./configure --enable-ctrls $ make $ make install ``` -------------------------------- ### Build and Install mod_shaper Source: http://www.proftpd.org/docs/contrib/mod_shaper.html After configuring, use these commands to build and install the mod_shaper module. ```bash $ make $ make install ``` -------------------------------- ### SITE UTIME Command Example (Format 1) Source: http://www.proftpd.org/docs/contrib/mod_site_misc.html Examples of using the SITE UTIME command with seconds specified and without. ```proftpd SITE UTIME 200402240836 file.txt SITE UTIME 20040224083655 file.txt ``` -------------------------------- ### Compile and Install ProFTPD with mod_dynmasq Source: http://www.proftpd.org/docs/contrib/mod_dynmasq.html Standard commands to compile and install ProFTPD after configuring it with the mod_dynmasq module. ```bash $ make $ make install ``` -------------------------------- ### SITE UTIME Command Example (Format 2) Source: http://www.proftpd.org/docs/contrib/mod_site_misc.html Example of using the alternative SITE UTIME syntax to set multiple timestamps. ```proftpd SITE UTIME file.txt 20040224083655 20040224083655 20040224083655 UTC ``` -------------------------------- ### ProFTPD PAM Configuration Examples Source: http://www.proftpd.org/docs/faq/faq_full.html These examples demonstrate different configurations for ProFTPD's Pluggable Authentication Modules (PAM). Ensure these directives are correctly placed within your ProFTPD configuration files. ```apache auth required /lib/security/pam_listfile.so item=user sense=allow file=/etc/ftpchroot onerr=fail ``` ```apache auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed ``` ```apache auth sufficient /lib/security/pam_ftp.so ``` ```apache auth required /lib/security/pam_unix.so ``` ```apache auth required /lib/security/pam_shells.so ``` ```apache account required /lib/security/pam_unix.so ``` ```apache password required /lib/security/pam_unix.so ``` ```apache session required /lib/security/pam_unix.so ``` -------------------------------- ### Install mod_sftp_sql Source: http://www.proftpd.org/docs/contrib/mod_sftp_sql.html Compile and install the mod_sftp_sql module along with other necessary modules. ```bash $ ./configure --with-modules=mod_sql:mod_sql_mysql:mod_sftp:mod_sftp_sql ... $ make $ make install ``` -------------------------------- ### Install mod_dynmasq as a DSO module Source: http://www.proftpd.org/docs/contrib/mod_dynmasq.html Enables dynamic shared object (DSO) support and includes mod_dynmasq for installation as a separate module. This is useful for existing ProFTPD installations. ```bash $ ./configure --enable-dso --with-shared=mod_dynmasq ``` -------------------------------- ### Install ProFTPD with mod_quotatab Source: http://www.proftpd.org/docs/contrib//mod_quotatab.html Standard installation steps for ProFTPD, including enabling the mod_quotatab module. ```bash $ ./configure --with-modules=_mod_quotatab:... $ make $ make install ``` -------------------------------- ### Example mod_tls_memcache Configuration Source: http://www.proftpd.org/docs/contrib/mod_tls_memcache.html Example configuration showing how to enable mod_memcache and then use mod_tls_memcache for TLSSessionCache and TLSStaplingCache with JSON encoding. ```apache MemcacheEngine on MemcacheServers _memcache-servers_ ... # Store the data formatted as JSON TLSSessionCache memcache:/json TLSStaplingCache memcache: ``` -------------------------------- ### Install mod_ldap Source: http://www.proftpd.org/docs/contrib/mod_ldap.html Compile and install the mod_ldap module using the provided configure script and make commands. ```bash $ ./configure --with-modules=mod_ldap $ make $ make install ``` -------------------------------- ### ProFTPD Man Page and Installation Updates This snippet covers updates to man pages and installation instructions. It includes an update to the xferlog man page and the INSTALL file, as well as general documentation updates. ```text - Bug 1216 - xferlog man page update - Bug 1111 - INSTALL update - Bug 1262 - Doc update - Bug 1217 - Doc update ``` -------------------------------- ### Red Hat Linux PAM Configuration Example Source: http://www.proftpd.org/docs/faq/linked/faq-ch7.html This is an example PAM configuration file for Red Hat Linux, specifying modules for user authentication, account management, and session handling. ```pam #%PAM-1.0 auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed auth required /lib/security/pam_pwdb.so shadow nullok account required /lib/security/pam_pwdb.so session required /lib/security/pam_pwdb.so ``` -------------------------------- ### Redis Access Lists/Sets Example Directives Source: http://www.proftpd.org/docs/contrib/mod_wrap2_redis.html Example directives demonstrating the use of Redis lists and sets for access control, assuming 'wrapallow' and 'wrapdeny' lists/sets exist. ```apache # Using Redis lists WrapTables redis:/list:wrapallow redis:/list:wrapdeny ``` ```apache # Using Redis sets WrapTables redis:/set:wrapallow redis:/set:wrapdeny ``` -------------------------------- ### Example iODBC odbc.ini Configuration Source: http://www.proftpd.org/docs/contrib/mod_sql_odbc.html An example configuration file for iODBC, specifying connection details for a MySQL data source. ```ini [ODBC Data Sources] mysql = MySQL ODBC Connector (MyODBC) [mysql] Driver = /usr/local/iodbc/lib/libmyodbc3.so Description = MySQL Driver Server = localhost Database = proftpd Port = 3306 Socket = /tmp/mysql.sock ``` -------------------------------- ### Example: hex(MD5(_data_)) Processing Source: http://www.proftpd.org/docs/contrib/mod_sql_passwd.html This example shows how a configuration with SQLAuthTypes MD5 and SQLPasswordEncoding hex results in hex(MD5(_data_)) processing. ```text SQLAuthTypes MD5 SQLPasswordEncoding hex mod_sql_passwd hex(MD5(_data_)) ``` -------------------------------- ### Example: Custom SQLGroupInfo with Named Queries Source: http://www.proftpd.org/docs/contrib/mod_sql.html Provides a concrete example of configuring SQLGroupInfo with custom named queries for various group lookup operations. ```proftpd SQLAuthenticate users groups groupsetfast SQLGroupInfo custom:/get-group-by-name/get-group-by-id/get-group-by-member/get-all-groupnames/get-all-groups SQLNamedQuery get-group-by-name SELECT "groupname, gid, members FROM ftpgroups WHERE groupname = '%{0}'" SQLNamedQuery get-group-by-id SELECT "groupname, gid, members FROM ftpgroups WHERE gid = %{0} SQLNamedQuery get-group-by-member SELECT "groupname, gid, members FROM ftpgroups WHERE (members LIKE '%%,%{0},%%' OR members LIKE '%{0},%%' OR members LIKE '%%,%{0}')" SQLNamedQuery get-all-groupnames SELECT "groupname FROM ftpgroups" SQLNamedQuery get-all-groups SELECT "groupname, gid, members FROM ftpgroups" ``` -------------------------------- ### Install mod_redis with configure options Source: http://www.proftpd.org/docs/modules/mod_redis.html Compile and install mod_redis by enabling the Redis module during ProFTPD configuration. Specify include and library paths for hiredis if necessary. ```bash $ ./configure --enable-redis ... $ make $ make install ``` ```bash $ ./configure --enable-redis \ --with-includes=_/path/to/hiredis/include_ \ --with-libraries=_/path/to/hiredis/lib_ ``` -------------------------------- ### SITE MKDIR Command Example Source: http://www.proftpd.org/docs/howto/FTP.html Use the SITE MKDIR command to create a directory, including any necessary parent directories. ```bash SITE MKDIR /path/to/some/dir/that/is/not/there/ ``` -------------------------------- ### Get ProFTPD Version Information Source: http://www.proftpd.org/docs/howto/Debugging.html Use these commands to determine the installed ProFTPD version and its compiled-in modules. This is crucial for identifying version-specific bugs. ```bash $ proftpd -V $ proftpd -vv ``` ```bash $ proftpd -l ``` -------------------------------- ### Install mod_sql_odbc with custom paths Source: http://www.proftpd.org/docs/contrib/mod_sql_odbc.html Advanced installation for mod_sql_odbc, specifying custom locations for ODBC header and library files using LDFLAGS, LIBS, and --with-includes/--with-libraries. ```bash $ ./configure \ LD_LIBRARY_PATH=/usr/local/odbc/lib \ LDFLAGS=-L/usr/local/odbc/lib \ LIBS=-lodbc \ --with-modules=mod_sql:mod_sql_odbc \ --with-includes=/usr/local/odbc/include \ --with-libraries=/usr/local/odbc/lib ``` -------------------------------- ### Configure ProFTPD for mod_ident DSO Installation Source: http://www.proftpd.org/docs/modules/mod_ident.html Example configure command to enable dynamic shared object (DSO) support and specifically build the mod_ident module as a shared library. ```bash $ ./configure --enable-dso --with-shared=mod_ident ... ``` -------------------------------- ### Script Execution Log Example Source: http://www.proftpd.org/docs/contrib/mod_exec.html An example log output showing a Python script being prepared for execution with specific arguments and its termination status. ```log preparing to execute '/tmp/ftp-logger.py' with uid 1000 (euid 1000), gid 1000 (egid 1000) + '/tmp/ftp-logger.py': argv[1] = --user + '/tmp/ftp-logger.py': argv[2] = ftp + '/tmp/ftp-logger.py': argv[3] = --file + '/tmp/ftp-logger.py': argv[4] = /home/ftp/test-ftp-demo.py + '/tmp/ftp-logger.py': argv[5] = 172.17.0.1 error: unable to open /dev/null for stdin: No such file or directory '/tmp/ftp-logger.py' terminated normally, with exit status 2 STOR ExecOnCommand '/tmp/ftp-logger.py' failed: No such file or directory ``` -------------------------------- ### Install mod_sql_odbc with iODBC Source: http://www.proftpd.org/docs/contrib/mod_sql_odbc.html Standard installation steps for ProFTPD contrib modules, specifically for mod_sql_odbc using the iODBC library. Ensure LIBS is set correctly. ```bash $ ./configure LIBS=-liodbc --with-modules=mod_sql:mod_sql_odbc \ $ make $ make install ``` -------------------------------- ### View Configure Script Help Source: http://www.proftpd.org/docs/howto/Compiling.html To see the full list of available command-line options for the `configure` script, run it with the --help flag. ```bash # ./configure --help ``` -------------------------------- ### Get Server Configuration or Directives Source: http://www.proftpd.org/docs/contrib/mod_ctrls_admin.html The 'get' action retrieves server configuration details. Use 'config' for a configuration dump or 'directives' for a list of supported directives and their modules. ```bash ftpdctl get config ``` ```bash ftpdctl get directives ``` -------------------------------- ### Configure DisplayReadme with Pattern Source: http://www.proftpd.org/docs/contrib/mod_readme.html Use the DisplayReadme directive with a pattern to notify clients of the last modified dates of multiple files. This example shows how to display all files starting with README. ```apache DisplayReadme README* ``` -------------------------------- ### SuSE Linux PAM Configuration Example Source: http://www.proftpd.org/docs/faq/linked/faq-ch7.html This is an example PAM configuration file for SuSE Linux, using pam_unix instead of pam_pwdb. It is reported to work on SuSE 6.2. ```pam /etc/pam.d/ftpd #%PAM-1.0 # Uncomment this to achieve what used to be ftpd -A. ``` -------------------------------- ### Configure ProFTPD Quotas with File and SQL Tables Source: http://www.proftpd.org/docs/howto/Quotas.html Example configuration for mod_quotatab to manage user quotas using file-based or SQL-based storage. This setup enables quota enforcement for FTP transfers. ```apache QuotaEngine on QuotaLog /var/log/ftpd/quota.log # For more information on using files for storing the limit and tally # table quota data, please see the mod_quotatab_file documentation. QuotaLimitTable file:/etc/ftpd/ftpquota.limittab QuotaTallyTable file:/etc/ftpd/ftpquota.tallytab # For more information on using a SQL database for storing the limit and # tally table quota data, please see the mod_quotatab_sql documentation SQLNamedQuery get-quota-limit SELECT "* FROM quotalimits WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery get-quota-tally SELECT "* FROM quotatallies WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" quotatallies SQLNamedQuery insert-quota-tally INSERT "%{{0}}, %{{1}}, %{{2}}, %{{3}}, %{{4}}, %{{5}}, %{{6}}, %{{7}}" quotatallies QuotaLock /var/lock/ftpd.quotatab.lock QuotaLimitTable sql:/get-quota-limit QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally ``` -------------------------------- ### Example Usermap Plain Text File Source: http://www.proftpd.org/docs/directives/configuration_full.html Defines a plain text file for mapping keys to substitution values. Each line should contain a matching key and its corresponding substitution value, separated by whitespace. Lines starting with '#' are comments. ```plaintext # -------------------------------------------- # usermap.txt -- map for rewriting user names # -------------------------------------------- Dave.Admin dave # The Uber-admin root anonymous # no one should be logging in as root anyway ``` -------------------------------- ### Enable SFTPPAMEngine and set SFTPPAMServiceName for sftp Source: http://www.proftpd.org/docs/contrib/mod_sftp_pam.html Example configuration to enable the PAM engine and set the service name to 'sftp' for mod_sftp_pam. ```apache SFTPPAMEngine on SFTPPAMServiceName sftp ``` -------------------------------- ### ProFTPD make install Target Behavior Ensures the `make install` target only installs compiled code and does not recompile. This streamlines the installation process. ```makefile # Issue 548 - `make install` target should install only, not recompile any code. # The Makefile is updated to ensure the install target performs only the installation step. ``` -------------------------------- ### addr2line Output Example Source: http://www.proftpd.org/docs/howto/Compiling.html This is an example of the output from the `addr2line` command, showing the source file and line number corresponding to a given memory address within the ProFTPD executable. ```bash $ addr2line -e /usr/local/sbin/proftpd 0x809b1e1 /home/tj/proftpd/cvs/proftpd/modules/mod_auth.c:1723 ``` -------------------------------- ### Example Site-to-Site Transfer with FXP Source: http://www.proftpd.org/docs/howto/FXP.html This example demonstrates a typical site-to-site transfer using FXP commands between two FTP servers. It shows the sequence of commands and responses involved in transferring a file and listing directory contents. ```ftp TYPE I _200 Type set to I._ TYPE I _200 Type set to I._ PASV _227 Entering Passive Mode (1,2,3,4,130,161)._ PORT 1,2,3,4,130,161 _200 PORT command successful_ STOR file.mp3 _150 Opening BINARY mode data connection for file.mp3_ RETR file.mp3 _150 Opening BINARY mode data connection for file.mp3 (15000000 bytes)_ _226 Transfer complete._ _226 Transfer complete._ Transferred: file.mp3 14.31 MB in 2.38 (6,147.06 KBps) TYPE A _200 Type set to A._ PASV _227 Entering Passive Mode (5,6,7,8,168,183)._ LIST _150 Opening ASCII mode data connection for file list_ _226 Transfer complete._ TYPE A _200 Type set to A._ PASV _227 Entering Passive Mode (1,2,3,4,130,162)._ LIST _150 Opening ASCII mode data connection for file list_ _226 Transfer complete._ Transfer queue completed Transferred 1 file totaling 14.31 MB in 3.42 (6,147.06 KBps) ``` -------------------------------- ### Simulate HOST Command with ServerAlias Source: http://www.proftpd.org/docs/modules/mod_core.html These examples show how a client would use the HOST command to connect to a virtual server configured with ServerAlias. ```ftp HOST ftp.domain.com ``` ```ftp HOST example.com ``` -------------------------------- ### Configure with Buffer Size Option Source: http://www.proftpd.org/docs/howto/Compiling.html Example of using the './configure' script with the '--enable-buffer-size' option to set buffer sizes during compilation. ```bash $ ./configure --enable-buffer-size=2048 ... ``` -------------------------------- ### Install mod_sql_passwd as a DSO Module Source: http://www.proftpd.org/docs/contrib/mod_sql_passwd.html Command to use the 'prxs' tool to compile and install mod_sql_passwd as a dynamic shared object (DSO) module into an existing ProFTPD installation. ```bash $ prxs -c -i -d mod_sql_passwd.c ``` -------------------------------- ### Configure SFTPPAMServiceName Source: http://www.proftpd.org/docs/contrib/mod_sftp_pam.html This example shows how to enable the SFTPPAMEngine and set the PAM service name to 'ftpd' for mod_sftp_pam. ```apache SFTPPAMEngine on SFTPPAMServiceName ftpd ``` -------------------------------- ### Basic CreateHome Configuration Source: http://www.proftpd.org/docs/howto/CreateHome.html Sets the permissions for the home directory itself. ```apache CreateHome on 711 uid ~ gid ~ ``` -------------------------------- ### Install mod_copy module using prxs Source: http://www.proftpd.org/docs/contrib/mod_copy.html Add the mod_copy module as a DSO to an existing ProFTPD installation using the prxs tool. This command compiles and installs the module. ```bash $ prxs -c -i -d mod_copy.c ``` -------------------------------- ### SITE SYMLINK Command Example Source: http://www.proftpd.org/docs/howto/FTP.html Use the SITE SYMLINK command to create a symbolic link. ```bash SITE SYMLINK src dest ``` -------------------------------- ### Rebuild ProFTPD After Installing New Libraries Source: http://www.proftpd.org/docs/howto/Compiling.html If you install a new library after building ProFTPD, you must re-run the configure, make, and install steps to ensure ProFTPD recognizes the new library. ```bash $ cd /path/to/proftpd/ $ make clean $ ./configure ... $ make $ make install ``` -------------------------------- ### Module Build Configuration (Static) Source: http://www.proftpd.org/docs/contrib/mod_auth_otp.html Example of how to include mod_sftp and mod_auth_otp when building ProFTPD as static modules. ```bash $ ./configure --with-modules=...:mod_sftp:mod_auth_otp:... ``` -------------------------------- ### Inspect ProFTPD Configuration File Source: http://www.proftpd.org/docs/howto/Compiling.html After configuration, the `include/options.h` file is generated. This command shows its location and details. ```bash # cd proftpd-_version_/ # ls -al include/options.h -rw-r--r-- 1 tj tj 7212 Nov 15 14:34 include/options.h ``` -------------------------------- ### Directory Listing with Permissions Source: http://www.proftpd.org/docs/faq/faq_full.html Shows a sample directory listing including permissions, owner, group, size, and modification date for directories. ```text prince> ls -l /home/ftp total 8 drwxr-xr-x 2 andrea users 4096 May 3 00:40 andrea drwxr-xr-x 2 eve users 4096 May 3 00:40 eve ``` -------------------------------- ### Configure inetd for ProFTPD Source: http://www.proftpd.org/docs/howto/ServerType.html This is an example of an /etc/inetd.conf entry for ProFTPD. Ensure the path to proftpd is correct for your system. ```bash ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/proftpd ``` -------------------------------- ### Install mod_exec Module (Standard) Source: http://www.proftpd.org/docs/contrib/mod_exec.html Compile and install the mod_exec module as part of the ProFTPD server. ```bash ./configure --with-modules=mod_exec ``` -------------------------------- ### Hosts.deny Example (Mostly Closed) Source: http://www.proftpd.org/docs/contrib/mod_wrap2_file.html This is a minimal deny file to implement a 'mostly closed' policy, denying all access by default. ```text /etc/hosts.deny: ALL: ALL ``` -------------------------------- ### Install mod_load Module Source: http://www.proftpd.org/docs/contrib/mod_load.html Compile and install the mod_load module by including it during the ProFTPD configuration process. ```bash $ ./configure --with-modules=mod_load $ make $ make install ``` -------------------------------- ### Configure with Shadow and Autoshadow Options Source: http://www.proftpd.org/docs/howto/Compiling.html Illustrates the use of '--enable-shadow' and '--enable-autoshadow' configure options for shadow password support. ```bash $ ./configure --enable-shadow --enable-autoshadow ... ``` -------------------------------- ### Start ProFTPD in FIPS Mode Source: http://www.proftpd.org/docs/contrib/mod_sftp.html To activate FIPS mode for mod_sftp, start the ProFTPD server with the -DSFTP_USE_FIPS command-line parameter. This directive must be set when starting ProFTPD, as mod_sftp initializes OpenSSL before parsing the configuration file. ```bash /path/to/proftpd -DSFTP_USE_FIPS ... ``` -------------------------------- ### Install ProFTPD with mod_tls and mod_tls_shmcache Source: http://www.proftpd.org/docs/contrib/mod_tls_shmcache.html Compile and install ProFTPD along with the mod_tls and mod_tls_shmcache modules from source. ```bash $ ./configure --with-modules=mod_tls:mod_tls_shmcache $ make $ make install ``` -------------------------------- ### Directory Listing with Permissions Source: http://www.proftpd.org/docs/faq/linked/faq-ch6.html Shows a sample directory listing using 'ls -l', highlighting the 'd' prefix for directories and their associated permissions. Useful for visualizing file system structure and access. ```bash prince> ls -l /home/ftp total 8 drwxr-xr-x 2 andrea users 4096 May 3 00:40 andrea drwxr-xr-x 2 eve users 4096 May 3 00:40 eve ``` ```bash prince> ls -l /home/ftp/andrea total 156 -rw-r--r-- 1 andrea users 85991 May 3 01:12 bland.txt -rwxr-xr-x 1 root root 65107 May 3 01:12 secret.txt ``` -------------------------------- ### File Listing with Permissions Source: http://www.proftpd.org/docs/faq/faq_full.html Displays a sample directory listing for a specific user's directory, showing file permissions, owner, group, size, and modification date. ```text prince> ls -l /home/ftp/andrea total 156 -rw-r--r-- 1 andrea users 85991 May 3 01:12 bland.txt -rwxr-xr-x 1 root root 65107 May 3 01:12 secret.txt ``` -------------------------------- ### Install mod_exec Module (DSO) Source: http://www.proftpd.org/docs/contrib/mod_exec.html Compile and install the mod_exec module as a dynamically shared object (DSO). ```bash ./configure --enable-dso --with-shared=mod_exec ``` -------------------------------- ### Configure ProFTPD with Default Settings Source: http://www.proftpd.org/docs/howto/Compiling.html Run the `configure` script without any command-line options to use the default build settings and installation paths. ```bash # cd proftpd-_version_/ # ./configure ``` -------------------------------- ### mod_geoip Module Example Configuration Source: http://www.proftpd.org/docs/contrib/mod_geoip.html Basic configuration for mod_geoip, including enabling the engine, setting a log file, and loading the GeoIP database into memory. ```apache GeoIPEngine on GeoIPLog /path/to/ftpd/geoip.log # Load GeoLite city database into memory on server startup, and use # UTF8-encoded city names GeoIPTable /path/to/GeoLiteCity.dat MemoryCache UTF8 # Add your GeoIPAllowFilter/GeoIPDenyFilter rules here ``` -------------------------------- ### Compile and Install DSO Module Source: http://www.proftpd.org/docs/utils/prxs.html Use prxs to compile a C source file into a DSO module and then install it into the ProFTPD modules directory. The -c, -i, and -d flags are used here for compile, install, and clean actions respectively. ```bash prxs -c -i -d mod_custom.c ``` -------------------------------- ### ProFTPD Header File Installation Ensures that ProFTPD header files, including `config.h`, are installed into an `include/proftpd/` directory during `make install`. This facilitates development and module integration. ```Makefile make install ``` -------------------------------- ### Conditional Configuration with Environment Variables and Source: http://www.proftpd.org/docs/howto/ConfigurationTricks.html This example illustrates a more advanced use of conditional configuration by combining environment variables, the 'Define' directive, and the directive. It allows for dynamic configuration based on environment settings. ```bash $ USE_BANS=TRUE $ export USE_BANS $ ./proftpd -DUSE_BANS=$USE_BANS ... ``` ```proftpd .. ``` ```bash $ USE_BANS=FALSE $ export USE_BANS ``` -------------------------------- ### Failed Login Forensic Log Example Source: http://www.proftpd.org/docs/contrib/mod_log_forensic.html Example log entry format for a failed login captured by mod_log_forensic. ```log ----BEGIN FAILED LOGIN FORENSICS----- Client-Address: 127.0.0.1 Server-Address: ::ffff:127.0.0.1:5376 Elapsed: 1245 Protocol: ftp User: tj UID: 501 GID: 501 Raw-Bytes-In: 46 Raw-Bytes-Out: 158 Total-Bytes-In: 0 Total-Bytes-Out: 0 Total-Files-In: 0 Total-Files-Out: 0 ... [syslog:7, PID 16044] dispatching CMD command 'PASS (hidden)' to mod_auth [syslog:7, PID 16044] retrieved UID 1000 for user 'tj' [syslog:7, PID 16044] retrieved group IDs: 1000, 0, 4, 20, 24, 46, 108, 109, 110 [syslog:7, PID 16044] retrieved group names: tj, root, adm, dialout, cdrom, plugdev, lpadmin, sambashare, admin [syslog:7, PID 16044] ROOT PRIVS at mod_auth_pam.c:312 [syslog:7, PID 16044] RELINQUISH PRIVS at mod_auth_pam.c:482 [syslog:7, PID 16044] ROOT PRIVS at mod_auth_unix.c:467 [syslog:7, PID 16044] RELINQUISH PRIVS at mod_auth_unix.c:548 [SystemLog:5] familiar proftpd[15509] localhost (localhost[127.0.0.1]): USER tj (Login failed): Incorrect password. [syslog:7, PID 16044] dispatching POST_CMD_ERR command 'PASS (hidden)' to mod_delay [syslog:7, PID 16044] dispatching LOG_CMD_ERR command 'PASS (hidden)' to mod_log -----END FAILED LOGIN FORENSICS----- ``` -------------------------------- ### Install mod_tls with specific modules Source: http://www.proftpd.org/docs/contrib/mod_tls.html Compile and install ProFTPD with the mod_tls module included. This is a standard way to enable the module. ```bash $ ./configure --with-modules=mod_tls $ make $ make install ``` -------------------------------- ### Add LDAP and SSL/TLS modules statically Source: http://www.proftpd.org/docs/howto/Compiling.html Use the --with-modules option to include specific modules as statically linked components in the build. List module names separated by colons. ```bash $ ./configure --with-modules=mod_ldap:mod_tls ... ``` -------------------------------- ### mod_wrap Compilation and Installation Source: http://www.proftpd.org/docs/contrib/mod_wrap.html Steps to compile and install the mod_wrap module for ProFTPD, including necessary libraries and configure options. ```bash * $Libraries: -lwrap -lnsl$ ``` ```bash * $Libraries: -lwrap$ ``` ```bash $ ./configure --with-modules=mod_wrap ``` ```bash $ make ``` ```bash $ make install ``` -------------------------------- ### Install mod_dynmasq during ProFTPD configuration Source: http://www.proftpd.org/docs/contrib/mod_dynmasq.html Enables the mod_dynmasq module during the ProFTPD build process. This is for new installations or full rebuilds. ```bash $ ./configure --with-modules=mod_dynmasq ``` -------------------------------- ### RADIUS Accounting Start Request Attributes Source: http://www.proftpd.org/docs/howto/Radius.html Attributes sent in an Accounting-Request packet when a login succeeds, indicating the start of a session. ```text User-Name _username_ **Acct-Status-Type 1** (_i.e._ Start) Acct-Session-Id _session-pid_ Acct-Authentic 1 (_i.e._ Local) Event-Timestamp _timestamp_ ``` -------------------------------- ### Configure ProFTPD with DSO and mod_sql_passwd Source: http://www.proftpd.org/docs/contrib/mod_sql_passwd.html Example configure command for building ProFTPD with dynamic shared object (DSO) support, including mod_sql_passwd. ```bash $ ./configure --enable-dso --enable-openssl --with-shared=mod_sql_passwd ``` -------------------------------- ### Hosts.allow Example (Mostly Closed) Source: http://www.proftpd.org/docs/contrib/mod_wrap2_file.html This allow file explicitly permits access for specific hosts, networks, and groups, complementing a 'mostly closed' policy. ```text /etc/hosts.allow: ALL: LOCAL @some_netgroup ALL: .foobar.edu EXCEPT terminalserver.foobar.edu ``` -------------------------------- ### RFC4716 Public Key Example Source: http://www.proftpd.org/docs/contrib/mod_sftp.html An example of a public key formatted according to RFC4716, including comment and FIDO-specific headers. ```text ---- BEGIN SSH2 PUBLIC KEY ---- Comment: "256-bit ECDSA-SK, converted by ... from OpenSSH" AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTYAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAA ... ---- END SSH2 PUBLIC KEY ---- ``` -------------------------------- ### Example unixODBC odbc.ini Configuration Source: http://www.proftpd.org/docs/contrib/mod_sql_odbc.html An example configuration file for unixODBC, specifying connection details for a MySQL data source. ```ini [mysql] Description = MySQL Driver = mysql Server = localhost Database = proftpd Port = 3306 Socket = /tmp/mysql.sock ``` -------------------------------- ### Example MaxClientsPerUser Configuration Source: http://www.proftpd.org/docs/modules/mod_auth.html Configures the maximum number of clients allowed per user and provides a custom message. ```apache MaxClientsPerUser 1 "Only one such user at a time." ``` -------------------------------- ### Configure List Options with Limits (ProFTPD) Source: http://www.proftpd.org/docs/howto/ListOptions.html Set default options like '-a' along with limits for the number of files and recursion depth. This example limits listings to 2000 files and a recursion depth of 3. ```apache ListOptions -a maxfiles 2000 maxdepth 3 ``` -------------------------------- ### mod_sftp_sql Error Logging Example Source: http://www.proftpd.org/docs/contrib/mod_sftp_sql.html Example log message indicating an error during base64 decoding of key data from the database. ```log mod_sftp_sql/0.4[16284]: error base64-decoding raw key data from database ``` -------------------------------- ### Untimely Death Forensic Log Example Source: http://www.proftpd.org/docs/contrib/mod_log_forensic.html Example log entry format for an untimely death event captured by mod_log_forensic. ```log ----BEGIN UNTIMELY DEATH FORENSICS----- Client-Address: 127.0.0.1 Server-Address: ::ffff:127.0.0.1:5376 Elapsed: 1245 Protocol: ftp User: tj UID: 501 GID: 501 Raw-Bytes-In: 46 Raw-Bytes-Out: 158 Total-Bytes-In: 0 Total-Bytes-Out: 0 Total-Files-In: 0 Total-Files-Out: 0 ... -----END UNTIMELY DEATH FORENSICS----- ``` -------------------------------- ### Install New ProFTPD Binary and Configuration Source: http://www.proftpd.org/docs/howto/Upgrade.html Once the new ProFTPD version is tested and configured correctly, install the new binary and update the configuration file. It's recommended to back up the old configuration before replacing it. ```bash $ make install $ cp /path/to/proftpd.conf /path/to/proftpd.conf.old $ mv /path/to/proftpd.conf.new /path/to/proftpd.conf ```