ftp-proxy.conf(5)

okay bestie, this is ftp-proxy.conf(5) from Proxy-Suite β€” the manual page for the config file of ftp-proxy(8). It's giving config-file main character energy. πŸ’–

✨ NAME ✨

ftp-proxy.conf β€” configuration file for FTP-Proxy.

πŸŽ€ SYNOPSIS πŸŽ€

/etc/proxy-suite/ftp-proxy.conf

🌸 DESCRIPTION 🌸

This manual page documents the configuration file format of the ftp-proxy(8) program. FTP-Proxy is an application level gateway between FTP clients and servers. Its main purpose is to secure servers against attacks based on the FTP protocol.

The FTP-Proxy configuration file consists of option lines and comments. A line starting with a '#' character is a comment. The general format of a option line is:

[WhiteSpace] Name WhiteSpace Value [WhiteSpace]

It is recommended to use up to 24 characters for the name and no more than 1024 for the value, although theoretically both can be up to 4096 in size. Lines can be continued if the last character is a backslash. The whole file is not case sensitive.

πŸ¦‹ CONTEXT πŸ¦‹

Option lines always have a context which may be global or user specific. A context is introduced by a [name] line, where name is the FTP-login name or authuser if the UserAuthMagic feature is used. It is allowed to use '*' wildcard character at the end of the context name [name*] i.e. [foo*] to match multiple usernames beginning with "foo". The beginning of the file is implicitly the [-Global-] context (the dashes allow a user context named [global] without conflict). It is legal to include an option more than once; the last one will be the one used. Options in user contexts usually take precedence over the equivalent global option.

Some of the options can be used in a user or the global context, while others make sense only in one of them. See below.

🌈 VARIABLE SUBSTITUTION 🌈

Several options (see the individual discussion below for details) support a limited set of variable substitution when evaluated. The following replacements will be performed:

  • %b β€” build date of the ftp-proxy(8) program
  • %d β€” current system date in the form YYYY/MM/DD
  • %h β€” host name from gethostname(2)
  • %n β€” network name from getdomainname(2)
  • %t β€” current system time in the form HH:MM:SS
  • %v β€” version of the ftp-proxy(8) program
  • %% β€” a single percent sign

πŸ‘‘ OPTIONS πŸ‘‘

