A Very quick and dirty howto guide for setting up rsh a remote shell to execute commands remotely from one Linux host to another.

This might be useful for scripts to run something on the remote host. This assumes having already setup a ssh key between the hosts so there is no password request on the remote shell. However this is not mandatory and might be a security issue. In case you like to setup  a ssh key have a look here.

This setup assumes there is no /etc/host.allow or /etc/host.deny setup for the remote server and the remote command shall be executed as user root.

We have host Alpha to execute the command on
Host Bravo the remote host where the command shall run on.

All commands are to be run as root

  1. Starting with Bravo

1.1 Install rsh-server

yum install rsh-server
chkconfig rsh on

1.2 give rsh and the remote host all permissions needed. this needs to be 1 line rsh in the  /etc/securetty and  the remote sending hostname in the .rhost

echo rsh >>/etc/securetty
echo [hostname_here_alpha] >>/root/.rhosts

Ensure the setting “disable = no” in the /etc/xinetd.d/rsh file

cat /etc/xinetd.d/rsh

restart xinetd

service xinetd restart
  1. on Server Alpha

Install rsh (if its not yet installed)

yum install rsh

And then test it.

rsh Bravo -l root ls -al /tmp


%d bloggers like this: