xref: /netbsd/share/examples/ftpd/ftpd.conf (revision 1bfa7f6f)
1*1bfa7f6fSlukem#	$NetBSD: ftpd.conf,v 1.4 2000/01/09 13:19:19 lukem Exp $
2b003c63dSlukem#
3b003c63dSlukem# example /etc/ftpd.conf
4b003c63dSlukem
5b003c63dSlukem# Check PORT command for validity; prevents denial of service attempt.
6b003c63dSlukem#
7e5a5f7dcSlukemcheckportcmd	all
8b003c63dSlukem
9*1bfa7f6fSlukem# Use `guest' as a template for `localguest'; any following `guest' entries
10*1bfa7f6fSlukem# will be used for `localguest' too.
11*1bfa7f6fSlukem#
12*1bfa7f6fSlukemtemplate	localguest	guest
13*1bfa7f6fSlukem
14b003c63dSlukem# For anonymous connections, when a directory is entered show the contents
15b003c63dSlukem# of `.message' if it exists, and notify about any files that start
16b003c63dSlukem# with `README'.
17b003c63dSlukem#
18b003c63dSlukemdisplay		guest	.message
19b003c63dSlukemnotify		guest	README*
20b003c63dSlukem
21e5a5f7dcSlukem# Prevent uploads & modification commands for anonymous connections
22e5a5f7dcSlukem#
23e5a5f7dcSlukemupload		guest	off
24e5a5f7dcSlukem
25e5a5f7dcSlukem# Limit transfers for users in `slowmo' class to 5 KB/s
26e5a5f7dcSlukem#
27e5a5f7dcSlukemrateget		slowmo	5k
28e5a5f7dcSlukemrateput		slowmo	5k
29e5a5f7dcSlukem
30*1bfa7f6fSlukem# Limit the number of simultaneous `guest' class connections to 50,
31*1bfa7f6fSlukem# and display /etc/ftptoomany when this limit is reached.
32*1bfa7f6fSlukem# As `localguest' uses the `guest' settings via the template above, override
33*1bfa7f6fSlukem# this specifically for `localguest' entries to unlimited.
34fb456363Slukem#
35*1bfa7f6fSlukemlimit		guest		50	ftptoomany
36*1bfa7f6fSlukemlimit		localguest	-1
37fb456363Slukem
38b003c63dSlukem# Support automatic conversions.
39*1bfa7f6fSlukem# The first entry supports compression of files, and there's no suppression
40*1bfa7f6fSlukem# character. `%s' is replaced by the filename.
41*1bfa7f6fSlukem# The next two entries support tar-ing and tar+gzip of files and directories,
42*1bfa7f6fSlukem# unless `.notar' exists in the current directory.
43*1bfa7f6fSlukem# The `--' in the command strings should prevent a filename with a leading
44*1bfa7f6fSlukem# `-' being interpreted as an argument to gzip/tar.
45*1bfa7f6fSlukem# For anonymous connections, ~ftp/usr/bin should be a symlink to ~ftp/bin,
46*1bfa7f6fSlukem# and gzip and tar should exist in the latter directory as statically
47*1bfa7f6fSlukem# linked executables, to avoid the effort of setting up shared libraries
48*1bfa7f6fSlukem# correctly under ~ftp.
49b003c63dSlukem#
50e5a5f7dcSlukemconversion	all	.gz	f	.	/usr/bin/gzip -c -- %s
51e5a5f7dcSlukemconversion	all	.tar	df	.notar	/usr/bin/tar -cf - -- %s
52e5a5f7dcSlukemconversion	all	.tar.gz	df	.notar	/usr/bin/tar -zcf - -- %s
53