当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > redhat 7.1中的网络服务配置

Unix/Linux
libtcl8.3下载|无法找到libtcl8.3
libmysqlclient.so.10无法找到
Linux+Apache+PHP+MySQL+Zend Optimizer+PHPMyAdmin
glibc安装错误|glibc安装出错
Zlib是什么?|Zlib的作用是什么?|Zlib有什么作用?
什么是glibc?glibc是什么?什么是freetype?freetype是什么?什么是?Xlib是什么?什么是lo
ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
mysqld是什么意思?如何卸载mysqld?
linux 卸载 mysql
rpm 命令|rpm 安装|rpm 卸载|rpm 使用|rpm 删除
linux下tar命令rpm命令参数列表
linux rpm卸载参数
ERROR 1045: Access denied for user: root@localhost (Using password: NO)
您的服务器不支持mysql数据库
服务器不支持mysql数据库
mysql 如何添加/创建用户
/usr/bin/install: 无法创建一般文件‘/usr/local/man/man1/cjpeg.1’: 没有那个文件
png.h:329:18: zlib.h: 没有那个文件或目录
您的服务器不支持MySql数据库,无法安装论坛程序
phpMyAdmin

Unix/Linux 中的 redhat 7.1中的网络服务配置


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 66 ::
收藏到网摘: n/a

  redhat 7.1和以往的版本有一个明显的区别,就是用xinetd.conf代替原来的inetd.conf,并且直接使用了
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 //********
-A input -p udp -s 0/0 -d 0/0 2049 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 6000:6009 -y -j REJECT
-A input -p tcp -s 0/0 -d 0/0 7100 -y -j REJECT

没错,出于安全,ipchains把0-1023端口的入口全部封闭了。所以必须将它们打开。

将其中我加了//********标记的行中的REJECT修改为ACCEPT,
然后重新启动机器,一切OK.
其他的服务,如rlogin,talk等和上述配置基本相同,大家自己去摸索吧。不过,如果要更深入的了解,
可还要下一番工夫了。 :)