Junk Food for the Brain

Open Source and Awesomesauce :)

How to Enable Passwordless Rsh Login in RHEL5

| Comments

When you administer clusters, you will eventually encounter applications that still use rsh to connect between nodes.

In my place, we use Red Hat Enterprise Linux 5 (RHEL5) for the cluster nodes. In order for the application to run, we need to enable passwordless logins via rsh, in order for the Message Passing Interface & Node Management Software to work. There are a few ways to do this, this is how I did it. Security Professionals will be screaming though.

  1. Firstly, make sure you have installed the rsh-server rpm package.
[root@node01 ~]# yum install rsh-server
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package rsh-server.i386 0:0.17-38.el5 set to be updated
--> Finished Dependency Resolution  
Dependencies Resolved  
================================================================================
 Package           Arch        Version               Repository            Size
================================================================================
Installing:
 rsh-server        i386        0.17-38.el5           rhel-selrepos         39 k  
Transaction Summary
================================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)           
Total download size: 39 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : rsh-server                                        [1/1]   
Installed: rsh-server.i386 0:0.17-38.el5
Complete!
  1. Make sure the rsh, rlogin, rexec, xinetd are turned on and then restart xinetd.
[root@node01 ~]# chkconfig rsh on
[root@node01 ~]# chkconfig rexec on
[root@node01 ~]# chkconfig rlogin on
[root@node01 ~]# chkconfig xinetd on
[root@node01 ~]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
  1. Edit your /etc/securetty file. Append the following
rsh
rexec
rlogin
  1. You’ll then need to create a .rhosts file in the user’s home directory, with the host names of the machines you wish to allow to connect. Note:These machines should be resolvable via either DNS or put in your /etc/hosts file.
node01
node02
node03

Also, make sure the file permissions are 0600.

chmod 0600 ~/.rhosts

You should be able to rsh in now. :)