在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:*                              
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章