Okay so here's the big list, bestie. One bullet per option, no skips, fr fr. πŸ’…

  • ActiveMaxDataPort β€” Both user and global context. Defines the maximum local port number used when connecting to the client's data port. The latter is either the same as the client's control port or the one given in the most recent PORT command. If either minimum or maximum value is not given, the program defaults to using port 20, the ftp-data port as per RFC 959, for the local end of the socket if the proxy is running as root (user ID 0) or to use a random port. See also ActiveMinDataPort and User options.
  • ActiveMinDataPort β€” Both user and global context. Defines the minimum local port number used when connecting to the client's data port. See also ActiveMaxDataPort and User options.
  • AllowMagicUser β€” Global context only. Defines a flag that when set to yes, true, or on allows the USER name to be optionally interpreted as user[@host[:port]] where host overrides the DestinationAddress and port the DestinationPort directive below. It should only be activated with "trusted" users, like in an outgoing FTP proxy scenario. See also the UserMagicChar and ForceMagicUser options.
  • AllowTransProxy β€” Global context only. Defines a flag that when set to yes, true, or on allows one to use the proxy as transparent proxy for outgoing ftp. To get it working you also have to redirect client requests on a gateway or firewall host (i.e. via ipchains) to the ftp-proxy. It should only be activated with "trusted" users, like in an outgoing FTP proxy scenario. You can combine this with the AllowMagicUser option.
  • DenyMessage β€” Global context only. Defines the name of a file which prevents any successful login if it exists, even if it is empty. The file contents will be sent to the client, each line prefixed with '421-' and with variable substitution applied. The whole file is followed by a line starting with '421 ' followed by the DenyString below. After sending the connection is closed. If no such file exists, the deny mechanism is not triggered altogether. See also DenyString option.
  • DenyString β€” Global context only. Defines a string that will be displayed to clients, prefixed with '421 ' and variable substitution applied, if and only if a DenyMessage file exists. The default is 'Service not available'. See also DenyMessage option.
  • DestinationAddress β€” Both user and global context. Defines where to redirect incoming FTP traffic. Can be given as either dotted decimal IP address or as DNS host name. Please note that the global section must always contain this option as a basic sanity check.
  • DestinationMaxPort β€” Both user and global context. Defines the maximum local port number to be used when opening a connection to the FTP server. Valid both for control and for data connections. Defaults to not binding prior to connecting and listening, so that the system selects an arbitrary ephemeral port. See also DestinationMinPort option.
  • DestinationMinPort β€” Both user and global context. Defines the minimum local port number to be used when opening a connection to the FTP server. See also DestinationMaxPort option.
  • DestinationPort β€” Both user and global context. Defines the FTP server's control port where the proxy itself will connect. This option can either be given as a numeric value or as the service name retrieved by getservbyname(3) and defaults to port 21, the ftp port as per RFC 959.
  • DestinationTransferMode β€” Both user and global context. Defines the FTP transfer mode to be used from the proxy to the server. Legal values are active, passive, or client. The latter means to follow the mode the client is using. The default value is client.
  • FailResetsPasv β€” Global context only. Defines the action that is taken when a data transfer command is failed on the server side. If the option is set to yes, true, or on the client data transfer socket will be closed and the transfer mode set to the default (active-ftp). If this flag is set to no, false, or off (which is also the default) the socket can be reused for the next data transfer command in passive mode. This options is a workaround for Netscape (4.x) clients, that sends a second data transfer command if the first is failed, while the user clicks on a symbolic link pointing to a directory. Note, that this behavior may break the RFC definitions.
  • ForceMagicUser β€” Global context only. Same as AllowMagicUser, but makes the host and port portion mandatory.
  • ForkLimit β€” Global context only. Limits the number of incoming client connections per minute in daemon mode - it defaults to 40 connections per minute.
  • Group β€” Global context only. Defines the UNIX style group ID which is set by the process before it serves clients. Default is to keep the current real group ID.
  • LDAPAuthDN β€” Global context only. Defines a different base distinguished name that is used when accessing an LDAP directory for user authentication purposes. It defaults to the value of LDAPBaseDN. See also LDAPAuthPWAttr, LDAPAuthPWType, LDAPAuthOKFlag, UserAuthType, LDAPBindDN options.
  • LDAPAuthOKFlag β€” Global context only. Defines an attribute and its value as attr=value string, i.e. userEnabled=yes, that will be checked while user authentication in the directory tree specified using LDAPAuthDN or LDAPBaseDN. Defaults to an empty string - no flag check used.
  • LDAPAuthPWAttr β€” Global context only. Defines the LDAP password attribute name used for user authentication. A common used attribute name is userPassword. Defaults to an empty string - password authentication disabled. See also LDAPAuthPWType option.
  • LDAPAuthPWType β€” Global context only. Defines the LDAP password type / format and a minimal allowed password length expected as value for attribute name specified using LDAPAuthPWAttr.

Valid values are plain, crypt, {crypt} followed by one number 0-9, i.e. {crypt}7, plain9 or plain.

If no minimum length specified the default minimum length of 5 characters is used.

A password type {crypt} means, the password value in the LDAP directory is prefixed by the {crypt} scheme specification. Other password schemes, i.e. MD5, are not supported at the moment. Crypted passwords are only available, if the proxy is compiled with crypt support - see also --with-crypt compile time option in configure script.

If the password (without scheme prefix) stored in LDAP directory is * or ! the account is disabled and the authentication fails.

Defaults to plain (equivalent to plain5). See also the LDAPAuthOKFlag.

  • LDAPBaseDN β€” Global context only. Defines the base distinguished name that is used when accessing an LDAP directory, i.e. the root of the tree containing the FTP-Proxy entries. Defaults to an empty string. If UserAuthMagic is used, the authuser is used as user name for authentication and user profiles, otherwise the normal ftp-user name. See also LDAPIdentifier, LDAPObjectClass, LDAPServer, UserAuthMagic options.
  • LDAPBindDN β€” Defines the distinguished name that is used to (simple) bind the directory service. Defaults to an empty string (anonymous bind). It is allowed to include one %s in this string, that will be replaced with the FTP username or authuser if UserAuthMagic is used. See also UserAuthMagic, LDAPAuthDN, LDAPBindPW options.
  • LDAPBindPW β€” Defines the credential (password) that is used to (simple) bind the directory service using distinguished name given in the LDAPBindDN option. Defaults to an empty string (anonymous bind).
  • LDAPIdentifier β€” Global context only. This is the identification attribute for getting into the LDAP directory, aka the primary key of the whole lookup vibe πŸ’… It defaults to the string CN, which is short for "Common Name." See also LDAPBaseDN, LDAPObjectClass, LDAPServer 🫢
  • LDAPObjectClass β€” Global context only. Sets the LDAP object class that holds the entries for FTP-Proxy's access control. The tea here is that all the possible user-specific config options are assumed to live as attributes inside a record of this type ✨ There's no default, but FTPProxyUser is the recommended value, fr fr. See also LDAPBaseDN, LDAPIdentifier, LDAPServer πŸ’–
  • LDAPServer β€” Global context only. This is THE main option if you're pulling user-specific values out of an LDAP directory πŸ‘‘ If you set it, it names the server (and maybe a port, separated by a colon) where FTP-Proxy will go ask for the attributes. The program will bind as the anonymous user and try to retrieve the values from the tree rooted at LDAPBaseDN, having an object class of LDAPObjectClass and identified by the LDAPIdentifier 🌈 If the server can't be reached, the program aborts β€” like, no server, no service, periodt. If the user can't be found, the program falls back to the configuration file, but only queries the global values and not the user-specific ones πŸ™ˆ See also LDAPBaseDN, LDAPBindDN, LDAPIdentifier, LDAPObjectClass πŸŽ€
  • LDAPVersion β€” Global context only. Sets the LDAP API version the proxy should use: 2 or 3. Use 0 to skip explicit version setting and just let the library defaults do their thing ✨ Default is version 3 if the library supports it, or 2 if not.
