Thursday, June 28, 2007

How do I rsh, rlogin, or rexec as root?

How do I rsh, rlogin, or rexec as root?

Resolution:For security reasons, rexec, rsh, and rlogin are not enabled by default in Red Hat Enterprise Linux, you should use the OpenSSH suite of tools instead. Information concerning the OpenSSH tools can be found in the Red Hat Enterprise Linux 4: Reference Guide available at: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/ch-ssh.html.

If you must use rexec, rsh, and rlogin, and if you need to use them as root, you will need to make a few modifications to the /etc/securetty file and also need a .rhost file in root's home directory. All three of these tools have PAM configuration files that require the pam_securetty.so PAM module, so you must edit /etc/securetty to allow root access.

Before you can log in as root using these tools, you first have to have them properly set up. First, install the rsh-server package using up2date rsh-server.

Restart xinetd with /sbin/service xinetd restart to activate the changes. At this point, all users except root will be able to use rexec, rsh, and rlogin.

To allow root to use these tools, add the names of the tools you wish to allow to the /etc/securetty. If you wanted to enable root login using rexec, rsh, and rlogin, add the following lines to the /etc/securetty file:

rexec
rsh
rlogin
You also must have a .rhosts file in root's home directory to allow a user to log on as root. This file contains the host or a range of hosts, and the user on that host/hosts that can log in as root.

192.168.1.13 bob

No comments: