Compaq TCP/IP Services for OpenVMS
User's Guide


Previous Contents Index


Chapter 3
Using Remote (R) Commands

The Remote (R) commands provided by TCP/IP Services allow you to work in user accounts on remote systems that support the Remote (R) protocols. You can also use commands, shell scripts, and command procedures on these remote host systems without logging in to the hosts. The R commands include RCP (Remote Copy), RLOGIN (Remote Login), RSH (Remote Shell), and REXEC (Remote Execute, invoked by RSH). You enter these commands at your system command-line prompt.

To use the Remote (R) commands, you need access to a user account on the remote host. Access is granted by either of the following:

Table 3-1 summarizes the Remote (R) commands. (For complete command descriptions, see Section 3.8.)

Table 3-1 Summary of Remote (R) Commands
Command Description
RCP Copies files between the local host and a remote host or between two remote hosts. Authentication is performed on the remote host or hosts using the user name supplied by RCP or by authentication or proxy files.
RLOGIN Connects to the remote host, which starts an interactive login session. Authentication is performed on the remote host using the user name supplied by RLOGIN.
RSH Connects to the remote host, which executes the command you specified. Authentication is performed on the remote host using the user name supplied to RSH.
RSH/PASSWORD Uses the REXEC facility to connect to the remote host, which executes the command you specify. Authentication is performed on the remote host using the user name and password supplied by RSH.

3.1 Providing Account and Password Information

To use a remote command on your OpenVMS system, remote hosts need to know the user name that you want to use on the host. You can provide the user name in either of two ways:

The remote host must also know your password or know you as a trusted user on your local system through a proxy or by authentication.

Notes

  • To use the REXEC feature, you must always use the /PASSWORD qualifier.
  • The RLOGIN command does not recognize the /PASSWORD qualifier. If you are a trusted user, you are automatically logged in to the remote system.
  • If you are not a trusted user, the remote host (REXEC) prompts you to enter a user name and password on the remote system.

3.1.1 Quotation Marks

Use quotation marks (" ") for UNIX host path names that include slashes (/), such as user/simms/offers , and for user/host specifications that include the username@hostname syntax.

If the remote host uses case-sensitive user names and passwords, use quotation marks in the following situations:

3.1.2 Examples

The following examples show how to provide account and password information for the R commands.

  1. OpenVMS user STALLINGS accesses the file accnts on UNIX host ufemism as user stallings , and copies the file to the current directory on the OpenVMS system. Because /LOWERCASE is the default, the /LOWERCASE and /USER_NAME=STALLINGS qualifiers are not needed. In the following example, the user is a trusted user.


    $ RCP UFEMISM:ACCNTS [] 
    $ 
    

  2. From OpenVMS, STALLINGS accesses the account cris on ufemism . Because /LOWERCASE is the default, the /LOWERCASE and /USER_NAME=STALLINGS qualifiers are not needed. In the following example, the user is a trusted user.


    $ RLOGIN /USER_NAME=CRIS UFEMISM 
    Welcome to UNIX system ufemism. 
       .
       .
       .
    ufemism% 
    

  3. User FINCH has the same uppercase name for both an OpenVMS account and a UNIX account. For RSH to send the uppercase OpenVMS account name to remote host ufemism in uppercase, FINCH uses the /NOLOWERCASE qualifier. In the following example, the user is a trusted user.


    $ RSH /NOLOWERCASE UFEMISM CAT -N GRANTS 
    

  4. User BACH has the account bach on the UNIX host classics . To invoke the REXEC feature, BACH specifies the password on host classics . Note that the password MagNificat is enclosed in quotes to prevent RSH from sending it all uppercase.


    $ RSH /PASSWORD="MagNificat" CLASSICS LS 
    

3.2 Specifying Qualifiers

You can specify R command qualifiers in either of two ways:

3.3 Obtaining Online Help

You can obtain online help for the Remote commands by entering the following command:


$ HELP TCPIP_SERVICES REMOTE_COMMANDS 

You can also obtain information for a specific R command by entering one of the following commands:


$ HELP RCP 
$ HELP RLOGIN 
$ HELP RSH 
$ HELP REXEC 

3.4 Copying Files with RCP

The RCP (Remote Copy) command copies a file between your local host and a remote internet host. You can also use RCP to copy a file between two remote internet hosts. You specify the source and destination file names, each in the format appropriate for the source or destination system. For copying files from one remote host to another, the following rules apply:

