Although SSH dominates on remote control of Linux/Unix system because of its secure, RSH still has dedicated area to work such as in the internal network of a cluster, for example. However, setting up RSH server is not as trivial as SSH server. It takes some little effort for working properly.
At first step, install RSH server using
yum as usual. Do it on every machines.
# yum install rsh-server rsh
RSH service is put under
xinetd service, and it is disabled by default. To enable
rsh service, open file
/etc/xinetd.d/rsh and change "
yes" to "
no" at the line "
disabled".
sed -i "s/^\(.*disable.*=.*\)yes\(.*\)$/\1no\2/g" /etc/xinetd.d/rsh
Next, you have to edit file
/etc/securetty to append
rsh at the end of it.
# ( grep rsh /etc/securetty ) || ( echo "rsh" >> /etc/securetty )
Now, you can restart
xinetd to start
rsh.
# service xinetd restart
For each user who wants to use
rsh to run commands on remote machines, edit files
~/.rhosts on remote machines to include the hostname or IP address of the local machine. For example, a typical
.rhosts file looks like follows.
master
compute-0-0
compute-0-1
compute-0-2
The user on a machine that has such
.rhosts file in the home directory allows others from hosts
master,
compute-0-0,
compute-0-1,
compute-0-2 run a command on it. Check the man page of rhosts for advanced options.
If you meet some errors related to "back connection", please turn off the firewall of the local machine or at least open ports in range 1011 to 1023, which is normally used for back connection in rsh protocol. By the way, port 514 should be opened on the remote machine too.