no>
设置socket的TCP SO_KEEPALIVE参数。这样在必要的时候可以断开网络连接。“yes”有效,“no”无效。最好设成“yes”:
Keepalive yes
[page]
配置“/etc/ftphosts”文件
“/etc/ftphosts”文件为每一个用户建立规则,指定允许用户从某个主机登录ftp服务器,或者不允许用户从某个主机登录ftp服务器。
创建“ftphosts”文件(touch /etc/ftphosts),加入下面这几行:
# Example host access file
#
# Everything after a ‘#‘ is treated as comment,
# empty lines are ignored
allow ftpadmin 208.164.186.1 208.164.186.2 208.164.186.4
把文件的权限改为600:
[root@deep]# chmod 600 /etc/ftphosts
每一行可能是:
allow <username> <addrglob>
或
deny <username> <addrglob>
“allow”允许用户用<username>用户名,从<addrglob>地址访问ftp服务器。<addrglob>可以包含多个地址。
“deny”禁止用户名为<username>的用户,从<addrglob>地址访问ftp服务器。<addrglob>可以包含多个地址。
配置“/etc/ftpusers”文件
“/etc/ftpusers”文件设置哪些用户不允许连接到ftp服务器。
创建“ftpusers”文件(touch /etc/ftpusers),加入下面这几行:
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
把文件的权限设成600:
[root@deep]# chmod 600 /etc/ftpusers
配置“/etc/ftpconversions”文件
“/etc/ftpconversions”是用来控制当传输文件的时候是否进行压缩。
创建“ftpconversions”文件(touch /etc/ftpconversions),在文件中加入:
:.Z: : :/bin/compress -d -c %s:T_REG
关键词:用Linux架设FTP服务器(下)