1 | <sect2>
|
---|
2 | <title>Configuring <application>ProFTPD</application></title>
|
---|
3 |
|
---|
4 | <sect3><title>Config files</title>
|
---|
5 |
|
---|
6 | <para><filename>/etc/proftpd.conf</filename></para>
|
---|
7 | <para>This is a simple, download-only sample configuration. See the ProFTPD
|
---|
8 | documentation in <filename class="directory">/usr/share/doc/proftpd</filename>
|
---|
9 | and consult the website at <ulink url="http://www.proftpd.net/"/>
|
---|
10 | for example configurations.</para>
|
---|
11 |
|
---|
12 | <para><screen><userinput><command>cat > /etc/proftpd.conf << "EOF"</command>
|
---|
13 | # This is a basic ProFTPD configuration file
|
---|
14 | # It establishes a single server and a single anonymous login.
|
---|
15 |
|
---|
16 | ServerName "ProFTPD Default Installation"
|
---|
17 | ServerType standalone
|
---|
18 | DefaultServer on
|
---|
19 |
|
---|
20 | # Port 21 is the standard FTP port.
|
---|
21 | Port 21
|
---|
22 | # Umask 022 is a good standard umask to prevent new dirs and files
|
---|
23 | # from being group and world writable.
|
---|
24 | Umask 022
|
---|
25 |
|
---|
26 | # To prevent DoS attacks, set the maximum number of child processes
|
---|
27 | # to 30. If you need to allow more than 30 concurrent connections
|
---|
28 | # at once, simply increase this value. Note that this ONLY works
|
---|
29 | # in standalone mode, in inetd mode you should use an inetd server
|
---|
30 | # that allows you to limit maximum number of processes per service
|
---|
31 | # (such as xinetd)
|
---|
32 | MaxInstances 30
|
---|
33 |
|
---|
34 | # Set the user and group that the server normally runs at.
|
---|
35 | User proftpd
|
---|
36 | Group proftpd
|
---|
37 |
|
---|
38 | # Normally, we want files to be overwriteable.
|
---|
39 | <Directory /*>
|
---|
40 | AllowOverwrite on
|
---|
41 | </Directory>
|
---|
42 |
|
---|
43 | # A basic anonymous configuration, no upload directories.
|
---|
44 | <Anonymous ~proftpd>
|
---|
45 | User proftpd
|
---|
46 | Group proftpd
|
---|
47 | # We want clients to be able to login with "anonymous" as well as "proftpd"
|
---|
48 | UserAlias anonymous proftpd
|
---|
49 |
|
---|
50 | # Limit the maximum number of anonymous logins
|
---|
51 | MaxClients 10
|
---|
52 |
|
---|
53 | # We want 'welcome.msg' displayed at login, and '.message' displayed
|
---|
54 | # in each newly chdired directory.
|
---|
55 | DisplayLogin welcome.msg
|
---|
56 | DisplayFirstChdir .message
|
---|
57 |
|
---|
58 | # Limit WRITE everywhere in the anonymous chroot
|
---|
59 | <Limit WRITE>
|
---|
60 | DenyAll
|
---|
61 | </Limit>
|
---|
62 | </Anonymous>
|
---|
63 | <command>EOF</command></userinput></screen></para></sect3>
|
---|
64 |
|
---|
65 |
|
---|
66 | <sect3><title>proftpd init.d script</title>
|
---|
67 |
|
---|
68 | <para><screen><userinput><command>cat > /etc/rc.d/init.d/proftp << "EOF"</command>
|
---|
69 | #!/bin/sh
|
---|
70 | # Begin $rc_base/init.d/proftp
|
---|
71 |
|
---|
72 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
73 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
74 |
|
---|
75 | source /etc/sysconfig/rc
|
---|
76 | source $rc_functions
|
---|
77 |
|
---|
78 | case "$1" in
|
---|
79 | start)
|
---|
80 | echo "Starting FTP Server..."
|
---|
81 | loadproc /usr/sbin/proftpd
|
---|
82 | ;;
|
---|
83 |
|
---|
84 | stop)
|
---|
85 | echo "Stopping FTP Server..."
|
---|
86 | killproc /usr/sbin/proftpd
|
---|
87 | ;;
|
---|
88 |
|
---|
89 | reload)
|
---|
90 | echo "Reloading FTP Server..."
|
---|
91 | reloadproc /usr/sbin/proftpd
|
---|
92 | ;;
|
---|
93 |
|
---|
94 | restart)
|
---|
95 | $0 stop
|
---|
96 | sleep 1
|
---|
97 | $0 start
|
---|
98 | ;;
|
---|
99 |
|
---|
100 | status)
|
---|
101 | statusproc /usr/sbin/proftpd
|
---|
102 | ;;
|
---|
103 |
|
---|
104 | *)
|
---|
105 | echo "Usage: $0 {start|stop|reload|restart|status}"
|
---|
106 | exit 1
|
---|
107 | ;;
|
---|
108 | esac
|
---|
109 |
|
---|
110 | # End $rc_base/init.d/proftp
|
---|
111 | <command>EOF
|
---|
112 | chmod 755 /etc/rc.d/init.d/proftp</command></userinput></screen></para>
|
---|
113 |
|
---|
114 | <para>Create the symbolic links to this file in the relevant <filename
|
---|
115 | class="directory">rc.d</filename> directories with the following commands:
|
---|
116 | <screen><userinput><command>cd /etc/rc.d/init.d &&
|
---|
117 | ln -sf ../init.d/proftp ../rc0.d/K50proftp &&
|
---|
118 | ln -sf ../init.d/proftp ../rc1.d/K50proftp &&
|
---|
119 | ln -sf ../init.d/proftp ../rc2.d/K50proftp &&
|
---|
120 | ln -sf ../init.d/proftp ../rc3.d/S50proftp &&
|
---|
121 | ln -sf ../init.d/proftp ../rc4.d/S50proftp &&
|
---|
122 | ln -sf ../init.d/proftp ../rc5.d/S50proftp &&
|
---|
123 | ln -sf ../init.d/proftp ../rc6.d/K50proftp</command></userinput></screen></para>
|
---|
124 |
|
---|
125 | </sect3>
|
---|
126 |
|
---|
127 | </sect2>
|
---|
128 |
|
---|