kids encyclopedia robot

Berkeley r-commands facts for kids

Kids Encyclopedia Facts
Quick facts for kids
Berkeley r-commands
Developer(s) Computer Systems Research Group at the University of California, Berkeley
Initial release June 1981; 44 years ago (1981-06)
Operating system Unix and Unix-like
Type Command suite
License BSD

The Berkeley r-commands are a group of computer programs that let users on one Unix computer connect to or send instructions to another Unix computer. They do this using a special way of communicating over a computer network called TCP/IP. These commands were created in 1982 by a team at the University of California, Berkeley.

These r-commands were added to a version of the Unix operating system called Berkeley Software Distribution (BSD). They first appeared in BSD version 4.1. Some of the programs in this group include: rcp (for copying files remotely), rexec (for running programs remotely), rlogin (for logging in remotely), and rsh (for using a remote command line). Other commands are rstat, ruptime, and rwho.

The r-commands were very important and became a common way for Unix systems to work together. However, as more people started using the Internet, a big problem appeared: these commands were not very secure. Because of this, newer and safer ways to connect, like Secure Shell (SSH), started to replace them around 1995.

How r-commands work
Service Port Transport Refs
Client Daemon
rcp rshd 514 TCP
rexec rexecd 512 TCP
rlogin rlogind 513 TCP
rsh rshd 514 TCP
rstat rstatd UDP
ruptime rwhod 513 UDP
rwho

Understanding r-commands

The r-commands let computers talk to each other over a network. They use specific rules, or "protocols," to send information back and forth. For example, when you use rlogin to connect to another computer, your computer sends your username and other details. The other computer then checks if you are allowed to connect. If everything is correct, the connection is made.

These commands often use special files to decide who can connect. Two important files are /etc/hosts.equiv and $HOME/.rhosts.

  • The hosts.equiv file applies to everyone on a server.
  • The .rhosts file is for a single user in their home folder.

These files list which other computers or users are allowed to connect without needing a password. For example, a file might say:

host1
host2 user_a
-host3

This means all users from "host1" can log in. Only "user_a" from "host2" can log in. No users from "host3" can log in.

Main r-commands

Let's look at some of the main r-commands and what they do.

rlogin: Remote Login

rlogin lets you log in to another computer over a network. It uses a specific network "doorway" called TCP network port 513. Once you're logged in, it's like you're sitting right in front of that remote computer. You can type commands and see the results.

This command is similar to Telnet, another tool for remote connections. However, rlogin is mainly used for Unix-like computers. It works with a special program called a daemon (rlogind) on the computer you're connecting to.

rsh: Remote Shell

rsh lets you run commands on a remote computer without fully logging in. It opens a "shell," which is like a text-based window where you can type commands. Whatever you type is sent to the remote computer, and the results are sent back to your screen.

rsh uses TCP port 514 for sending and receiving most information. It also uses a different port for error messages. The program that listens for rsh requests on the remote computer is called rshd.

rexec: Remote Execution

Like rsh, rexec also lets you run commands on a remote computer. The main difference is that rexec requires you to provide a username and password. However, it sends this information without encryption, which means it's not very secure. rexec uses TCP port 512. The program that handles rexec requests on the remote computer is called rexecd.

rcp: Remote Copy

rcp is used to copy files or entire folders between computers over a network. You can copy:

  • From your computer to a remote computer.
  • From a remote computer to your computer.
  • From one remote computer to another remote computer.

The way you use rcp is similar to the regular cp command for copying files on your own computer. But with rcp, you add the name of the remote computer to the file path. For example:

rcp my_file.txt remote_computer:~/documents/my_file.txt

This command copies "my_file.txt" from your computer to the "documents" folder on "remote_computer". Be careful, because rcp will overwrite a file if one with the same name already exists, without asking you first. Like rsh, rcp uses TCP port 514.

rwho: Who is Online Remotely

Just like the who command shows who is logged into your computer, rwho shows you who is logged into all the other Unix computers on your local network. A special program called rwhod keeps track of this information on all the networked computers.

rstat: Remote Statistics

rstat gives you information about how well a remote computer's core system (its "kernel") is performing. It provides statistics about its activity.

ruptime: Remote Uptime

The uptime command tells you how long your computer has been running since its last restart. Similarly, ruptime asks all computers on your local network for their uptime reports. It then shows you how long each computer has been running. If a computer doesn't respond, ruptime will tell you that it's "down." This information is also collected and stored by the rwhod program, which rwho also uses.

Security Concerns

The r-commands that require you to log in (like rcp, rexec, rlogin, and rsh) have some serious security weaknesses:

  • No Encryption: All information, including your passwords, is sent across the network without being scrambled. This means someone could easily "listen in" and steal your passwords.
  • .rhosts File Issues: The .rhosts file is meant to allow connections without a password. However, it relies on the remote computer's name and IP address, which can be faked. This makes it easy for someone with bad intentions to gain access. Many system administrators do not allow these files to be used because of this risk.
  • Trusting the Client: The r-commands partly trust the connecting computer to be honest about who it is. A hacker could pretend to be a trusted computer and gain access.
  • Network File System Risks: If user folders are shared across the network using something like Network File System, a fake .rhosts file could be placed there. This means any security problem with shared folders can also affect r-commands.

Because of these problems, the r-commands are not used much anymore. Many modern Unix and Linux systems don't even include them by default. Most networks that used to rely on rlogin and Telnet have now switched to much safer options like SSH.

See also

Kids robot.svg In Spanish: Rlogin para niños

  • List of Unix commands
kids search engine
Berkeley r-commands Facts for Kids. Kiddle Encyclopedia.