Note, bestie: the OpenLDAP 2.x library defaults to version 2 bind, but the OpenLDAP server refuses LDAPv2 bind by default 😭 iykyk.
  • Listen β€” Global context only. Defines the address where the proxy itself opens the listening port 🌸 The default is 0.0.0.0, which tells the server to bind to any address. See also the Port option πŸ’œ
  • LogDestination β€” Global context only. Where the logging info the program wants to emit goes πŸ“ Three whole ways to do this, and it depends on how the value starts:
    • If the value starts with a slash (/) it's interpreted as an absolute path. This file gets created and kept open for the entire lifetime of the process 🫢 The signal SIGUSR1 can be sent to the (daemon) process to rotate this log file β€” iconic little trick, no cap πŸ”₯
    • Second way is via a pipe, used when the first character of the option is a pipe symbol (|) 🧚 In that case the rest of the value is interpreted as the name of a UNIX command, which is invoked and receives the logging information on its standard input.
    • Third way is the syslog(3) service, which is assumed for all other values ✨ The option value gets interpreted as the syslog facility, while the severity is defined by the various messages themselves.
  • LogLevel β€” Global context only. Sets the maximal level of logged messages. The levels are, in order of decreasing importance:

FLT, ERR, WRN, INF, DBG

The default level is INF ⭐ So if you set LogLevel to WRN, only messages with levels FLT, ERR, and WRN will be logged. Less noise, more main character energy πŸ’…

  • MaxClients β€” Global context only. The maximum number of clients the proxy will allow concurrently πŸŽ€ Valid range for this option is 1 to 512, with a default of 64. See also MaxClientsMessage, MaxClientsString 🌸
  • MaxClientsMessage β€” Global context only. Names a file that gets shown to clients if their maximum number (as defined with MaxClients) has been exceeded πŸ™ˆ If no such file exists, only the MaxClientsString is displayed; otherwise both the file and the string are transmitted. After transmission the connection is terminated in any case β€” no exceptions πŸ’€ When sending the file, each line is prefixed with '421-' and variable substitution is applied to it. See also MaxClients, MaxClientsString πŸ¦‹
  • MaxClientsString β€” Global context only. A string that gets displayed to clients, prefixed with '421 ' and with variable substitution applied, if the maximum client number has been exceeded ✨ The default is 'Service not available'. See also MaxClients, MaxClientsMessage πŸ’–
  • MaxRecvBufSize β€” Global context only. The maximum number of bytes read from the socket at once while data transfers πŸ“ Default is to read all data as reported by the kernel.

