📄 1432.html
字号:
下面我们逐句进行讲解,并给出每条设置的含义,以便大家触类旁通,以便根据自己FTP服务器的具体情况进行合理的设置。<br>
1. 格式:loginfails [次数]<br>
功能:设定当用户登录到FTP服务器时,允许用户输错密码的次数。<br>
实例:loginfails 3:密码输入错误三次就切断连接。<br>
2. 格式:class [类名] [real/guest/anonymous] [IP地址]<br>
功能:这个指令的功能设定FTP服务器上用户的类别。并可对客户端的IP地址进行限制,允许某部分的IP地址或全部的IP地址访问。而在FTP服务器上的用户基本上可以分为以下三类:<br>
real 在该FTP服务器有合法帐号的用户;<br>
guest 有记录的匿名用户;<br>
anonymous 权限最低的匿名用户<br>
实例:class local real *:定义一个名为local的类,它包含了在任何地方登录(*代表所有IP地址)的real用户。<br>
class remote anonymous guest *:定义一个名为remote的类,它包含了在任何地方登录的anonymous用户和guest用户。<br>
3. 格式:limit [类别] [人数] [时间] [文件名]<br>
功能:这个指令的功能为设置指定的时间内指定的类别允许连接的指定人数上限。当达到人数上限的时候,显示指定文件的内容。<br>
实例:limit remote 100 Any /etc/ftpd/toomany.msg:在任何时间内,remote类的访问用户达到100人时,将不再允许无法产生新的连接,当第101位客户要连接时,连接将失败,并象用户出示文件/etc/ftpd/toomany.msg的内容。<br>
4. 格式:message [文件名称] [指令]<br>
功能:当用户执行所指定的指令时,系统将指定的文件内容显示出来。<br>
实例:message /etc/ftpd/welcome.msg login:当用户执行login命令时,也就是登录到FTP服务器上的时候,系统将显示文件/etc/ftpd/welcome.msg的内容。<br>
5. 格式:compress [yes/no] [类别]<br>
功能:设置哪一个类别的用户可以使用compress(压缩)功能。<br>
实例:compress yes local remote:允许local和remote两个类别的用户都能使用 compress(压缩)功能。<br>
6. 格式:tar [yes/no] [类别]<br>
功能:设置哪一个类别的用户可以使用tar(归档)功能。<br>
实例:tar yes local remote:允许local和remote两类的用户都能使用tar功能。<br>
7. 格式:private [yes/no]<br>
功能:设定是否支持群组对文件的取用。<br>
实例:private yes:支持群组对文件的取用。<br>
8. 格式:passwd-check [none/trivial/rfc822] [enforce/warn]<br>
功能:设定对匿名用户anonymous的密码使用方式。<br>
none 表示不做密码验证,任何密码都可以登录;<br>
trival 表示只要输入的密码中含有字符“@”就可以登录;<br>
rfc822 表示密码一定要符合RFC822中所规定的E-Mail格式才能登录;<br>
enfore 表示输入的密码不符合以上指定的格式就不让登录;<br>
warn 表示密码不符合规定时只出现警告信息,仍然能够登录。<br>
实例:passwd-check rfc822 warn:希望能够得到符合规定的E-Mail作为密码,但如果不是,也允许登录。<br>
9. 格式:log command [real/guest/anonymous]<br>
功能:设置哪些用户登录后的操作记录在文件/usr/adm/xferlog中。<br>
实例:log command real:当real用户登录后,将他的操作记录下来。由于其它用户权限较低,所以操作不会引起太大的安全隐患,所以一般只需记下real用户的操作就可以了。<br>
10. 格式:log transfers [real/guest/anonymous] [inbound/outbound]<br>
功能:设置哪些用户的上载(inbound)和下载(outbound)操作做日志。<br>
实例:log transfer anonymous guest inbound outbound:对于匿名用户要更加的关注它们的文件操作,所以无论上载、下载都进行记录。<br>
log transfer real inbound:对于合法用户则只记录他的上载记录。<br>
11. 格式:shutdown [文件名]<br>
功能:FTP服务器关闭的时间可以设置在后面所指定的文件中,当设置的时间一到,便无法登录FTP服务器了,要恢复的话只有将这个文件删掉。而这个文件必 须由指令/bin/ftpshut来生成。<br>
实例:shutdown /etc/ftpd/shut.msg<br>
12. 格式:delete [yes/no] [real/anonymous/guest]<br>
功能:设置是否允许指定用户使用delete命令删除文件。默认是允许。<br>
实例:delete no anonymous,guest:为了更好地管理FTP服务器,一般情况下,我们不允许匿名用户执行delete命令。<br>
13. 格式:overwrite [yes/no] [real/anonymous/guest]<br>
功能:设置是否允许指定用户覆盖同名文件。默认是允许。<br>
实例:overwrite no anonymous,guest:为了更好地管理FTP服务器,一般情况下,我们不允许匿名用户覆盖同名文件。<br>
14. 格式:rename [yes/no] [real/anonymous/guest]<br>
功能:设置是否允许指定用户使用rename命令来为文件改名。默认是允许。<br>
实例:delete no anonymous:为了更好地管理FTP服务器,一般情况下,我们不允许匿名用户执行rename命令改变文件名。而对有记录的匿名用户则适当的放宽,允许他们使用改名命令。<br>
15. 格式:chmod [yes/no] [real/anonymous/guest]<br>
功能:设置是否允许指定用户使用chmod命令更改文件权限。默认是允许。<br>
实例:delete no anonymous,guest:为了更好地管理FTP服务器,一般情况下,我们不允许匿名用户执行chmod命令更改文件权限。<br>
16. 格式:umask [yes/no] [real/anonymous/guest]<br>
功能:设置是否允许指定用户使用umask命令。默认是允许。<br>
实例:delete no anonymous:为了更好地管理FTP服务器,一般情况下,我们不允许匿名用户执行umask命令。<br>
17. 格式:upload [根目录] [上载目录] [yes/no] [用户] [权限] [dirs/nodirs]<br>
功能:对可以上载的目录进行更加详细的设置。<br>
实例:upload /home/ftpd * no:表示在子目录/home/ftpd下不允许上载;<br>
upload /home/ftpd /bin no:表示在子目录/home/ftpd/bin下不允许上载;<br>
upload /home/ftpd /etc no:表示在子目录/home/ftpd/etc下不允许上载;<br>
upload /home/ftpd /pub yes real 0644 dirs:允许用服务器上的合法用户在子目录/home/ftpd/pub目录下能上载权限为0644(也就是-rw-r--r--)的文件,而且在这个目录下可以新建子目录。<br>
upload /home/ftpd /incoming yes real guest anonymous 0644 dirs:允许所有的用户在子目录/home/ftpd/incoming下能上载权限为0644的文件,而且在这个目录下可以新建子目录。<br>
18. 格式:alias [目录别名] [目录名]<br>
功能:给指定目录设置一个别名,在切换目录时就可以使用较短的目录别名。<br>
实例:alias inc: /incoming:为子目录incoming设置一个别名inc:。<br>
19. 格式:email [guest的E-Mail地址]<br>
功能:只要将某些E-Mail地址设置在这个地方,那么这些用户登录到FTP服务器时,他的身份将为guest,一般权限比real低一些,比anonymous高。<br>
实例:email guest@xxx.net email guest@yyy.net:这里仅是一个示例,实际上可 以包含多个符合规范的E-Mail地址。<br>
20. 格式:deny [IP地址/域名] [说明文件]<br>
功能:这个设置可以限制哪一些IP地址或域名的用户无法登入FTP服务器。<br>
实例:deny *.com.tw /etc/ftpd/deny.msg:设置凡是域名是以“.com.tw”结束的域名,都禁止其访问。而将/etc/ftpd/deny.msg的内容显示给用户看。<br>
<br>
5. 设置/etc/ftpuser,禁止某些用户登录<br>
有时我们需要禁止一些用户使用FTP服务。其实这个设置是十分简单的,只需要将要禁止的用户帐号写入文件/etc/ftpuser中。由于从系统的安全考虑,一般我们是不希望权限过大的用户和一些与命令名相同的用户进入FTP服务器。所以在缺省的配置中,一般以下用户已经被列入了“黑名单”。<br>
<br>
root<br>
uucp<br>
news<br>
bin<br>
adm<br>
nobody<br>
lp<br>
sync<br>
shutdown<br>
halt<br>
mail<br>
<br>
6. 设置/etc/ftphosts,禁止某些来自指定机器上的登录如果你需要拒绝来自某些主机的登录,一种方法就是在/etc/ftpaccess中设置deny命令,另一种更加简单的方法就是在/etc/ftphosts中写入你要禁止的主机的IP地址或域名。<br>
7. 使新的配置生效<br>
到此为止,我们已经能够根据自己的需要对FTP服务器配置进行必要的修改和调整。而让我们重新配置后,就必须使其生效。一般的,对/etc/ftpaccess的配置是直接作用于设置后的下一次FTP服务进程。而其它的则要对inetd进程重新启动。<br>
<br>
5.4 wu-ftp相关的其他一些命令的使用<br>
5.4.1 连接数统计命令ftpcount<br>
我们可以使用ftpcount命令十分清楚地统计出当前连接到FTP服务器上的用户数目,并且同时列出上限。命令输出如下所示:<br>
<br>
Service class local 0 Users(20maximum)<br>
Service class remote 5 Users(100maximum)<br>
<br>
5.4.2 在线用户查看命令ftpwho<br>
我们可以使用ftpwho命令十分清楚地列出当前连接的用户的详细情况。<br>
5.4.2 FTP关闭文件生成命令ftpshut<br>
我们可以使用ftpshut命令生成一个在/etc/ftpaccess中设置的shut.msg文件,用于关机设定。ftpshut命令的格式为:<br>
<br>
Ftpshut <-l min> <-d min> time <说明><br>
<br>
-l 这个参数设定在关闭FTP服务器功能前多少分钟时停止用户的连接;<br>
-d 这个参数设定在关闭FTP服务器功能前多少分钟时切断用户连接;<br>
time 指定关闭FTP服务器的时间。例如6:20分则写为0620;<br>
<br>
*注:发表 by 北极星,整理 by wind521<br>
<br>
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -