Page 1 of 1

How to Enable Passwordless RSH Login in RHEL5

Posted: Thu May 02, 2013 4:29 pm
by cah
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.

Firstly, make sure you have installed the rsh-server rpm package.

Code: Select all

[root@laxm1331 ~]# yum install rsh-server
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
5Server-x86_64                                           | 1.9 kB     00:00     
5Server-x86_64/primary_db                                | 2.1 MB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rsh-server.x86_64 0:0.17-40.el5_7.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package          Arch         Version               Repository            Size
================================================================================
Installing:
 rsh-server       x86_64       0.17-40.el5_7.1       5Server-x86_64        40 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 40 k
Is this ok [y/N]: y
Downloading Packages:
rsh-server-0.17-40.el5_7.1.x86_64.rpm                    |  40 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : rsh-server                                               1/1 

Installed:
  rsh-server.x86_64 0:0.17-40.el5_7.1                                           

Complete!
Make sure the rsh, rlogin, rexec, xinetd are turned on and then restart xinetd.

Code: Select all

[root@laxm1331 ~]# chkconfig rsh on
[root@laxm1331 ~]# chkconfig rexec on
[root@laxm1331 ~]# chkconfig rlogin on
[root@laxm1331 ~]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
Edit your /etc/securetty file. Append the following

Code: Select all

rsh
rexec
rlogin
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.

Code: Select all

laxm1331 root
laxm1332 root
laxm1333 root
laxm1334 root
laxm1338 root
Also, make sure the file permissions are 0600.

Code: Select all

chmod 0600 ~/.rhosts
You should be able to rsh in now. :)