[1] First of all check what are all packages installed on machine, for rsh.
rpm -qa | grep -i rsh
it will list
rsh-server-0.17-25.3
rsh-0.17-25.3
These both are required to start rsh on machine. If only rsh is there, then you need to installed rsh-server also.
[2] After that make sure the /etc/xinetd.d/rsh /etc/xinetd.d/rlogin /etc/xinetd.d/rexec files are there.
If they are not there, then create them, below are the sample files.
======================/etc/xinetd.d/rsh---file==============
# default: off
# description:
# The rshd server is a 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
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rshd
disable = no
}
=============================================
=================/etc/xinetd.d/rlogin--file==============
# default: off
# description:
# Rlogind is a server for the rlogin program. The server provides remote
# execution with authentication based on privileged port numbers from trusted
# host
service login
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rlogind
disable = no
}
======================================================
=================/etc/xineted.d/rexec--file==========
# default: off
# description:
# Rexecd is the server for the rexec program. The server provides remote
# execution facilities with authentication based on user names and
# passwords.
service exec
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rexecd
disable = no
}
======================================================
Now save all these files, and then do following steps.
[3] Edit /etc/securetty file.
e.g.,
cat /etc/securetty
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
ttyS0
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
rsh
rlogin
rexec
Add the /etc/securetty file like above. Add these three services in bottom of file.
[4] now edit /root/.rhosts file. If this file is not there, then you can create it with 600 file permission.
touch /root/.rhosts
chmod 600 /root/.rhosts
now in this file add all hosts from where you want to do rsh.
Suppose you want to do rsh from PC-1 to PC-2 and on PC3.
then add file like below,
pc-1 root
pc-2 root
pc-3 root
here pc-1 will be get replace by your hostname of machine.so double cross check the hostname before editing this file.
Now just restart the xinetd.d services.
/etc/init.d/xinetd.d start
or restart
Hope this will sovle your prob.
Thanks.
With Regards,
Ashish Barot.
www.linux4beginners.info