upload /home/ftp/* /bin no (require only if you are not using the “--enable-ls” option)
upload /home/ftp/* /lib no (require only if you are not using the “--enable-ls” option)
noretrieve命令
最好禁止某些用户从“/home/ftp”目录下的某些子目录中下载文件,可以用“noretrieve”命令在“/etc/ftpaccess”文件中设置。
noretrieve /home/ftp/etc
noretrieve /home/ftp/dev
noretrieve /home/ftp/bin (require only if you are not using the “--enable-ls” option)
noretrieve /home/ftp/lib (require only if you are not using the “--enable-ls” option)
“.notar”文件
无论是否允许即时的目录打包(on-the-fly tar),都必须保证用户不能打包(tar)禁止上载的目录。在“/home/ftp”目录的每个子目录中都创建“.notar”文件。
[root@deep]# touch /home/ftp/.notar
[root@deep]# chmod 0 /home/ftp/.notar
[root@deep]# touch /home/ftp/etc/.notar
[root@deep]# chmod 0 /home/ftp/etc/.notar
[root@deep]# touch /home/ftp/dev/.notar
[root@deep]# chmod 0 /home/ftp/dev/.notar
[root@deep]# touch /home/ftp/bin/.notar (require only if you are not using the “--enable-ls” option)
[root@deep]# chmod 0 /home/ftp/bin/.notar (require only if you are not using the “--enable-ls” option)
[root@deep]# touch /home/ftp/lib/.notar (require only if you are not using the “--enable-ls” option)
[root@deep]# chmod 0 /home/ftp/lib/.notar (require only if you are not using the “--enable-ls” option)
这些长度为0的“.notar”文件会使一些浏览器和ftp代理(proxy)出现混乱,要解决这个问题必须把它们标识为禁止下载。在“/etc/ftpaccess”文件中加入这一行:
noretrieve .notar
安装到系统中的文件
> /etc/ftphosts
> /etc/ftpusers
> /etc/ftpaccess
> /etc/pam.d/ftp
> /etc/ftpconversions
> /etc/ftpgroups
> /etc/logrotate.d/ftpd
> /usr/bin/ftpcount
> /usr/bin/ftpwho
> /usr/man/man1/ftpcount.1
> /usr/man/man1/ftpwho.1
> /usr/man/man5/ftpaccess.5
> /usr/man/man5/ftphosts.5
> /usr/man/man5/ftpconversions.5
> /usr/man/man5/xferlog.5
> /usr/man/man8/ftpd.8
> /usr/man/man8/ftpshut.8
> /usr/man/man8/ftprestart.8
> /usr/sbin/in.ftpd
> /usr/sbin/ftpshut
> /usr/sbin/ckconfig
> /usr/sbin/ftprestart
> /usr/sbin/xferstats
> /usr/sbin/wu.ftpd
> /usr/sbin/in.wuftpd
> /var/log/xferlog'
liujiankk 编辑于 2002-04-05 21:14
liujiankk
[级别]浮云版主
发帖: 5355
积分: 146
于2002-04-05 21:17
--------------------------------------------------------------------------------
7.2在默认安装时没有启动老版本中大家比较熟悉的ftp,
telnet等服务,并且由于ipchains的严格限制,给许多用户的配置带来了麻烦。
来源:linux.softhouse.com.cn
Redhat 7.2和以往的版本有一个明显的区别,就是用xinetd.conf代替原来的inetd.conf,并且直接使用了
firewall服务。出于系统整体安全性增强的考虑,7.2在默认安装时没有启动老版本中大家比较熟悉的ftp,
telnet等服务,并且由于ipchains的严格限制,给许多用户的配置带来了麻烦。
为了方便大家的配置和使用,我在这里将我摸索的配置过程介绍给大家。
xinetd(eXtended InterNET services daemon)对inetd功能进行了扩展,有关它的背景和其他内容在这里就
不多讲了,有兴趣的可以去www.xinetd.org或其他相关网站查询,我具体说一下如何使你的网络服务转起来。
xinetd的默认配置文件是/etc/xinetd.conf,它看起来尽管和老版本的/etc/inetd.conf完全不同,其实只是
以一个脚本的形式将inetd中每一行指定的服务扩展为一个/etc/xinetd.d/下的配置文件。其格式为:
service service-name
{
Socket_type = xxx; //TCP/IP socket type,such as stream,dgram,raw,....
protocol = xxx; //服务使用的协议
Server = xxx; //服务daemon的完整路径
Server_args = xxx; //服务的参数
Port = xxx; //指定服务的端口号
Wait = xxx; //是否阻塞服务,即单线程或多线程
User = xxx; //服务进程的uid
Group = xxx; //gid
REUSE = xxx; //可重用标志
Disabled = yes/no; //是否禁用
......
}
我们以ftp和telnet为例,说明配置过程。
在/etc/xinetd.d目录下,编辑ftp和telnet
ftp如下:
service proftpd
{
disable = no
port = 21
socket_type = stream
protocol = tcp
user = root
server = /usr/local/sbin/in.proftpd
wait = no
}
telnet如下:
Service telnetd
{
disable = no
port = 23
Socket_type=stream
protocol=tcp
wait=tcp
user=root
server=/usr/sbin/in.telnetd
}
然后,重新启动服务
#/etc/rc.d/init.d/xinetd restart 或:#killall -HUP xinetd
这时候,telnet localhost和ftp localhost都应该没有问题了。
但是,从局域网内的其他机器仍然可能使用不了ftp和telnet服务。原来还有一个地方需要设置,
就是ipchains,它具有firewall和路由的功能。
#vi /etc/sysconfig/ipchains,大家发现什么了?
# Firewall configuration written by lokkit
# Manual customization of this file is not recommended.
# Note: ifup-post will punch the current nameservers through the
# firewall; such entries will *not* be listed here.
:input ACCEPT
:forward ACCEPT
:output ACCEPT
-A input -s 0/0 -d 0/0 -i lo -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 0:1023 -y -j REJECT //********
-A input -p tcp -s 0/0 -d 0/0 2049 -y -j REJECT
-A input -p udp -s 0/0 -d 0/0 0:1023 -j REJECT //********