Freigeben über


Rsh

Runs commands on remote computers running the RSH service or daemon. Windows XP and Windows 2000 do not provide an RSH service. An RSH service called Rshsvc.exe is provided with the Windows 2000 Server Resource Kit. Used without parameters, rsh displays help.

Syntax

rsh [Host] [-l UserName] [-n] [Command]

Parameters

Host   : Specifies the remote host (computer) on which to run Command.

-l   UserName   : Specifies the user name to use on the remote computer. If omitted, the user name of the user who is currently logged on is used.

-n   : Redirects the input of rsh to the NUL device. This prevents the display of the command results on the local computer.

Command   : Specifies the command to run.

/?   : Displays help at the command prompt.

Remarks

  • Standard operation

    The rsh command copies standard input to the remote Command, standard output of the remote Command to its standard output, and the standard error of the remote Command to its standard error. Rsh normally quits when the remote command quits.

  • Using Redirection symbols

    Enclose redirection symbols in quotation marks for redirection to occur on the remote computer (for example, ">>"). If you do not use quotation marks, redirection occurs on the local computer. For example, the following command appends the remote file RemoteFile to the local file LocalFile:

    rsh othercomputer cat remotefile >> localfile

    The following command appends the remote file RemoteFile to the remote file OtherRemoteFile:

    rsh othercomputer cat remotefile ">>" otherremotefile

  • Using rsh 

    When using a computer running Windows XP Professional that is logged on to a domain, the primary domain controller for the domain must be available to verify the user name or the rsh command fails.

  • The .rhosts file

    The .rhosts file typically permits network access on UNIX systems. The .rhosts file lists computer names and associated logon names that have access to remote computers. When you run rcp, rexec, or rsh commands remotely with a correctly configured .rhosts file, you do not need to provide logon and password information for the remote computer.

    The .rhosts file is a text file in which each line is an entry. An entry consists of the local computer name, the local user name, and any comments about the entry. Each entry is separated by a tab or space, and comments begin with a pound sign (#). For example:

    host7 #This computer is in room 31A

    The .rhosts file must be in the user's home directory on the remote computer. For more information about the specific implementation of the .rhosts file on a remote computer, see the remote system documentation.

  • This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections

Examples

To execute the telcon command on the remote computer vax1 using the name admin1, type:

rsh vax1 -l admin1 telcon

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Using command redirection operators

Command-line reference A-Z