By using the /RECURSIVE qualifier with the RCP command, you can recursively copy every file and subdirectory in a directory.

You can also use the COPY/RCP command to copy files across the network. For more information on this command, enter HELP COPY/RCP at the DCL prompt.

Note that you can also use FTP to transfer files. To determine the best file transfer service to use for your needs, see Section 1.1.1. For more information about FTP, see Chapter 2.

3.4.1 Example RCP Commands

The following examples show how to use RCP commands to copy files from one host to another host:

  1. User BEST has the account best on the UNIX host haven . User BEST's password for that account is IMusici, which must be enclosed in quotation marks because it is mixed case. The following command copies the file /symph/nine on haven to the local directory on the OpenVMS system (the UNIX file specification also must be enclosed in quotation marks):


    $ RCP /PASSWORD="IMusici" "haven:/symph/nine" 
    

  2. User BEST has a proxy account on the remote UNIX host musicx . The following command copies the file /symph/pastoral from host musicx to the directory [SYMPH6] on the device DKA300: on BEST's local OpenVMS system:


    $ RCP "musicx:/symph/pastoral" ":DKA300:[SYMPH6]" 
    

  3. With the following command, user BEST copies each subtree rooted at the /symph directory to the directory [SYMPHS] on the device DKA300: on BEST's local OpenVMS system.


    $ RCP/RECURSIVE "haven:/symph" ":DKA300:[SYMPHS]" 
    

  4. With the following command, user BEST copies all files from the directory /symphonies on remote host musicx to the directory /symph on remote host haven :


    $ RCP /PASSWORD="IMusici" "musicx:/symphonies/*" "haven:/symph/*" 
    

  5. In the following example, user BEST uses the DCL command COPY/RCP to transfer the complete subdirectory tree /symph from remote UNIX host haven to remote OpenVMS host FRAM. Both hosts require a password. (When using the RCP command to transfer files between two remote hosts, you need a proxy account or an entry in the authentication file for at least one of the two remote hosts.) User BEST has an account under the same name on both hosts.


    $ COPY/RCP haven"BEST IMusici"::"/symph/*"  
    To: FRAM"VAUGHN MYLES"::[classic.compositions]*" 
    

3.5 Starting a Remote Login Session with RLOGIN

The RLOGIN (Remote Login) command connects your terminal to the remote host you specify and requests a login. If the remote host has an entry in its authentication files for your host and user name, it may bypass its login and password prompts. (See Section 3.1.)

Note that you can also use TELNET to log in to remote internet hosts. To determine the best remote login service to use for your needs, see Section 1.1.2. For more information about TELNET, see Chapter 4.

3.5.1 Logging Out

End your remote login session in one of the following ways:

The default escape character is a tilde ( ~ ). To set another escape character, use the /ESCAPE_CHARACTER qualifier on the RLOGIN command line.

3.5.2 Example RLOGIN Sessions

The following examples show how to use the RLOGIN command.

  1. The following command logs in to node CONDO:


    $ RLOGIN CONDO 
    CONDO - Unauthorized access is prohibited 
    Username: KING  
    Password: (password not echoed) 
       Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3 on node CONDO 
           Last interactive login on Thursday, 24-SEP-2001 15:20:29.60 
               Last non-interactive login on Wednesday, 23-SEP-2001 14:25:04.12 
     
    $ RUN ... 
    $ ~. (characters not echoed) 
     
    %RLOGIN-S-LCLCLOSED, Local connection closed 
    $ 
    

  2. The following command logs in to host petrel and changes the character used to close the RLOGIN session:


    $ RLOGIN /ESCAPE_CHARACTER="+" PETREL 
     
       .
       .
       .
    Last login: Mon Mar 14 18:34:27 from phoebe.edu 
    UNIX System petrel:  Fri Mar 19 11:02:20 EST 2002 
    Mon Jun 28 18:44:42 EST 2002 
     
    % ls ... 
    % +. (characters not echoed) 
     
    %RLOGIN-S-REMCLOSED, Remote connection closed 
    $ 
    

3.6 Issuing a Remote Command with RSH

