rsh服务配置文档
rsh是“remote shell”**(远程 shell)**的缩写。该命令在指定的远程主机上启动一个shell并执行用户在rsh命令行中指定的命令。
- 安装rsh-server服务器
#yum-y install rsh-server - 修改启动服务配置文件
进入setup**,选择system services,把 rsh**选中,并保存退出
也可以直接编辑/etc/xinetd.d/rsh**
#vi /etc/xinetd.d/rsh
编辑/etc/xinetd.d/rsh ,把disable = yes**修改为disable = no
#
default: on
description: The rshd server is the server for the rcmd(3) routine and, /
consequently, for the rsh(1) program. The server provides /
remote execution facilities with authentication based on /
privileged port numbers from trusted hosts.
service shell
{
disable = no
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rshd
}
重启服务
#service xinetd restart
检查是否启动: rsh server 监听和TCP 是514。
[root@mg04 root]# netstat -an |grep 514
tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN
如果能看到514在监听说明服务器已经启动
编辑/etc/pam.d/rsh
#vi /etc/pam.d/rsh
把rsh文件中的auth required /lib/security/pam_securetty.so一行用“#”注释,这样root用户才能通过rsh登陆编辑/root/.rhosts
每行内容如下
客户端机器IP地址客户端用户名
192.168.130.246 root
192.168.130.144 zxt
- 重启服务,在客户端登录
在windows xp开始菜单输入cmd,输入以下命令测试,连接成功应该能看到服务器当前运行的进程
rsh 192.168.130.246 -l root -n ps -ef