It may be useful to set a limit (i.e. to 8192) if your proxy machine uses two interfaces of different speed β€” i.e. the clients are accessing the proxy via a high-speed interface (i.e. Fast-Ethernet) and the proxy is accessing servers using a slower one (i.e. modem, ISDN link) β€” and your ftp-clients abort the data transfers because of a timeout 😭

  • PassiveMaxDataPort β€” Both user and global context. The maximum local port number used when listening for the client's data connection πŸ‘‘ This is the port number transmitted to the client in a 227 response to the PASV command. If either the minimum or maximum value isn't given, the program defaults to letting the system choose an arbitrary ephemeral port 🌈 See also the PassiveMinDataPort option.
  • PassiveMinDataPort β€” Both user and global context. The minimum local port number used when listening for the client's data connection πŸŽ€ See also the PassiveMaxDataPort option πŸ’œ
  • PidFile β€” Global context only. The name of a process ID file where FTP-Proxy will store its process ID if running as a daemon ✨ The file contents will be an ASCII string with a trailing newline. On many operating systems such PID files live in the /var/run directory 🫢
  • Port β€” Global context only. The listening port where FTP-Proxy offers its service 🌸 The port can be given as a number or as a string suitable for retrieval by the getservbyname(3) function. It defaults to port 21, the ftp port as per RFC 959 πŸ“š See also the Listen option.
  • PortResetsPasv β€” Global context only. Sets the action taken when a PORT command is received while a passive port is open for listening πŸ€” If the option is set to yes, true, or on (which is also the default), the socket will be closed and the passive mode will be terminated (set to active-ftp). Setting the option to no, false, or off does not cancel the listen. This flag seems necessary because the RFC is not really clear enough about the correct handling πŸ™ˆ
  • SameAddress β€” Both user and global context. A boolean that determines if the proxy is allowed to be included in so-called third party server-to-server transfers πŸ‘€ In this situation the client first sends a PASV command to one server, then a PORT command with the response code to the second server, and then initiates the transfer with mutual transfer commands on the two servers. Specifying this option as no, false, or off allows FTP-Proxy to take part in such a transfer, while saying yes, true, or on (the default) will enforce that transfers can only take place to/from the client itself πŸ’…
  • ServerRoot β€” The directory into which FTP-Proxy performs a chroot(2) in order to increase its security level πŸ”’ See also the User and Group options.
Note, bestie, that you have to copy needed libraries, configuration files, etc. into this directory first! Not me forgetting that and wondering why everything breaks 😭
  • ServerType β€” Global context only. The mode in which FTP-Proxy runs if no command line switch (-d/-i) has been provided 🌈 The value can be either:
    • inetd β€” the proxy expects the client to be available at standard input and output.
    • standalone β€” the process will become a daemon, open the listening port, and fork child processes for all future connections ✨ The child processes themselves will behave exactly as if they were started from inetd πŸŽ€
  • SockBindRand β€” Global context only. A flag that, when set to yes, true, or on, causes the proxy to use a random port in the specified range via DestinationMinPort/MaxPort, ActiveMinPort/MaxDataPort, PassiveMinDataPort/MaxDataPort instead of incrementing the port number inside of this range 🎲 See also DestinationMinPort, DestinationMaxPort, PassiveMinDataPort, PassiveMaxDataPort, ActiveMinPort, ActiveMaxPort options πŸ¦‹
  • TCPWrapper β€” Global context only. A boolean that is evaluated by FTP-Proxy running as a standalone daemon only πŸ’… Saying yes, true, or on activates the TCP Wrapper library, whereas no, false, or off (the default) disables the function. See also the TCPWrapperName option 🌸
  • TCPWrapperName β€” Global context only. Use the given name for TCP-Wrapper checks instead of the program name (argv[0]) ✨ See also the TCPWrapper option πŸ’–
  • TimeOut β€” Both user and global context. The time in seconds after which a client is assumed to be disconnected ⏰ If no activity is detected from the client after this time, the connection is closed and the process terminates. Default value is 900 seconds πŸ’œ
  • TranslatedAddress β€” Global context only. An IP address the server will use in 227 replies to PASV commands instead of its own address πŸ‘‘ Usually the address where the client connected to is taken, but this may not be appropriate in situations where an NAT (Network Address Translation) device is sitting in the way from the client to the proxy 😩 In this situation the response can be changed to include the input address of the NAT device 🌈

The value for this option can be given as a DNS host name, as a dotted decimal IP address, or as a file name πŸ“ The latter is assumed when the name starts with a slash. The file is opened and scanned for the desired address. Blank lines or lines starting with '#' are ignored. Reading the address from a file may be useful for environments with masquerading and dynamic PPP connections πŸŽ€

  • User β€” Global context only. Defines the UNIX style user ID which is given to the process before it serves clients. Default is to keep the current real user ID.