The RSH (Remote Shell) command connects your terminal to a remote host and requests it to execute the command, script, or command procedure that you specify. If the command generates output, you see it as if it were produced locally. If you omit a remote command when you enter an RSH command line, RSH initiates an RLOGIN session. However, if the command line includes the /PASSWORD qualifier, the remote login attempt fails. Using the /PASSWORD qualifier invokes REXEC. (See Section 3.7.)

Syntax rules require that you enter your RSH command line so that the remote command is the last word.

3.6.1 Quotation Marks in Commands

If the remote command is one or more lowercase words, you do not need to enclose them in double quotation marks on the RSH command line. However, double quotation marks ( " " ) are required for the following:

In addition, RSH handles one double quotation mark ( " ) and two consecutive double quotation marks ( " " ) in the following manner:

Note that, as a general rule, if you are uncertain about whether or not to use quotation marks, you should use them.

3.6.2 Interrupting a Command's Execution

To stop remote execution of a command, press either Ctrl/C or Ctrl/Y.

3.6.3 Example RSH Commands

The following examples show how to use the RSH command.

  1. In the first example, the remote system manager previously created an entry in the authentication files for remote user STAN on host oster , giving STAN permission to access user rolly .
    From the local OpenVMS host, user STAN views rolly 's directory, which resides on UNIX system oster . No quotation marks are required around the user name and host name because RSH by default sends them in lowercase.


    $ RSH /USER_NAME=ROLLY OSTER LS 
    

  2. On the following RSH command line, the uppercase UNIX qualifier -R is entered within quotation marks to preserve the uppercase R . This example assumes that the user's originating host and user name are in the authentication files on the remote host debts .


    $ RSH DEBTS LS "-R" 
    

  3. The following commands show how RSH sends quotation marks to a remote UNIX host and how quotation marks affect case. All examples assume that the user's originating host and user name are in the authentication files on the remote host.


    $ RSH DEBTS ECHO TEST MESSAGE 
    test message 
     
    $ RSH DEBTS ECHO "\""test\"" message" 
    "test" message 
     
    RSH DEBTS ECHO "TEST" MESSAGE 
    TEST message 
     
    $ RSH DEBTS "echo '""test"" message'" 
    "test" message 
     
    

  4. Because a remote command is not specified on the RSH command line, TCP/IP Services executes RLOGIN.


    $ RSH MOON01 
     
    Password:     [Return](password not echoed) 
     
    Last successful login for jjones: Fri Sep 25 10:58:31 2002 from nebula 
        Last unsuccessful login for jjones: Fri Sep 25 11:59:43 2002 on ttyp5 
     
        Tru64 UNIX V5.0  (Rev. 148); Tue Apr  7 18:32:54 EST 2002 
     
                            Compaq Computer Corporation 
                                 Internal Use Only 
    moon01> 
     
    

  5. In this example, the OpenVMS system manager of host WR2 previously created an entry in the authentication files for remote user SIMMS on host WR1 .
    From OpenVMS host WR1 , user SIMMS enters the DIRECTORY command to execute at host WR2 .


    $ RSH WR2 DIRECTORY 
    

  6. In this example, the OpenVMS system manager of host WR2 previously created an entry in the authentication files for remote user SIMMS on host WR1 , allowing user SIMMS access to the user name ROGERS .
    User SIMMS enters the DIRECTORY command from host WR1 to execute at host WR2 in user account ROGERS .


    $ RSH WR2 /USER=ROGERS DIRECTORY 
    

3.7 Issuing a Remote Command with a Password (REXEC Feature)

Use the REXEC feature to send a command to execute on a remote host that does not have, or might not have, the authentication information that RSH requires. The remote system's authentication files are not used.

Along with the remote command, REXEC sends the password you specify on the command line to the remote host. This password is used for security checking.

The Remote Shell program (RSH) invokes REXEC. To use REXEC, enter RSH /PASSWORD. REXEC then functions like the RSH command.

3.7.1 Example of Using REXEC

The following example shows how to provide password information for the RSH command, thereby invoking the REXEC feature on the remote host.

From host GRANT , user STANTON enters the file tops.holdings that resides on UNIX host oster . Because STANTON is not listed in oster 's authentication files, user STANTON must use the REXEC feature and supply the /USER_NAME and /PASSWORD qualifiers. Quotation marks are required around the password because it contains uppercase letters.


$ RSH OSTER /USER_NAME=STANTON /PASSWORD="KeepingSaneJoy" - 
_$ CAT TOPS.HOLDINGS 


Previous Next Contents Index