由 victor C. 在 02-12-2003 10:41 发表:
[教学] proftpd配置文件 (包含mysql认证)
贴一个我自己的配置文件, 供大家参考
注:
1<sp> = 空格
2
3
4
5
6
7#
8
9# Virtual Hosting Server Configuration
10
11# for Frontier Internet Services Limited
12
13#
14
15# ServerName "NewSight.Net FTP Server"
16
17#
18
19# Spawn from inetd?
20
21#
22
23# ServerType inetd
24
25#
26
27# or maybe a standalone server...
28
29#
30
31ServerType standalone
32
33#
34
35# don't give the server banner until _after_ authentication
36
37#
38
39DeferWelcome on
40
41#
42
43# Some basic defaults
44
45#
46
47<global>
48
49DefaultRoot ~ !root
50
51LoginPasswordPrompt on
52
53AllowOverwrite on
54
55RootLogin off
56
57#不允许 root 登陆
58
59DisplayGoAway /usr/local/etc/full.msg
60
61DisplayLogin /usr/local/etc/welcome.msg
62
63DisplayQuit /usr/local/etc/logout.msg
64
65</global>
66
67#
68
69MaxInstances 150
70
71#
72
73DefaultServer off
74
75# 如果你又多个IP, 要做每个IP绑定到每个虚拟服务器, 一定要设off
76
77# 否则, 虚拟绑定的并不会单独生效
78
79#
80
81ServerIdent off
82
83Umask 002
84
85ServerAdmin xxx@xxx
86
87#用你自己的email
88
89#
90
91User nobody
92
93Group nobody
94
95#
96
97# Performance, let's do DNS resolution when we process the logs...
98
99#
100
101UseReverseDNS off
102
103#不做反向解析
104
105#
106
107TransferLog /var/spool/syslog/proftpd/xferlog.legacy
108
109#
110
111# Some logging formats
112
113#
114
115LogFormat default "%h %l %u %t \"%r\" %s %b"
116
117LogFormat auth "%v [%P] %h %t \"%r\" %s"
118
119LogFormat write "%h %l %u %t \"%r\" %s %b"
120
121#
122
123# Turn off Ident lookups
124
125#
126
127IdentLookups off
128
129#
130
131<limit login="">
132
133DenyAll
134
135</limit>
136
137#不允许default server的登陆, 只能用虚拟服务器的设置
138
139#
140
141<virtualhost 你自己的域名="">
142
143ServerName "VIP for C.C.C & N.S.N 100k/1"
144
145TimeoutLogin 30
146
147TimeoutIdle 60
148
149TimeoutNoTransfer 60
150
151TimeoutStalled 120
152
153MaxLoginAttempts 50
154
155MaxClientsPerHost 1 "Only Allow 1 Connect Per Computer"
156
157MaxClients 50
158
159RateReadBPS 102400
160
161# 限速100k/s
162
163DefaultRoot ~ !root
164
165#除了root以为, 其他人不运行离开自己的根
166
167AllowOverwrite yes
168
169AllowStoreRestart on
170
171#可以续传
172
173Bind 1.2.3.4
174
175#你要绑定的IP
176
177Port 2011
178
179#绑定端口
180
181User nobody
182
183Group nobody
184
185AllowForeignAddress off
186
187#不允许 FXP
188
189RequireValidShell no
190
191#用mysql一定要设no
192
193SQLAuthTypes Plaintext
194
195#密码加密形式
196
197SQLAuthenticate users*
198
199SQLConnectInfo [email protected] username password
200
201#这个的格式是: 数据库名@mysql主机地址<sp>mysql用户<sp>mysql密码<sp>联接mysql有效时间
202
203#如果你的mysql服务器不是本机, 那就输入mysql主机的IP或者域名
204
205#如是本机, 就用 数据库名@localhost ....
206
207SQLDefaultGID 65534
208
209SQLDefaultUID 65534
210
211SQLMinUserGID 100
212
213SQLMinUserUID 500
214
215SQLUserInfo data username pwd NULL NULL homedir shell
216
217#这里的格式: 数据表名<sp>用户字段<sp>密码字段<sp>UID字段(没设就NULL)<sp>GID字段(没设就NULL)<sp>用户的根目录字段<sp>登陆shell字段
218
219<directory share="">
220<limit dirs="" read="">
221
222AllowAll
223
224</limit>
225
226#只允许 下载
227
228<limit cmd="" dele="" list="" write="">
229
230DenyAll
231
232</limit>
233
234#不允许 list, 删除, 写等
235
236</directory>
237</sp></sp></sp></sp></sp></sp></sp></sp></sp></virtualhost>
238
239
240
241#以上是下载的
242
243#下面是管理员的
244
245
246
247<virtualhost 你自己的域名="">
248
249ServerName "C.C.C & N.S.N Mod Port"
250
251TimeoutLogin 30
252
253TimeoutIdle 60
254
255TimeoutNoTransfer 60
256
257TimeoutStalled 120
258
259MaxLoginAttempts 10
260
261MaxC</virtualhost></sp>