Berkeley r-commands facts for kids
Developer(s) | Computer Systems Research Group at the University of California, Berkeley |
---|---|
Initial release | June 1981 |
Operating system | Unix and Unix-like |
Type | Command suite |
License | BSD |
The Berkeley r-commands are a suite of computer programs designed to enable users of one Unix system to log in or issue commands to another Unix computer via TCP/IP computer network. The r-commands were developed in 1982 by the Computer Systems Research Group at the University of California, Berkeley, based on an early implementation of TCP/IP (the protocol stack of the Internet).
The CSRG incorporated the r-commands into their Unix operating system, the Berkeley Software Distribution (BSD). The r-commands premiered in BSD v4.1. Among the programs in the suite are:
(remote copy), rcp
(remote execution), rexec
(remote login), rlogin
(remote shell), rsh
, rstat
, and ruptime
(remote who).rwho
The r-commands were a significant innovation, and became de facto standards for Unix operating systems. With wider public adoption of the Internet, their inherent security vulnerabilities became a problem, and beginning with the development of Secure Shell protocols and applications in 1995, its adoption entirely supplanted the deployment and use of r-commands (and Telnet) on networked systems.
Service | Port | Transport | Refs | |
---|---|---|---|---|
Client | Daemon | |||
rcp | rshd | 514 | TCP | |
|
rexecd | 512 | TCP | |
rlogin | rlogind | 513 | TCP | |
rsh | rshd | 514 | TCP | |
rstat | rstatd | UDP | ||
ruptime | rwhod | 513 | UDP | |
rwho |
Protocol
The original Berkeley package that provides
also features rlogin
(remote-copy, allowing files to be copied over the network) and rsh (remote-shell, allowing commands to be run on a remote machine without the user logging into it).rcp
As an example, the protocol is as follows:
Client:
<null>
user name on the client<null>
user name on the server<null>
terminal type/terminal baud rate<null>
Server:
The server would check that the user should have access. If so, it returns a message with nothing in it (not even a null character), meaning the connection is established. For example:
Client:
<null>
bostic<null>
kbostic<null>
vt100/9600<null>
Server:
Both
and rlogin
share the rsh
(applies to all users on the server) and /etc/hosts.equiv
(applies to only the user that puts the file in its home folder) access-control scheme, although they connect to different daemons. $HOME/.rhosts
connects to rlogin
, while rlogind
connects to rsh
. rshd
and hosts.equiv
uses the same format. The following shows some aspects of the format:.rhosts
host1
host2 user_a
-host3
+@group1 -user_b
-@group2
This allows all users from host1 to login, user_a from host2 to login, no users from host3, all users on group1 except user_b, and no users on group2.
Commands
rlogin
enables a user to log in on another server via computer network, using TCP network port 513.rlogin
is also the name of the application layer protocol used by the software, part of the TCP/IP protocol suite. Authenticated users can act as if they were physically present at the computer. RFC 1282, in which it was defined, states: "The rlogin
facility provides a remote-echoed, locally flow-controlled virtual terminal with proper flushing of output." rlogin
communicates with a daemon, rlogin
, on the remote host. rlogind
is similar to the Telnet command, but is not as customizable and is able to connect only to Unix-like hosts.rlogin
rsh
opens a shell on a remote computer without a login procedure. Once connected, the user can execute commands on the remote computer through the shell's command-line interface. rsh
passes input and output through the standard streams, and it sends standard output to the user's console. Over the network, standard input and standard out flow through TCP port 514, while Standard Error flows through a different TCP port, which the rsh
daemon (rsh
) opens.rshd
rexec
Like
, rsh
enables the user to run shell commands on a remote computer. However, unlike the rsh server, the rexec
server (rexec
) requires login: it authenticates users by reading the username and password (unencrypted) from the network socket. rexecd
uses TCP port 512.rexec
rcp
can copy a file or directory from the local system to a remote system, from a remote system to the local system, or from one remote system to another. The command line arguments of rcp
and cp
are similar, but in rcp
remote files are prefixed with the name of the remote system:rcp
rcp file.txt subdomain.domain:~/home/foo/file.txt
As with the Unix copy command cp,
overwrites an existing file of the same name in the target; unlike rcp
, it provides no mechanism for warning the user before overwriting the target file. Like cp
, rsh
uses TCP port 514.rcp
rwho
Just as the who command lists the users who are logged in to the local Unix system,
lists those users who are logged into all multi-user Unix systems on the local network. rwho
's daemon, rwho
, maintains a database of the status of Unix systems on the local network. The daemon and its database are also used by the rwhod
program.ruptime
rstat
returns performance statistics from the kernel.rstat
ruptime
Just as the
command shows how long a Unix system has been running since the last restart, uptime
requests a status report from all computers on the local network. It then returns the uptime report. If a computer did not respond within the time limit, then ruptime
reports that the system is down. This information is tracked and stored by the daemon ruptime
, which is also used by the rwho command.rwhod
Security
Those r-commands which involve user authentication (
, rcp
, rexec
, and rlogin
) share several serious security vulnerabilities:rsh
- All information, including passwords, is transmitted unencrypted (making it vulnerable to interception).
- The
(or.rlogin
) file is easy to misuse. They are designed to allow logins without a password, but their reliance on remote usernames, hostnames, and IP addresses is exploitable. For this reason many corporate system administrators prohibit.rhosts
files, and actively scrutinize their networks for offenders..rhosts
- The protocol partly relies on the remote party's
client to provide information honestly, including source port and source host name. A malicious client can forge this and gain access, as therlogin
protocol has no means of authenticating the client is running on a trusted machine. It also cannot check if the requesting client on a trusted machine is the realrlogin
client, meaning that malicious programs may pretend to be a standard-conformingrlogin
client by using the same protocols.rlogin
- The common practice of mounting users' home directories via Network File System exposes rlogin to attack by means of fake
files - this means that any of its security faults automatically plague.rhosts
.rlogin
Due to these problems, the r-commands fell into relative disuse (with many Unix and Linux distributions no longer including them by default). Many networks that formerly relied on
and rlogin
have replaced them with SSH and its telnet
-equivalent rlogin
.slogin
See also
In Spanish: Rlogin para niños
- List of Unix commands