Setup Remote Shell access (RSH) on CentOS 6 / RHEL 6

The Remote Shell is a command line client program that can execute the command as another user, and an another computer over the network. The rsh is a client that connects rshd server daemon, rhsd server daemon runs on tcp port no 514. Rshd does not support encryption so it is very in secure to use on the production environment, because it transfers the password plainly. Now a days rsh replaced by SSH.

Some time you might require to configure for special requirement, you can follow the simple guide to setup.

Install rsh and rshd using yum command, here is the yum configuration guide.

yum install rsh rsh-server

Edit the configuration file to enable rshd server daemon.

vi /etc/xinetd.d/rshservice shell{socket_type            = stream

wait                   = no

user                   = root

log_on_success        += USERID

log_on_failure        += USERID

server                 = /usr/sbin/in.rshd

disable                = no

Restart the server daemon.

/etc/init.d/xinetd restart

.rhosts file must be modified to include the names of the remote workstations, file should be under the home directory of the user who’s account is going to be used to execute the commands over a network. If the root account is going to be used to start the web server over a network, file should be under home directory of root user.

vi ~/.rhosts


Any user from the above systems can execute the command as root.

Add a full permission to use the command over the network. Plus sign will give a full permission.
vi /etc/hosts.equiv + +

Now run a command from any one of the external machine listed above, for example check uptime status from external machine. host_name refers to your rshd server.

rsh host_name uptime


Disable firewall and SELinux security settings.
To enable external root user to execute the command, add rsh and rlogin entries on /etc/securetty file.


Share This Post