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
o RCP (Remote Copy)
o RLOGIN (Remote Login)
o RSH (Remote Shell)
o REXEC (Remote Execute, invoked by RSH).
You enter these commands at your system command-line prompt.
To use Secure Shell (SSH) authentication and encryption for
remote login, remote command execution, and copying files, refer
to the HP TCP/IP Services for OpenVMS Guide to SSH.
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:
o An entry in the remote host's authentication or proxy files
o Knowledge of a valid remote account and its password
1 – User Guidelines
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:
o Automatically: You do not need to take any action if your
user name is the same on the remote host as it is on the local
host. The remote commands automatically supply your local user
name as the requested user name on the remote system.
o Using the /USER_NAME qualifier: Specify the user name with the
/USER_NAME qualifier if your user name is:
- Different on the remote host
- In mixed case (only for remote hosts that support case-
sensitive user names)
- The same on the remote host but you want to access the
remote host using another user name
By default, the R commands send all user names in lowercase
letters. If you access a host that supports case-sensitive
user names, and the user name you specify has uppercase
letters, you can use the /NOLOWERCASE qualifier to maintain
these letters as uppercase, or you can specify the /USER_NAME
qualifier and enclose the user name within quotation marks.
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.
o Accessing remote hosts by providing your password:
- Certain systems have case-sensitive passwords. To send your
lowercase or mixed-case password to these hosts, enclose
it within quotation marks ( " " ). On systems that are not
case sensitive, you do not need to enclose your password
within quotation marks.
- You can specify the password on the command line, as
follows:
$ RSH WOODS /PASSWORD="Downy" LS
You can specify the password when the remote system
prompts, as follows:
$ RSH WOODS /PASSWORD DIR
REXEC password: (password not echoed)
o Accessing remote hosts as a trusted user:
Most systems use authentication files or proxy accounts that
allow trusted users on trusted hosts to access the system
by specifying only the user name they want to use. To access
a host without specifying the corresponding password, your
originating host and user name must have an entry in these
authentication files.
The authentication file entries contain your originating user
name. The R commands convert your originating user name to
lowercase unless you use the /NOLOWERCASE qualifier. You may
have to contact the system manager of the remote system to
determine whether the system is case sensitive and, if so,
what case is used in the authentication files.
NOTES
o To use the REXEC feature, you must always use the
/PASSWORD qualifier.
o The RLOGIN command does not recognize the /PASSWORD
qualifier. If you are a trusted user, you are
automatically logged in to the remote system.
o If you are not a trusted user, the remote host (REXEC)
prompts you to enter a user name and password on the
remote system.
2 – Command Syntax
o 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:
o User names and passwords are mixed case.
o Passwords are lowercase.
o User names are uppercase, unless you use the /NOLOWERCASE
qualifier.
o Qualifiers
You can specify R command qualifiers in either of two ways:
o Enter the qualifiers on the command line, as follows:
$ RCP /LOG TRANQUIL:VULTURES []
$ RSH /EIGHTBIT /ESCAPE_CHAR="+" /TRUNCATE HERON CAT -N STREAMS
o Add the same information to your LOGIN.COM file, as shown
in the following example:
$ ! To customize my R commands:
$ !
$ RCP :== RCP /LOG
$ RLOGIN :== RLOGIN /EIGHTBIT/ESCAPE_CHAR="+" /TRUNCATE_USER_NAME
$ RSH :== RSH /EIGHTBIT /ESCAPE_CHAR="+" /TRUNCATE_USER_NAME
$ !
3 – 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:
o If you do not have proxy login accounts (or authentication
file entries) for both the source and remote hosts, you
must have the same user name and password on both source
and destination hosts. Use the /PASSWORD qualifier and,
if necessary, the /USER_NAME qualifier, to specify the
authentication information for the remote hosts.
o If you have a proxy login account (or authentication file
entry) on one of the remote hosts only, use the /PASSWORD
qualifier and, if necessary, the /USER_NAME qualifier to
specify the authentication information for the other host.
To recursively copy every file and subdirectory in a directory,
use the /RECURSIVE qualifier with the RCP command.
To preserve file format and other attributes when copying files
between two OpenVMS systems, use the /VMS qualifier (UNIX format:
-v option). For more information, see File_Formats.
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.
3.1 – File Formats
RCP on OpenVMS is best used for transferring text files. By
default, RCP converts any type of OpenVMS file that is not
STREAM_LF, FIXED, or UNDEFINED to STREAM_LF format, using the
standard OpenVMS CONVERT utility. RCP specifies the files in the
following way:
FILE;ORGA SEQU;RECO;CARR CARR;FORM STREAM_LF;SIZE 0;BLOCK YES
Options available for changing the default behavior for file copy
operations include the following:
o Convert FIXED and UNDEFINED format files to STREAM_LF
You can change the behavior of RCP to convert FIXED and
UNDEFINED format files to STREAM_LF format by using the
following logical name:
TCPIP$RCP_SEND_FIX_FORMAT_AS_ASCII
If this logical name is set to the value 1, RCP converts FIXED
and UNDEFINED files to STREAM_LF format. If this logical name
is set to a value other than 1, RCP will not convert those
files that have a fixed-length record size that matches the
value of the logical name; RCP will convert all other FIXED
and UNDEFINED files.
For example, if you set this logical name to 512, RCP will not
convert FIXED or UNDEFINED files with a fixed-length record
size of 512 (such as OpenVMS executable image files); RCP will
convert all other FIXED and UNDEFINED files.
o Preserve File Attributes in OpenVMS-to-OpenVMS File Transfer
In an OpenVMS-to-OpenVMS transfer, the receiving peer creates
the file as a STREAM_LF file by default. You can preserve the
file type and other attributes of a file transferred between
two OpenVMS systems by using the /VMS qualifier (UNIX format:
use the -v option) with the RCP command.
WARNING
Specify this qualifier only for file copy operations
between two OpenVMS systems; otherwise, the operation
will fail.
3.2 – File Size
When transferring files, the RCP protocol requires that the
length of the file be sent as part of the protocol. The length
is interpreted as a signed 32-bit integer. Therefore, files
transferred using RCP must be less than 4 GB minus 1 byte.
3.3 – Examples
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]*"
4 – 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.
Note that you can also use TELNET to log in to remote internet
hosts.
End your remote login session in one of the following ways:
o Log out from the remote host.
o On a new line, enter the escape character and a period.
The default escape character is a tilde ( ~ ). To set another
escape character, use the /ESCAPE_CHARACTER qualifier on the
RLOGIN command line.
4.1 – Examples
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
$
5 – 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.
Syntax rules require that you enter your RSH command line so that
the remote command is the last word.
Quotation Marks
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:
o Mixed-case UNIX commands
o Uppercase UNIX commands
In addition, RSH handles one double quotation mark ( " ) and
two consecutive double quotation marks ( " " ) in the following
manner:
o If you enter one double quotation mark on a command line, RSH
removes it.
o If you enter two consecutive double quotation marks on the
command line, RSH removes the first quotation mark and leaves
the second.
o If you enclose text within double quotation marks on a command
line, RSH disables the default conversion of characters to
lowercase and removes the quotation marks.
Note that, as a general rule, if you are uncertain about whether
or not to use quotation marks, you should use them.
Interrupting Commands
To stop remote execution of a command, press either Ctrl/C or
Ctrl/Y.
5.1 – Examples
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 2003 from nebula
Last unsuccessful login for jjones: Fri Sep 25 11:59:43 2003 on ttyp5
Tru64 UNIX V5.0 (Rev. 148); Tue Apr 7 18:32:54 EST 2003
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
6 – REXEC
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.
6.1 – Examples
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