rsh – Connect to a Remote Host and Execute Commands

The ‘rsh’ command is a utility that is used to connect to a remote host and execute commands on that host. The command is used to establish a remote shell connection between two Linux systems. The rsh command is similar to the ssh command, but it is less secure and is not recommended for use in a production environment.


To use the rsh command, the remote host must have the rsh daemon running. The daemon listens for incoming connections on port 514. The rsh command is used to execute a command on the remote host. The syntax for the rsh command is as follows:

rsh [options] remote_host command

Here, ‘remote_host’ is the name or IP address of the remote host, and ‘command’ is the command to be executed on the remote host.

For example, to execute the ‘ls’ command on the remote host ‘remotehost’, the following command can be used:

rsh remotehost ls

The above command will connect to the remote host ‘remotehost’ and execute the ‘ls’ command.


The following table lists the available options for the rsh command:

Option Description
-n Do not read the user’s .rhosts file
-l Use a different username on the remote host
-d Enable debugging
-k Use Kerberos authentication
-K Use Kerberos authentication, but do not forward credentials
-T Disable terminal emulation
-x Disable X11 forwarding
-v Verbose mode

Troubleshooting Tips

If the rsh command fails to connect to the remote host, the following troubleshooting tips can be used:

  • Ensure that the rsh daemon is running on the remote host.
  • Check if the remote host is reachable from the local host.
  • Verify that the remote host is configured to allow rsh connections.
  • Check if the user has permission to execute the command on the remote host.


The rsh command is not recommended for use in a production environment due to security concerns. It is recommended to use the ssh command instead, which provides a more secure way to connect to a remote host and execute commands.