On Unix-like operating systems, the rsh command executes commands on a remote shell.

Description

rsh connects to the specified host, and executes the specified command. rsh copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rsh normally terminates when the remote command does.

  • Description
  • Syntax
  • Files
  • Examples
  • Related commands
  • Linux commands help

Individual users can keep a private authorization list in a file named .k5login in their (remote) home directory. Each line in this file should contain a Kerberos principal name of the form principal/[email protected]. If there is a ~/.k5login file, access is granted to the account if and only if the originator user is authenticated to one of the principals named in the ~/.k5login file.

Syntax

rsh host [-l username] [-n] [-d] [-k realm] [-f | -F] [-x] [-PN | -PO] command

Options

If you omit command, then instead of executing a single command, you will be logged in on the remote host using rlogin.

Shell metacharacters that are not quoted are interpreted on the local machine, while quoted metacharacters are interpreted on the remote machine. For example, the following command:

rsh otherhost cat remotefile » localfile

appends the remote file remotefile to the local file localfile, while:

rsh otherhost cat remotefile “»” otherremotefile

appends remotefile to otherremotefile.

Please note that interactive commands, such as a text editor, cannot be executed remotely with rsh; use rlogin instead.

Files

Examples

rsh example-host.com ls

Executes the ls command on host example-host.com, using the local username as the remote login name.

on — Execute a command on a remote system, but with the local environment.rlogin — Begin a session on a remote system.telnet — Connect to a remote system using the telnet protocol.