firewall服务。出于系统整体安全性增强的考虑,7.1在默认安装时没有启动老版本中大家比较熟悉的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 //********
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 配置 网络服务 服务 // xxx telnet ftp 大家 使用 其他 |
注册
个人空间
