在centos5上启动RFC 868 time server

默认下,centos5系统没有安装xinetd服务,需要安装
 
ls /etc/xinetd.d/
cvs  eklogin  ekrb5-telnet  gssftp  klogin  krb5-telnet  kshell  rsync
 
安装xinetd
yum install xinetd
 
ls /etc/xinetd.d/
chargen-dgram   daytime-dgram   discard-stream  eklogin       klogin       rsync          time-stream  chargen-stream  daytime-stream  echo-dgram      ekrb5-telnet  krb5-telnet  tcpmux-server   cvs             discard-dgram   echo-stream     gssftp        kshell       time-dgram
 
默认地,time-dgram和 time-stream是关闭的,需要打开。
[root@TRIXBOX1 xinetd.d]# vim time-dgram
# This is the configuration for the udp/dgram time service.
service time
{
# This is for quick on or off of the service
        disable         = no
# The next attributes are mandatory for all services
        id              = time-dgram
        type            = INTERNAL
        wait            = yes
        socket_type     = dgram
#       protocol        =  socket type is usually enough
# External services must fill out the following
#       user            =
#       group           =
#       server          =
#       server_args     =
# External services not listed in /etc/services must fill out the next one
#       port            =
# RPC based services must fill out these
#       rpc_version     =
#       rpc_number      =
# Logging options
#       log_type        =
#       log_on_success  =
#       log_on_failure  =
# Networking options
#       flags           =
#       bind            =
#       redirect        =
#       v6only          =
# Access restrictions
#       only_from       =
#       no_access       =
#       access_times    =
#       cps             = 50 10
#       instances       = UNLIMITED
#       per_source      = UNLIMITED
#       max_load        = 0
#       deny_time       = 120
#       mdns            = yes
"time-dgram" 67L, 1148C 已写入                                                                                   
 
[root@TRIXBOX1 xinetd.d]# vim time-stream
# This is the configuration for the tcp/stream time service.
service time
{
# This is for quick on or off of the service
        disable         = no
# The next attributes are mandatory for all services
        id              = time-stream
        type            = INTERNAL
        wait            = no
        socket_type     = stream
#       protocol        =  socket type is usually enough
# External services must fill out the following
#       user            =
#       group           =
#       server          =
# This is the configuration for the tcp/stream time service.
service time
{
# This is for quick on or off of the service
        disable         = no
# The next attributes are mandatory for all services
        id              = time-stream
        type            = INTERNAL
        wait            = no
        socket_type     = stream
#       protocol        =  socket type is usually enough
# External services must fill out the following
#       user            =
#       group           =
#       server          =
#       server_args     =
# External services not listed in /etc/services must fill out the next one
#       port            =
# RPC based services must fill out these
#       rpc_version     =
#       rpc_number      =
# Logging options
#       log_type        =
#       log_on_success  =
#       log_on_failure  =
# Networking options
#       flags           =
#       bind            =
#       redirect        =
#       v6only          =
# Access restrictions
#       only_from       =
#       no_access       =
#       access_times    =
#       cps             = 50 10
#       instances       = UNLIMITED
#       per_source      = UNLIMITED
#       max_load        = 0
#       deny_time       = 120
#       mdns            = yes
"time-stream" 67L, 1149C 已写入   
 
查看37号端口是否打开,发现37号端口并没有打开。
[root@TRIXBOX1 xinetd.d]# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State     
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN     
tcp        0    284 192.168.6.55:22             192.168.6.60:58907          ESTABLISHED
udp        0      0 0.0.0.0:36879               0.0.0.0:*                              
udp        0      0 0.0.0.0:68                  0.0.0.0:*                              
udp        0      0 0.0.0.0:5353                0.0.0.0:*                              
udp        0      0 0.0.0.0:111                 0.0.0.0:*                              
udp        0      0 192.168.6.55:123            0.0.0.0:*                              
udp        0      0 127.0.0.1:123               0.0.0.0:*                              
udp        0      0 0.0.0.0:123                 0.0.0.0:*                              
启动一下xinetd服务,再查看端口号,37号端口已经打开了。
[root@TRIXBOX1 xinetd.d]# /etc/init.d/xinetd start
启动 xinetd:                                              [确定]
[root@TRIXBOX1 xinetd.d]# netstat -an            
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State     
tcp        0      0 0.0.0.0:37                  0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN     
tcp        0    284 192.168.6.55:22             192.168.6.60:58907          ESTABLISHED
udp        0      0 0.0.0.0:36879               0.0.0.0:*                              
udp        0      0 0.0.0.0:37                  0.0.0.0:*                              
udp        0      0 0.0.0.0:68                  0.0.0.0:*                              
udp        0      0 0.0.0.0:5353                0.0.0.0:*                              
udp        0      0 0.0.0.0:111                 0.0.0.0:*                              
udp        0      0 192.168.6.55:123            0.0.0.0:*                              
udp        0      0 127.0.0.1:123               0.0.0.0:*                              
udp        0      0 0.0.0.0:123                 0.0.0.0:*                              

你可能感兴趣的:(server,centos,rfc,time,休闲)