rlogin 

> Why does: rlogin -l user host generate two processes (on the
> caller's machine), while: telnet host only generates one?

Rlogin uses one process (parent) to read data from your terminal, and other process (child) to write it to the network. Child and parent exchange SIGUSR and SIGUSR1 in funny ways to syncronize this.

You might want to take a look at ftp://ftp.FreeBSD.org/pub/FreeBSD/FreeBSD-stable/src/usr.bin/rlogin/rlogin.c for details on how this is accomplished.

Telnet doesn't do this. It calls select() to operate on more than one fd. Both ways of doing it are “valid” and “good.” The approach with two processes seems (to me) easier to program and easier to write in a portable manner. Many other utilities (e.g., such as “tip” and “cu”) fork a child to talk to “the other end.” Many more use select() and suffer or require Autoconf if they had to call poll() (on systems without select()).

The source code for telnet can be found in ftp://ftp.FreeBSD.org/pub/FreeBSD/FreeBSD-stable/src/usr.bin/telnet/

.rhosts 

Each remote machine may have a file named /etc/hosts.equiv containing a list of trusted hostnames with which it shares usernames. Users with the same username on both the local and remote machine may run rsh from the machines listed in the remote machine's /etc/hosts file. Individual users may set up a similar private equivalence list with the file .rhosts in their home directories. Each line in this file contains two names: a hostname and a username separated by a space.

The entry permits the user named username who is logged into hostname to use rsh to access the remote machine as the remote user. If the name of the local host is not found in the /etc/hosts.equiv file on the remote machine, and the local username and hostname are not found in the remote user's .rhosts file, then the access is denied.

documented on: 02-05-99