1.安裝 xinetd node
yum -y install xinetd linux
2. 安裝rsh
服務器
注:如下安裝的rsh-server、rsh、rstatd包若是不能經過wget下載,能夠在51cto下載中心下載,地址以下:app
http://down.51cto.com/data/1322433less
從以下地址去下載socket
wget ftp://ftp.muug.mb.ca/mirror/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/rsh-server-0.17-14.i386.rpm tcp
安裝rsh服務器rpm包ide
rpm -ivh rsh-server-0.17-14.i386.rpm --force --nodeps ui
下載rsh客戶端rpm包spa
wget ftp://ftp.muug.mb.ca/mirror/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/rsh-0.17-14.i386.rpm
安裝rsh客戶端rpm包
rpm -ivh rsh-0.17-14.i386.rpm --force --nodeps
3. 安裝 rstatd
第1種方式安裝rstatd
wget http://nchc.dl.sourceforge.net/project/rstatd/rstatd/4.0.1/rpc.rstatd-4.0.1.tar.gz
下載後按下面的內容解壓與安裝
# tar –xzvf rpc.rstatd-4.0.1.tar.gz
# ./configure ---配置
# make ---編譯
# make install ---安裝
第2種方式安裝rstatd
yum install rusers-server
運行以下方式來查看是否已經將 rusers-server 裝上了(如妹結果還需)
yum search rusers-server
經過 rpcinfo -p 來查看是否已經有 rstatd 服務啓動了啓動的結果以下所示:
[root@locathost init.d]# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 37276 status
100024 1 tcp 51722 status
100001 3 udp 991 rstatd
100001 2 udp 991 rstatd
100001 1 udp 991 rstatd
100011 1 udp 875 rquotad
100011 2 udp 875 rquotad
100011 1 tcp 875 rquotad
100011 2 tcp 875 rquotad
若是沒有,那麼到init.d下啓動,命令以下
/etc/init.d/./rstatd start
命令擴展啓動 (./rstatd {start|stop|status|rstart})
4. 配置 xinetd.conf
vi /etc/xinetd.conf
#
# This is the master xinetd configuration file. Settings in the
# default section will be inherited by all service configurations
# unless explicitly overridden in the service configuration. See
# xinetd.conf in the man pages for a more detailed explanation of
# these attributes.
defaults
{
# The next two items are intended to be a quick access place to
# temporarily enable or disable services.
#
#enabled=
#disabled=
# Define general logging characteristics.
log_type= SYSLOG daemon info
log_on_failure= HOST
log_on_success= PID HOST DURATION EXIT
# Define access restriction defaults
#
#no_access=
#only_from=
#max_load= 0
cps= 50 10
#instances= 50
#per_source= 10
instances= 30
per_source= 50 10
# Address and networking defaults
#
#bind=
5. 分別修改/etc/xinetd.d/下的三個conf文件
rlogin ,rsh,rexec 這三個配置文件,
將這三個文件裏面的Disable = yes都改爲 Disable = no
或是把# default: off都設置成 on ,並把「#」去掉,這個的意思就是在xinetd啓動的時候默認都啓動上面的三個服務!
例如rlogin的內容
以下標紅的地方修改一處便可
# default: on
# description: rlogind is the server for the rlogin(1) program. The server \
#provides a remote login facility with authentication based on \
#privileged port numbers from trusted hosts.
service login
{
socket_type= stream
wait= no
user= root
log_on_success+= USERID
log_on_failure += USERID
server= /usr/sbin/in.rlogind
#disable= yes
disable = no
}
6. 啓動 xinetd
service xinetd start
確認啓動
netstat -an |grep 514
結果:
Java代碼
1.tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN
7. 啓動 rstatd
rpc.rstatd
rpc.rquotad
8.確認啓動:
rpcinfo -p
結果:
[root@locathost init.d]# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 37276 status
100024 1 tcp 51722 status
100001 3 udp 991 rstatd
100001 2 udp 991 rstatd
100001 1 udp 991 rstatd
100011 1 udp 875 rquotad
100011 2 udp 875 rquotad
100011 1 tcp 875 rquotad
100011 2 tcp 875 rquotad
9. 關閉防火牆服務
service iptables stop
配置loadrunner unix監控輸入服務器ip便可 以下圖: