1.安装 xinetd
yum -y install xinetd
2. 安装rsh
注:以下安装的rsh-server、rsh、rstatd包如果不能通过wget下载,可以在51cto下载中心下载,地址如下:
http://down.51cto.com/data/1322433
-
从如下地址去下载
wget ftp://ftp.muug.mb.ca/mirror/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/rsh-server-0.17-14.i386.rpm
-
安装rsh服务器rpm包
rpm -ivh rsh-server-0.17-14.i386.rpm –force –nodeps
-
下载rsh客户端rpm包
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即可 如下图:
原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/186418.html