If the proxy does not run as a privileged user (root, user ID 0), it has no permission to bind a socket to port < 1024 or to preform a chroot(2) call. See also ActiveMinDataPort, ActiveMaxDataPort, ServerRoot options.

  • UserMagicChar or UseMagicChar β€” Global context only. Defines the character to use as separator between user and host[:port] in the target setting of AllowMagicUser. Default is the '@' character. This allows you to use E-Mail addresses as usernames for login to the ftp server (i.e. me@mydomain%ftp.server:21 if you set it to %).
  • UserAuthMagic β€” Global context only. This is an authentication extension like AllowMagicUser, allowing encoding of additional username and password in the USER and PASS commands for authentication. Valid values are @auth for ftpuser@authuser[@host:port] and ftppass@authpass or auth@ for authuser@[ftpuser@host:port] and authpass@ftppass. See also LDAPBindDN, LDAPAuthType and AllowMagicUser.
  • UserAuthType β€” Global context only. Defines the authentication mechanism the proxy should use. Currently "ldap" is implemented to support simple LDAP authentication using FTP username and password from USER and PASS commands or the special authuser and authpass encoded using UserAuthMagic. See also LDAPBindDN, LDAPAuthDN, LDAPAuthPWAttr, LDAPAuthPWType, LDAPAuthOKFlag and UserAuthMagic options.
  • UserNameRule β€” Global context only. Defines a regular expression rule for validation of the user name (used for profile-setup and authentication purposes). Defaults to: ^[[:alnum:]]+([%20@/\._-][[:alnum:]]+)*$

It checks, if the first character is alphanumeric, optionally followed by @/_-. or alphanumeric characters and ending with an alphanumeric one.

This matches the usual cases inclusive E-Mail addresses and "domain/user" names.

If regex support is not available, above default rule is still used and the option ignored. See also ValidCommands option for regex encoding description.

  • ValidCommands β€” Both user and global context. Defines the list of allowed FTP commands for the client. If this option is not installed, there will be no restriction on the allowed commands. But if it is given, then all commands not on this list will be denied. The list is space separated and may consist of the following commands: USER, PASS, ACCT, CWD, CDUP, SMNT, QUIT, REIN, PORT, PASV, TYPE, STRU, MODE, RETR, STOR, STOU, APPE, ALLO, REST, RNFR, RNTO, ABOR, DELE, RMD, MKD, PWD, LIST, NLST, SITE, SYST, STAT, HELP, NOOP, SIZE, MDTM, MLFL, MAIL, MSND, MSOM, MSAM, MRSQ, MRCP, XCWD, XMKD, XRMD, XPWD, XCUP, AUTH, APSV, EPRT, and EPSV.

Each command can be followed by an optional equals sign and POSIX 1003.2 Extended Regular Expression (RE) that describes the valid argument(s) for the command. If the whole string is to be matched, the pattern has to start with a caret (^) and end with a dollar ($). If no pattern follows a command, its arguments are not checked. An example for a name would be the pattern '^[a-zA-Z0-9]{1,512}$' for an argument that is mandatory and may consist of up to 512 letters or digits only. A command that does not allow any arguments can also easily be represented: 'QUIT=^$'.

Please note that the regular expression is "pre-processed". This means that a pattern in the form %xx will be interpreted as a hexadecimal constant and will be replaced by the value of that constant. This looks a bit like HTML and helps to include characters that might not be handled as expected, like %20 for space or %5c (equivalent to %5C) for backslash. The space is especially important because it is the separator for the commands within the list itself.

Please note also that regular expression support must have been enabled with the --with-regex switch during the configure compilation step of the whole package.

  • WelcomeMessage β€” Global context only. Defines the name of a file that will be displayed to all clients as the first action when they open the control connection. Each line is prefixed with '220-' and variable substitution is applied to it. If no such file exists it is silently ignored. See also WelcomeString option.
  • WelcomeString β€” Global context only. Defines the string that is sent to the client in order to start login negotiation. The string is prefixed with '220 ' and variable substitution is applied to it. If this option is not given it defaults to the following string: '%h FTP server (%v - %b) ready'. See also WelcomeMessage option.

✨ FILES ✨

  • /etc/proxy-suite/ftp-proxy.conf
  • /usr/sbin/ftp-proxy

πŸ‘€ SEE ALSO πŸ‘€

  • ftp-proxy(8)
  • The SuSE Proxy-Suite documentation included in the doc subdirectory of the package.

πŸ‘‘ AUTHORS πŸ‘‘

  • Jens-Gero Boehm <jens-gero.boehm@suse.de>
  • Pieter Hollants <pieter.hollants@suse.de>
  • Volker Wiegand <volker.wiegand@suse.de>
  • Marius Tomaschewski <mt@suse.de>

The SuSE Proxy-Suite is released under the GNU General Public License (GPL).


That's the whole vibe, bestie. This iconic page comes from SuSE, dated September 20th, 1999, and it's the manual for ftp-proxy.conf(5). Periodt. πŸ’…βœ¨