FTPD.CONF(5) NetBSD File Formats Manual FTPD.CONF(5) NNAAMMEE ffttppdd..ccoonnff - tnftpd(8) configuration file DDEESSCCRRIIPPTTIIOONN The ffttppdd..ccoonnff file specifies various configuration options for tnftpd(8) that apply once a user has authenticated their connection. ffttppdd..ccoonnff consists of a series of lines, each of which may contain a con- figuration directive, a comment, or a blank line. Directives that appear later in the file override settings by previous directives. This allows `wildcard' entries to define defaults, and then have class-specific over- rides. A directive line has the format: command class [arguments] A ``\'' is the escape character; it can be used to escape the meaning of the comment character, or if it is the last character on a line, extends a configuration directive across multiple lines. A ``#'' is the comment character, and all characters from it to the end of line are ignored (unless it is escaped with the escape character). Each authenticated user is a member of a _c_l_a_s_s, which is determined by ftpusers(5). _c_l_a_s_s is used to determine which ffttppdd..ccoonnff entries apply to the user. The following special classes exist when parsing entries in ffttppdd..ccoonnff: aallll Matches any class. nnoonnee Matches no class. Each class has a type, which may be one of: GGUUEESSTT Guests (as per the ``anonymous'' and ``ftp'' logins). A chroot(2) is performed after login. CCHHRROOOOTT chroot(2)ed users (as per ftpchroot(5)). A chroot(2) is performed after login. RREEAALL Normal users. The tnftpd(8) SSTTAATT command will return the class settings for the current user as defined by ffttppdd..ccoonnff, unless the pprriivvaattee directive is set for the class. Each configuration line may be one of: aaddvveerrttiissee _c_l_a_s_s [_h_o_s_t] aaddvveerrttiizzee _c_l_a_s_s [_h_o_s_t] Set the address to advertise in the response to the PPAASSVV and LLPPSSVV commands to the address for _h_o_s_t (which may be either a host name or IP address). This may be useful in some firewall configura- tions, although many ftp clients may not work if the address being advertised is different to the address that they've connected to. If _c_l_a_s_s is ``none'' or _h_o_s_t not is specified, disable this. cchheecckkppoorrttccmmdd _c_l_a_s_s [ooffff] Check the PPOORRTT command for validity. The PPOORRTT command will fail if the IP address specified does not match the FTP command connection, or if the remote TCP port number is less than IPPORT_RESERVED. It is _s_t_r_o_n_g_l_y encouraged that this option be used, especially for sites concerned with potential security problems with FTP bounce attacks. If _c_l_a_s_s is ``none'' or ooffff is specified, disable this feature, otherwise enable it. cchhrroooott _c_l_a_s_s [ppaatthhffoorrmmaatt] If _p_a_t_h_f_o_r_m_a_t is not specified or _c_l_a_s_s is ``none'', use the default behavior (see below). Otherwise, _p_a_t_h_f_o_r_m_a_t is parsed to create a directory to create as the root directory with chroot(2) into upon login. _p_a_t_h_f_o_r_m_a_t can contain the following escape strings: EEssccaappee DDeessccrriippttiioonn %c Class name. %d Home directory of user. %u User name. %% A ``%'' character. The default root directory is: CCHHRROOOOTT The user's home directory. GGUUEESSTT If --aa _a_n_o_n_d_i_r is specified, use _a_n_o_n_d_i_r, otherwise the home directory of the `ftp' user. RREEAALL By default no chroot(2) is performed. ccllaassssttyyppee _c_l_a_s_s _t_y_p_e Set the class type of _c_l_a_s_s to _t_y_p_e (see above). ccoonnvveerrssiioonn _c_l_a_s_s _s_u_f_f_i_x [_t_y_p_e _d_i_s_a_b_l_e _c_o_m_m_a_n_d] Define an automatic in-line file conversion. If a file to retrieve ends in _s_u_f_f_i_x, and a real file (sans _s_u_f_f_i_x) exists, then the out- put of _c_o_m_m_a_n_d is returned instead of the contents of the file. _s_u_f_f_i_x The suffix to initiate the conversion. _t_y_p_e A list of valid filetypes for the conversion. Valid types are: `f' (file), and `d' (directory). _d_i_s_a_b_l_e The name of file that will prevent conversion if it exists. A file name of ``_.'' will prevent this dis- abling action (i.e., the conversion is always per- mitted.) _c_o_m_m_a_n_d The command to run for the conversion. The first word should be the full path name of the command, as execv(3) is used to execute the command. All instances of the word ``%s'' in _c_o_m_m_a_n_d are replaced with the requested file (sans _s_u_f_f_i_x). Conversion directives specified later in the file override earlier conversions with the same suffix. ddeennyyqquuiicckk _c_l_a_s_s [ooffff] Enforce ftpusers(5) rules after the UUSSEERR command is received, rather than after the PPAASSSS command is received. Whilst enabling this feature may allow information leakage about available accounts (for example, if you allow some users of a RREEAALL or CCHHRROOOOTT class but not others), it is useful in preventing a denied user (such as `root') from entering their password across an insecure connection. This option is _s_t_r_o_n_g_l_y recommended for servers which run an anony- mous-only service. If _c_l_a_s_s is ``none'' or ooffff is specified, dis- able this feature, otherwise enable it. ddiissppllaayy _c_l_a_s_s [_f_i_l_e] If _f_i_l_e is not specified or _c_l_a_s_s is ``none'', disable this. Oth- erwise, each time the user enters a new directory, check if _f_i_l_e exists, and if so, display its contents to the user. Escape sequences are supported; refer to _D_i_s_p_l_a_y _f_i_l_e _e_s_c_a_p_e _s_e_q_u_e_n_c_e_s in tnftpd(8) for more information. hhoommeeddiirr _c_l_a_s_s [ppaatthhffoorrmmaatt] If _p_a_t_h_f_o_r_m_a_t is not specified or _c_l_a_s_s is ``none'', use the default behavior (see below). Otherwise, _p_a_t_h_f_o_r_m_a_t is parsed to create a directory to change into upon login, and to use as the `home' directory of the user for tilde expansion in pathnames, etc. _p_a_t_h_f_o_r_m_a_t is parsed as per the cchhrroooott directive. The default home directory is the home directory of the user for RREEAALL users, and _/ for GGUUEESSTT and CCHHRROOOOTT users. lliimmiitt _c_l_a_s_s [_c_o_u_n_t [_f_i_l_e]] Limit the maximum number of concurrent connections for _c_l_a_s_s to _c_o_u_n_t, with `-1' meaning unlimited connections. If the limit is exceeded and _f_i_l_e is specified, display its contents to the user. If _c_l_a_s_s is ``none'' or _c_o_u_n_t is not specified, disable this. If _f_i_l_e is a relative path, it will be searched for in _/_e_t_c (which can be overridden with --cc _c_o_n_f_d_i_r). mmaaxxffiilleessiizzee _c_l_a_s_s [_s_i_z_e] Set the maximum size of an uploaded file to _s_i_z_e, with `-1' meaning unlimited connections. If _c_l_a_s_s is ``none'' or _s_i_z_e is not speci- fied, disable this. mmaaxxttiimmeeoouutt _c_l_a_s_s [_t_i_m_e] Set the maximum timeout period that a client may request, default- ing to two hours. This cannot be less than 30 seconds, or the value for ttiimmeeoouutt. If _c_l_a_s_s is ``none'' or _t_i_m_e is not specified, use the default. mmmmaappssiizzee _c_l_a_s_s [_s_i_z_e] Set the size of the sliding window to map a file using mmap(2). If zero, tnftpd(8) will use read(2) instead. The default is zero. An optional suffix may be provided as per rraatteeggeett. This option affects only binary transfers. If _c_l_a_s_s is ``none'' or _s_i_z_e is not specified, use the default. mmooddiiffyy _c_l_a_s_s [ooffff] If _c_l_a_s_s is ``none'' or ooffff is specified, disable the following commands: CCHHMMOODD, DDEELLEE, MMKKDD, RRMMDD, RRNNFFRR, and UUMMAASSKK. Otherwise, enable them. mmoottdd _c_l_a_s_s [_f_i_l_e] If _f_i_l_e is not specified or _c_l_a_s_s is ``none'', disable this. Oth- erwise, use _f_i_l_e as the message of the day file to display after login. Escape sequences are supported; refer to _D_i_s_p_l_a_y _f_i_l_e _e_s_c_a_p_e _s_e_q_u_e_n_c_e_s in tnftpd(8) for more information. If _f_i_l_e is a relative path, it will be searched for in _/_e_t_c (which can be over- ridden with --cc _c_o_n_f_d_i_r). nnoottiiffyy _c_l_a_s_s [_f_i_l_e_g_l_o_b] If _f_i_l_e_g_l_o_b is not specified or _c_l_a_s_s is ``none'', disable this. Otherwise, each time the user enters a new directory, notify the user of any files matching _f_i_l_e_g_l_o_b. ppaassssiivvee _c_l_a_s_s [ooffff] If _c_l_a_s_s is ``none'' or ooffff is specified, prevent passive (PPAASSVV, LLPPSSVV, and EEPPSSVV) connections. Otherwise, enable them. ppoorrttrraannggee _c_l_a_s_s [_m_i_n _m_a_x] Set the range of port number which will be used for the passive data port. _m_a_x must be greater than _m_i_n, and both numbers must be be between IPPORT_RESERVED (1024) and 65535. If _c_l_a_s_s is ``none'' or no arguments are specified, disable this. pprriivvaattee _c_l_a_s_s [ooffff] If _c_l_a_s_s is ``none'' or ooffff is specified, do not display class information in the output of the SSTTAATT command. Otherwise, display the information. rraatteeggeett _c_l_a_s_s [_r_a_t_e] Set the maximum get (RREETTRR) transfer rate throttle for _c_l_a_s_s to _r_a_t_e bytes per second. If _r_a_t_e is 0, the throttle is disabled. If _c_l_a_s_s is ``none'' or _r_a_t_e is not specified, disable this. An optional suffix may be provided, which changes the interpreta- tion of _r_a_t_e as follows: b Causes no modification. (Default; optional) k Kilo; multiply the argument by 1024 m Mega; multiply the argument by 1048576 g Giga; multiply the argument by 1073741824 t Tera; multiply the argument by 1099511627776 rraatteeppuutt _c_l_a_s_s [_r_a_t_e] Set the maximum put (SSTTOORR) transfer rate throttle for _c_l_a_s_s to _r_a_t_e bytes per second, which is parsed as per rraatteeggeett _r_a_t_e. If _c_l_a_s_s is ``none'' or _r_a_t_e is not specified, disable this. rreeaaddssiizzee _c_l_a_s_s [_s_i_z_e] Set the size of the read buffer to read(2) a file. The default is the file system block size. An optional suffix may be provided as per rraatteeggeett. This option affects only binary transfers. If _c_l_a_s_s is ``none'' or _s_i_z_e is not specified, use the default. ssaanneennaammeess _c_l_a_s_s [ooffff] If _c_l_a_s_s is ``none'' or ooffff is specified, allow uploaded file names to contain any characters valid for a file name. Otherwise, only permit file names which don't start with a `.' and only comprise of characters from the set ``[-+,._A-Za-z0-9]''. sseennddbbuuffssiizzee _c_l_a_s_s [_s_i_z_e] Set the size of the socket send buffer. An optional suffix may be provided as per rraatteeggeett. The default is zero and the system default value will be used. This option affects only binary trans- fers. If _c_l_a_s_s is ``none'' or _s_i_z_e is not specified, use the default. sseennddlloowwaatt _c_l_a_s_s [_s_i_z_e] Set the low water mark of socket send buffer. An optional suffix may be provided as per rraatteeggeett. The default is zero and system default value will be used. This option affects only for binary transfer. If _c_l_a_s_s is ``none'' or _s_i_z_e is not specified, use the default. tteemmppllaattee _c_l_a_s_s [_r_e_f_c_l_a_s_s] Define _r_e_f_c_l_a_s_s as the `template' for _c_l_a_s_s; any reference to _r_e_f_c_l_a_s_s in following directives will also apply to members of _c_l_a_s_s. This is useful to define a template class so that other classes which are to share common attributes can be easily defined without unnecessary duplication. There can be only one template defined at a time. If _r_e_f_c_l_a_s_s is not specified, disable the tem- plate for _c_l_a_s_s. ttiimmeeoouutt _c_l_a_s_s [_t_i_m_e] Set the inactivity timeout period. (the default is fifteen min- utes). This cannot be less than 30 seconds, or greater than the value for mmaaxxttiimmeeoouutt. If _c_l_a_s_s is ``none'' or _t_i_m_e is not speci- fied, use the default. uummaasskk _c_l_a_s_s [_u_m_a_s_k_v_a_l] Set the umask to _u_m_a_s_k_v_a_l. If _c_l_a_s_s is ``none'' or _u_m_a_s_k_v_a_l is not specified, set to the default of 027. uuppllooaadd _c_l_a_s_s [ooffff] If _c_l_a_s_s is ``none'' or ooffff is specified, disable the following commands: AAPPPPEE, SSTTOORR, and SSTTOOUU, as well as the modify commands: CCHHMMOODD, DDEELLEE, MMKKDD, RRMMDD, RRNNFFRR, and UUMMAASSKK. Otherwise, enable them. wwrriitteessiizzee _c_l_a_s_s [_s_i_z_e] Limit the number of bytes to write(2) at a time. The default is zero, which means all the data available as a result of mmap(2) or read(2) will be written at a time. An optional suffix may be pro- vided as per rraatteeggeett. This option affects only binary transfers. If _c_l_a_s_s is ``none'' or _s_i_z_e is not specified, use the default. DDEEFFAAUULLTTSS The following defaults are used: checkportcmd all classtype chroot CHROOT classtype guest GUEST classtype real REAL display none limit all -1 # unlimited connections maxtimeout all 7200 # 2 hours modify all motd all motd notify none passive all timeout all 900 # 15 minutes umask all 027 upload all modify guest off umask guest 0707 FFIILLEESS /etc/ftpd.conf This file. /usr/share/examples/ftpd/ftpd.conf A sample ffttppdd..ccoonnff file. SSEEEE AALLSSOO strsuftoll(3), ftpchroot(5), ftpusers(5), tnftpd(8) HHIISSTTOORRYY The ffttppdd..ccoonnff functionality was implemented in NetBSD 1.3 and later releases by Luke Mewburn, based on work by Simon Burge. NetBSD 1.6 February 28, 2003 NetBSD 1.6