<chapter id="remotehowtoaccess-99941"><title>Accessing Remote Systems (Tasks)</title><highlights><para>This chapter describes all the tasks that are required to log in to
remote systems and work with their files. This is a list of the step-by-step
instructions in this chapter.</para><itemizedlist><listitem><para><olink targetptr="remotehowtoaccess-111" remap="internal">Accessing Remote
Systems (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="remotehowtoaccess-79344" remap="internal">Logging In to a
Remote System (rlogin)</olink></para>
</listitem><listitem><para><olink targetptr="remotehowtoaccess-14" remap="internal">Logging In to a Remote
System (ftp)</olink></para>
</listitem><listitem><para><olink targetptr="remotehowtoaccess-55154" remap="internal">Remote Copying
With rcp</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="remotehowtoaccess-111"><title>Accessing Remote Systems (Task Map)</title><para>This chapter provides tasks that are described in the following table
to log in and copy files from remote systems.</para><table frame="all" pgwide="1" id="remotehowtoaccess-tbl-1"><title>Task Map:
Accessing Remote Systems</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="80.50*"/><colspec colname="col2" colwidth="122.20*"/><colspec colname="colspec3" colwidth="184.30*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Log in to a remote system (<command>rlogin</command>)</para>
</entry><entry><para></para><itemizedlist><listitem override="bullet"><para>Remove <filename>.rhosts</filename> files.</para>
</listitem><listitem override="bullet"><para>Use the <command>rlogin</command> command
to access a remote system.</para>
</listitem>
</itemizedlist>
</entry><entry><para><olink targetptr="remotehowtoaccess-12733" remap="internal">How to Search for and Remove
.rhosts Files</olink></para><para><olink targetptr="remotehowtoaccess-20760" remap="internal">How to Find Out If a Remote
System Is Operating</olink></para><para><olink targetptr="remotehowtoaccess-37282" remap="internal">How to Find Who Is Logged
In to a Remote System</olink></para><para><olink targetptr="remotehowtoaccess-40964" remap="internal">How to Log In to a Remote
System (rlogin)</olink></para><para><olink targetptr="remotehowtoaccess-94997" remap="internal">How to Log Out From a Remote
System (exit)</olink></para>
</entry>
</row><row><entry><para>Log in to a remote system (<command>ftp</command>)</para>
</entry><entry><para></para><itemizedlist><listitem override="bullet"><para>Open and close an<command>ftp</command> connection.</para>
</listitem><listitem override="bullet"><para>Copy files to and from a remote system.</para>
</listitem>
</itemizedlist>
</entry><entry><para><olink targetptr="remotehowtoaccess-40629" remap="internal">How to Open an ftp Connection
to a Remote System</olink></para><para><olink targetptr="remotehowtoaccess-47049" remap="internal">How to Close an ftp Connection
to a Remote System</olink></para><para><olink targetptr="remotehowtoaccess-87541" remap="internal">How to Copy Files From a
Remote System (ftp)</olink></para><para><olink targetptr="remotehowtoaccess-60496" remap="internal">How to Copy Files to a Remote
System (ftp)</olink></para>
</entry>
</row><row><entry><para>Copy remote files with <command>rcp</command></para>
</entry><entry><para>Use the <command>rcp</command> command to copy files to and from a remote
system.</para>
</entry><entry><para><olink targetptr="remotehowtoaccess-46771" remap="internal">How to Copy Files Between
a Local and a Remote System (rcp)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1><sect1 id="remotehowtoaccess-79344"><title>Logging In to a Remote System <command>(rlogin)</command></title><para>The <command>rlogin</command> command enables you to log in to
a remote system. After you are logged in, you can navigate through the remote
file system and manipulate its contents (subject to authorization), copy files,
or execute remote commands.</para><para>If the system you are logging in to is in a remote domain, be
sure to append the domain name to the system name. In this example, <literal>SOLAR</literal> is the name of the remote domain:</para><para><filename>rlogin pluto.SOLAR</filename></para><para>Also, you can interrupt a remote login operation at any time by typing
Control-d.</para><sect2 id="remotehowtoaccess-27053"><title>Authentication for Remote Logins
(<command>rlogin</command>)</title><para>Authentication (establishing who you are) for <command>rlogin</command> operations
can be performed either by the remote system or by the network environment.</para><para>The main difference between these forms of authentication lies
in the type of interaction they require from you and the way they are established.
If a remote system tries to authenticate you, you are prompted for a password,
unless you set up the <filename>/etc/hosts.equiv</filename> or <filename>.rhosts</filename> file.
If the network tries to authenticate you, you are not asked for a password,
because the network already knows who you are. </para><itemizedlist><para>When the remote system attempts to authenticate you, it relies on information
in its local files, specifically if one of the following is true:</para><listitem><para>Your system name and user name appear in the remote system's <filename>/etc/hosts.equiv</filename> file.</para>
</listitem><listitem><para>Your system name and user name appear in the remote user's <command>.rhosts</command> file, under the remote user's home directory.</para>
</listitem>
</itemizedlist><itemizedlist><para>Network authentication relies on one of these two methods:</para><listitem><para>A &ldquo;trusting network environment&rdquo; that has been set
up with your local network information service and the automounter.</para>
</listitem><listitem><para>One of the network information services that is pointed to by
the remote system's <filename>/etc/nsswitch.conf</filename> file contains
information about you.</para>
</listitem>
</itemizedlist><note><para>Network authentication generally supersedes system authentication.</para>
</note><sect3 id="remotehowtoaccess-36082"><title><filename>/etc/hosts.equiv</filename> File</title><para>The <filename>/etc/hosts.equiv</filename> file contains a list
of trusted hosts for a remote system, one per line. If a user attempts to
log in remotely (using <command>rlogin</command>) from one of the hosts that
is listed in this file, and if the remote system can access the user's password
entry, the remote system allows the user to log in without a password.</para><para>A typical <filename>hosts.equiv</filename> file has the following
structure:</para><screen>host1
host2 user_a
+@group1
-@group2</screen><para>When a simple entry for a host is made in <filename>hosts.equiv</filename>,
such as the previous entry for <literal>host1</literal>, it means that the
host is trusted, and so is any user at that machine. </para><para>If the user name is also mentioned, as in the second entry in the example,
then the host is trusted only if the specified user is attempting access. </para><para>A group name that is preceded by a plus sign (+) means that all
the machines in that netgroup are considered trusted.  </para><para>A group name that is preceded by a minus sign (&ndash;) means
that none of the machines in that netgroup is considered trusted. </para><sect4 id="remotehowtoaccess-1"><title>Security Risks When Using the  <filename>/etc/hosts.equiv</filename> File</title><para>The <filename>/etc/hosts.equiv</filename> file presents a security
risk. If you maintain a <filename>/etc/hosts.equiv</filename> file on your
system, you should include only trusted hosts in your network. The file should
not include any host that belongs to a different network, or any machines
that are in public areas. For example, do not include a host that is located
in a terminal room. </para><para>The use of hosts that are not trusted can create a serious security
problem. Either replace the <filename>/etc/hosts.equiv</filename> file with
a correctly configured one, or remove the file altogether.        </para><para>A single line of <literal>+</literal> in the <filename>/etc/hosts.equiv</filename> file indicates that every known host is trusted.  </para>
</sect4>
</sect3><sect3 id="remotehowtoaccess-3"><title><filename>.rhosts</filename> File</title><para>The <filename>.rhosts</filename> file is the user equivalent of the <filename>/etc/hosts.equiv</filename> file. This file contains a list of host-user combinations,
rather than hosts in general. If a host-user combination is listed in this
file, the specified user is granted permission to log in remotely from the
specified host without having to supply a password.</para><para>Note that a <filename>.rhosts</filename> file must reside at the
top level of a user's home directory. <filename>.rhost</filename> files that
are located in subdirectories are not consulted.   </para><para>Users can create <filename>.rhosts</filename> files in their home directories.
Using the <filename>.rhosts</filename> file is another way to allow trusted
access between users' own accounts on different systems without using the <filename>/etc/hosts.equiv</filename> file. </para><sect4 id="remotehowtoaccess-2"><title>Security Risks When Using the  <filename>.rhosts</filename> File</title><para>Unfortunately, the <filename>.rhosts</filename> file presents
a major security problem. While the <filename>/etc/hosts.equiv</filename> file
is under the system administrator's control and can be managed effectively,
any user can create a <filename>.rhosts</filename> file that grants access
to whomever the user chooses without the system administrator's knowledge.
 </para><para>In a situation in which all of the users' home directories are on a
single server and only certain people have superuser access on that server,
a good way to prevent a user from using a <filename>.rhosts</filename> file
is to create an empty file as superuser in their home directory. You would
then change the permissions in this file to 000 so that it would be difficult
to change it, even as superuser. This change would effectively prevent a user
from risking system security by using a <filename>.rhosts</filename> file
irresponsibly. The change would not, however, solve anything if the user is
able to change the effective path to his or her home directory.</para><para>The only secure way to manage <filename>.rhosts</filename> files
is to completely disallow them. See <olink targetptr="remotehowtoaccess-12733" remap="internal">How
to Search for and Remove .rhosts Files</olink> for detailed instructions.
As system administrator, you can check the system often for violations of
this policy. One possible exception to this policy is for the root account;
you might need to have a <filename>.rhosts</filename> file to perform network
backups and other remote services.            </para>
</sect4>
</sect3>
</sect2><sect2 id="remotehowtoaccess-4"><title>Linking Remote Logins</title><para>If your system is configured properly, you can link remote logins.
 For example, a user on <filename>earth</filename> logs in to <filename>jupiter</filename>,
and from there decides to log in to <filename>pluto</filename>.  </para><para>The user could have logged out of <filename>jupiter</filename> and then
logged in directly to <filename>pluto</filename>, but this type of linking
can be more convenient.  </para><para>To link remote logins without having to supply a password, you must
have the <filename>/etc/hosts.equiv</filename> or <filename>.rhosts</filename> file
set up correctly. </para>
</sect2><sect2 id="remotehowtoaccess-5"><title>Direct or Indirect Remote Logins</title><para>The <command>rlogin</command> command allows you to log in to
a remote system directly or indirectly.      </para><para>A direct remote login is attempted with the default user name, that
is, the user name of the individual who is currently logged in to the local
system. This is the most common form of remote login. </para><para>An indirect remote login is attempted with a different user name, which
is supplied during the remote login operation.   This is the type of remote
login you might attempt from a workstation that you borrowed temporarily.
For instance, if you were in a coworker's office and needed to examine files
in your home directory, you might log in to your system remotely, from your
coworker's system. However, you would perform an indirect remote login, supplying
your own user name. </para><para>The dependencies between direct and indirect logins and authentication
methods are summarized in the following table.          </para><table frame="topbot" id="remotehowtoaccess-87699"><title>Dependencies Between
Login Method and Authentication Method (<command>rlogin</command>)</title><tgroup cols="4" colsep="0" rowsep="0"><colspec colname="column1" colwidth="80*"/><colspec colname="column2" colwidth="100*"/><colspec colname="column3" colwidth="138*"/><colspec colname="column4" colwidth="78*"/><thead><row rowsep="1"><entry><para>Type of Login</para>
</entry><entry><para>User Name Supplied By</para>
</entry><entry><para>Authentication</para>
</entry><entry><para>Password</para>
</entry>
</row>
</thead><tbody><row><entry><para>Direct</para>
</entry><entry><para>System</para>
</entry><entry><para>Network</para>
</entry><entry><para>None</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para></para>
</entry><entry><para>System</para>
</entry><entry><para>Required</para>
</entry>
</row><row><entry><para>Indirect</para>
</entry><entry><para>User</para>
</entry><entry><para>Network</para>
</entry><entry><para>None</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para></para>
</entry><entry><para>System</para>
</entry><entry><para>Required </para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="remotehowtoaccess-37094"><title>What Happens After You Log In Remotely</title><para>When you log in to a remote system, the <command>rlogin</command> command
attempts to find your home directory. If the <command>rlogin</command> command
can't find your home directory, it assigns you to the remote system's root
(<filename>/</filename>) directory. For example:</para><screen>Unable to find home directory, logging in with / </screen><para>However, if the <command>rlogin</command> command finds your home directory,
it sources both your <filename>.cshrc</filename> and <filename>.login</filename> files.
Therefore, after a remote login, your prompt is your standard login prompt,
and the current directory is the same as when you log in locally. </para><para>For example, if your usual prompt displays your system name and working
directory, and when you log in, your working directory is your home directory,
your login prompt resembles the following:</para><screen>earth(/home/smith):</screen><para>Then when you log in to a remote system, you see a similar prompt and
your working directory is your home directory, regardless of the directory
from which you entered the <command>rlogin</command> command: </para><screen>earth(/home/smith): <userinput>rlogin pluto</userinput>
.
.
.
pluto(/home/smith):</screen><para>The only difference is that the name of the remote system would substitute
for your local system at the beginning of the prompt. The remote file system
is parallel to your home directory.</para><para>Effectively, if you change directory to <filename>/home</filename> and
then run <command>ls</command>, you see the following:   </para><screen>earth(home/smith): <userinput>cd ..</userinput>
earth(/home): <userinput>ls</userinput>
smith  jones</screen>
</sect2><task id="remotehowtoaccess-12733"><title>How to Search for and Remove <filename>.rhosts</filename> Files</title><procedure>&rolestepA;<step id="remotehowtoaccess-step-9"><para>Search for and remove <filename>.rhosts</filename> files by using the <olink targetdoc="refman1" targetptr="find-1" remap="external"><citerefentry><refentrytitle>find</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> command.</para><screen># <userinput>find</userinput> <replaceable>home-directories</replaceable> <userinput>-name .rhosts -print -exec rm {} \;</userinput></screen><variablelist><varlistentry><term><replaceable>home-directories</replaceable></term><listitem><para>Identifies the path to a directory where users' home directories
are located. Note that you can enter multiple paths to search more than one
home directory at a time.</para>
</listitem>
</varlistentry><varlistentry><term><option>name .rhosts</option></term><listitem><para>Identifies the file name.</para>
</listitem>
</varlistentry><varlistentry><term><option>print</option></term><listitem><para>Prints the current path name.</para>
</listitem>
</varlistentry><varlistentry><term><option>exec rm {} \;</option></term><listitem><para>Tells the <command>find</command> command to apply the <command>rm</command> command to all files that are identified by using the matching
file name.</para>
</listitem>
</varlistentry>
</variablelist><para>The <command>find</command> command starts at the designated directory
and searches for any file that is named <filename>.rhosts</filename>. If it
finds such as file, <command>find</command> prints the path on the screen
and removes it.</para>
</step>
</procedure><example><title>Searching for and Removing <command>.rhosts</command> Files</title><para>The following example searches and removes <filename>.rhosts</filename> files
in all the user's home directories that are located in the <filename>/export/home</filename> directory. </para><screen># <userinput>find /export/home -name .rhosts -print | xargs -i -t rm {} \;</userinput></screen>
</example>
</task><sect2 id="remotehowtoaccess-20760"><title>How to Find Out If a Remote System
Is Operating</title><para>Find out if a remote system is operating by using the <command>ping</command> command.
    </para><screen>$ <userinput>ping</userinput> <replaceable>system-name</replaceable> | <replaceable>ip-address</replaceable></screen><variablelist><varlistentry><term><replaceable>system-name</replaceable></term><listitem><para>The name of the remote system</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>ip-address</replaceable></term><listitem><para>The IP address of the remote system</para>
</listitem>
</varlistentry>
</variablelist><para>The <command>ping</command> command returns one of three messages: 
  </para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="198*"/><colspec colname="column2" colwidth="198*"/><thead><row rowsep="1"><entry><para>Status Message</para>
</entry><entry><para>Explanation</para>
</entry>
</row>
</thead><tbody><row><entry><para><emphasis>system-name</emphasis> <filename>is alive</filename></para>
</entry><entry><para>The system can be accessed over the network.</para>
</entry>
</row><row><entry><para><literal>ping: unknown host</literal> <emphasis>system-name</emphasis></para>
</entry><entry><para>The system name is unknown.</para>
</entry>
</row><row><entry><para><literal>ping: no answer from</literal> <replaceable>system-name</replaceable> </para>
</entry><entry><para>The system is known, but is not currently operating. </para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>If the system you &ldquo;ping&rdquo; is located in a different domain,
the return message can also contain routing information, which you can ignore.</para><para>The <command>ping</command> command has a timeout of 20 seconds. Effectively,
if it does not receive a response within 20 seconds, it returns the third
message. You can force <command>ping</command> to wait longer (or less) by
typing a <emphasis>time-out</emphasis> value, in seconds:</para><screen>$ <userinput>ping</userinput> <replaceable>system-name</replaceable> | <replaceable>ip-address time-out</replaceable></screen><para>For more information, see <olink targetdoc="refman1m" targetptr="ping-1m" remap="external"><citerefentry><refentrytitle>ping</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>. </para>
</sect2><sect2 id="remotehowtoaccess-37282"><title>How to Find Who Is Logged In to
a Remote System</title><para>Find who is logged in to a remote system by using the <olink targetdoc="refman1" targetptr="rusers-1" remap="external"><citerefentry><refentrytitle>rusers</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> command.        </para><screen>$ <userinput>rusers</userinput> [<userinput>-l</userinput>] <replaceable>remote-system-name</replaceable></screen><variablelist><varlistentry><term><filename>rusers</filename></term><listitem><para>(No options) Displays the name of the system, followed by
the name of users who are currently logged in to it, including root</para>
</listitem>
</varlistentry><varlistentry><term><option>l</option></term><listitem><para>Displays additional information about each user: the user's
login window, login time and date, amount of time logged in, and the name
of the remote system from which the user logged on </para>
</listitem>
</varlistentry>
</variablelist><example id="egcpk"><title>Finding Who Is Logged In to a Remote System</title><para>The following example shows the short output of <command>rusers</command>.</para><screen>$ <userinput>rusers pluto</userinput>
pluto    smith  jones</screen><para>In the following example, the long version of <command>rusers</command> shows
that two users are logged in to the remote system <literal>starbug</literal>.
The first user logged in from the system console on September 10 and has been
logged on for 137 hours and 15 minutes. The second user logged in from a remote
system, <literal>mars</literal>, on September 14.</para><screen>$<userinput>rusers -l starbug</userinput>
root         starbug:console           Sep 10 16:13  137:15
rimmer       starbug:pts/0             Sep 14 14:37         (mars)</screen>
</example>
</sect2><sect2 id="remotehowtoaccess-40964"><title>How to Log In to a Remote System
(<command>rlogin</command>)</title><para>Log in to a remote system by using the <olink targetdoc="refman1" targetptr="rlogin-1" remap="external"><citerefentry><refentrytitle>rlogin</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> command.    </para><screen>$ <userinput>rlogin</userinput> [<userinput>-l</userinput> <replaceable>user-name</replaceable>] <replaceable>system-name</replaceable></screen><variablelist><varlistentry><term><filename>rlogin</filename></term><listitem><para>(No options) Logs you in to the remote system <emphasis>directly</emphasis>,
effectively, with your current user name</para>
</listitem>
</varlistentry><varlistentry><term><option>l</option> <replaceable>user-name</replaceable></term><listitem><para>Logs you into the remote system <emphasis>indirectly</emphasis>,
effectively, with the user name you supply</para>
</listitem>
</varlistentry>
</variablelist><para>If the network attempts to authenticate you, you are not prompted
for a password. If the remote system attempts to authenticate you, you are
asked to provide a password.  </para><para>If the operation succeeds, the <command>rlogin</command> command displays
brief information about your latest remote login to that system, the version
of the operating system that is running on the remote system, and whether
you have mail waiting for you in your home directory. </para><example id="remotehowtoaccess-12"><title>Logging In to a Remote System (<command>rlogin</command>)</title><para>The following example shows the output of a direct remote login to <literal>pluto</literal>. The user has been authenticated by the network.     </para><screen>$ <userinput>rlogin starbug</userinput>
Last login: Mon Jul 12 09:28:39 from venus
Sun Microsystems Inc.   SunOS 5.8       February 2000
starbug:</screen><para>The following example shows the output of an indirect remote login
to <literal>pluto</literal>, with the user being authenticated by the remote
system.    </para><screen>$ <userinput>rlogin -l smith pluto</userinput>
password: <replaceable>user-password</replaceable>
Last login: Mon Jul 12 11:51:58 from venus
Sun Microsystems Inc.   SunOS 5.8       February 2000
starbug: </screen>
</example>
</sect2><sect2 id="remotehowtoaccess-94997"><title>How to Log Out From a Remote System
(<command>exit</command>)</title><para>Log out from a remote system by using the <olink targetdoc="refman1" targetptr="exit-1" remap="external"><citerefentry><refentrytitle>exit</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> command.  </para><screen>$ <userinput>exit</userinput>
 </screen><example id="remotehowtoaccess-13"><title>Logging Out From a Remote System
(<command>exit</command>)</title><para>This example shows the user <literal>smith</literal> logging out
from the system <literal>pluto</literal>.  </para><screen>$ <userinput>exit</userinput>
pluto% logout
Connection closed.
earth% </screen>
</example>
</sect2>
</sect1><sect1 id="remotehowtoaccess-14"><title>Logging In to a Remote System (<command>ftp</command>)</title><para>The <command>ftp</command> command opens the user interface to the Internet's
File Transfer Protocol. This user interface, called the command interpreter,
enables you to log in to a remote system and perform a variety of operations
with its file system. The principal operations are summarized in the following
table. </para><para>The main benefit of <command>ftp</command> over <command>rlogin</command> and <command>rcp</command> is that <command>ftp</command> does not require the remote system
to be running UNIX. The remote system does, however, need to be configured
for TCP/IP communications. However, <command>rlogin</command> provides access
to a richer set of file manipulation commands than <command>ftp</command> provides.
  </para><sect2 id="remotehowtoaccess-28951"><title>Authentication for Remote Logins
(<command>ftp</command>)</title><itemizedlist><para>Authentication for <command>ftp</command> remote login operations
can be established by one of the following methods:</para><listitem override="bullet"><para>Including your password entry in the remote system's <command>/etc/passwd</command> file or equivalent network information service map or table  </para>
</listitem><listitem override="bullet"><para>Establishing an anonymous <command>ftp</command> account on the
remote system  </para>
</listitem>
</itemizedlist>
</sect2><sect2 id="remotehowtoaccess-15"><title>Essential <command>ftp</command> Commands</title><table frame="topbot" id="remotehowtoaccess-tbl-16"><title>Essential <command>ftp</command> Commands</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="118*"/><colspec colname="column2" colwidth="278*"/><thead><row rowsep="1"><entry><para>Command</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>ftp</command> </para>
</entry><entry><para>Accesses the <command>ftp</command> command interpreter.</para>
</entry>
</row><row><entry><para><command>ftp</command> <replaceable>remote-system</replaceable></para>
</entry><entry><para>Establishes an <command>ftp</command> connection to a remote system.
For instructions, see <olink targetptr="remotehowtoaccess-40629" remap="internal">How to Open
an ftp Connection to a Remote System</olink>.</para>
</entry>
</row><row><entry><para><command>open</command> </para>
</entry><entry><para>Logs in to the remote system from the command interpreter.</para>
</entry>
</row><row><entry><para><command>close</command> </para>
</entry><entry><para>Logs out of the remote system and returns to the command interpreter.</para>
</entry>
</row><row><entry><para><command>bye</command> </para>
</entry><entry><para>Quits the <command>ftp</command> command interpreter.</para>
</entry>
</row><row><entry><para><command>help</command> </para>
</entry><entry><para>Lists all <command>ftp</command> commands or, if a command name is supplied,
briefly describes what the command does.</para>
</entry>
</row><row><entry><para><command>reset</command> </para>
</entry><entry><para>Re-synchronizes the command-reply sequencing with the remote <command>ftp</command> server.</para>
</entry>
</row><row><entry><para><command>ls</command> </para>
</entry><entry><para>Lists the contents of the remote working directory.</para>
</entry>
</row><row><entry><para><command>pwd</command> </para>
</entry><entry><para>Displays the name of the remote working directory.</para>
</entry>
</row><row><entry><para><command>cd</command></para>
</entry><entry><para>Changes the remote working directory.</para>
</entry>
</row><row><entry><para><command>lcd</command> </para>
</entry><entry><para>Changes the local working directory.</para>
</entry>
</row><row><entry><para><command>mkdir</command> </para>
</entry><entry><para>Creates a directory on the remote system.</para>
</entry>
</row><row><entry><para><command>rmdir</command> </para>
</entry><entry><para>Deletes a directory on the remote system.</para>
</entry>
</row><row><entry><para><command>get, mget</command> </para>
</entry><entry><para>Copies a file (or multiple files) from the remote working directory
to the local working directory.</para>
</entry>
</row><row><entry><para><command>put, mput</command> </para>
</entry><entry><para>Copies a file (or multiple files) from the local working directory to
the remote working directory.</para>
</entry>
</row><row><entry><para><command>delete, mdelete</command> </para>
</entry><entry><para>Deletes a file (or multiple files) from the remote working directory.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For more information, see <olink targetdoc="refman1" targetptr="ftp-1" remap="external"><citerefentry><refentrytitle>ftp</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>.</para>
</sect2><task id="remotehowtoaccess-40629"><title>How to Open an <command>ftp</command> Connection
to a Remote System</title><procedure><step id="remotehowtoaccess-step-18"><para>Ensure that you have <command>ftp</command> authentication.  
   </para><para>You must have <command>ftp</command> authentication, as described
in <olink targetptr="remotehowtoaccess-28951" remap="internal">Authentication for Remote Logins
(ftp)</olink>.</para>
</step><step id="remotehowtoaccess-step-19"><para>Open a connection to a remote system
by using the <command>ftp</command> command. </para><screen>$ <userinput>ftp</userinput> <replaceable>remote-system</replaceable></screen><para>If the connection succeeds, a confirmation message and prompt are displayed. </para>
</step><step id="remotehowtoaccess-step-20"><para>Type your user name.</para><screen>Name (<replaceable>remote-system</replaceable>:<replaceable>user-name</replaceable>): <replaceable>user-name</replaceable></screen>
</step><step id="remotehowtoaccess-step-21"><para>If prompted, type your password. </para><screen>331 Password required for <replaceable>user-name</replaceable>:
Password: <replaceable>password</replaceable></screen><para>If the system you are accessing has an established anonymous <command>ftp</command> account, you are prompted for an email address for the password.
If the <command>ftp</command> interface accepts your password, it displays
a confirmation message and the (<literal>ftp></literal>) prompt.  </para><para>You
can now use any of the commands that are supplied by the <command>ftp</command> interface,
including help. The principal commands are summarized in <olink targetptr="remotehowtoaccess-tbl-16" remap="internal">Table 29&ndash;3</olink>.   </para>
</step>
</procedure><example><title>Opening an <command>ftp</command> Connection to a Remote System</title><para>This <command>ftp</command> session was established by the user <literal>smith</literal> on the remote system <literal>pluto</literal>:      </para><screen>$ <userinput>ftp pluto</userinput>
Connected to pluto.
220 pluto FTP server ready.
Name (pluto:smith): <userinput>smith</userinput>
331 Password required for <filename>smith</filename>:
Password: <replaceable>password</replaceable>
230 User smith logged in.
ftp></screen>
</example>
</task><sect2 id="remotehowtoaccess-47049"><title>How to Close an <command>ftp</command> Connection
to a Remote System</title><para>Close an <command>ftp</command> connection to a remote system
by using the <command>bye</command> command.   </para><screen>ftp> <userinput>bye</userinput>
221-You have  transferred 0 bytes in 0 files.
221-Total traffic for this sessions was 172 bytes in 0 transfers.
221-Thanks you for using the FTP service on spdev.
221 Goodbye.</screen><para>A goodbye message appears, followed by your usual shell prompt.
 </para>
</sect2><task id="remotehowtoaccess-87541"><title>How to Copy Files From a Remote
System (<command>ftp</command>)</title><procedure><step id="remotehowtoaccess-step-24"><para>Change to a directory on the local
system where you want the files from the remote system to be copied.</para><screen>$ <userinput>cd</userinput> <replaceable>target-directory</replaceable></screen>
</step><step id="remotehowtoaccess-step-25"><para>Establish an <command>ftp</command> connection.  </para><para>See <olink targetptr="remotehowtoaccess-40629" remap="internal">How to Open an ftp Connection to a Remote
System</olink>.</para>
</step><step id="remotehowtoaccess-step-26"><para>Change to the source directory.</para><screen>ftp> <userinput>cd</userinput> <replaceable>source-directory</replaceable></screen><para>If your system is using the automounter, the home directory of the remote
system's user appears parallel to yours, under <filename>/home</filename>.</para>
</step><step id="remotehowtoaccess-step-27"><para>Ensure that you have read permission
for the source files. </para><screen>ftp> <userinput>ls -l</userinput></screen>
</step><step id="remotehowtoaccess-step-27a"><para>Set the transfer type to <literal>binary</literal>. </para><screen>ftp> <userinput>binary</userinput></screen>
</step><step id="remotehowtoaccess-step-28"><para>To copy a single file, use the <command>get</command> command. </para><screen>ftp> <userinput>get</userinput> <replaceable>filename</replaceable> </screen>
</step><step id="remotehowtoaccess-step-29"><para>To copy multiple files at once,
use the <command>mget</command> command. </para><screen>ftp> <userinput>mget</userinput> <replaceable>filename</replaceable> [<replaceable>filename</replaceable> ...]</screen><para>You can supply a series of individual file names and you can use wildcard
characters. The <command>mget</command> command copies each file individually,
asking you for confirmation each time. </para>
</step><step id="remotehowtoaccess-step-30"><para>Close the <command>ftp</command> connections.
  </para><screen>ftp> <userinput>bye</userinput></screen>
</step>
</procedure><example><title>Copying Files From a Remote System (<command>ftp</command>)</title><para>In this example, the user <literal>kryten</literal> opens an <command>ftp</command> connection to the system <literal>pluto</literal>, and uses
the <command>get</command> command to copy a single file from the <filename>/tmp</filename> directory. </para><screen>$ <userinput>cd $HOME</userinput>
<userinput>ftp pluto</userinput>
Connected to pluto.
220 pluto FTP server (SunOS 5.8) ready.
Name (pluto:kryten): <userinput>kryten</userinput>
331 Password required for kryten.
Password: <userinput>xxx</userinput>
230 User kryten logged in.
ftp> <userinput>cd /tmp</userinput>
250 CWD command successful.
ftp> <userinput>ls</userinput>
200 PORT command successful.
150 ASCII data connection for /bin/ls (129.152.221.238,34344) 
(0 bytes).
dtdbcache_:0
filea
files
ps_data
speckeysd.lock
226 ASCII Transfer complete.
53 bytes received in 0.022 seconds (2.39 Kbytes/s)
ftp> <userinput>get filea</userinput>
200 PORT command successful.
150 ASCII data connection for filea (129.152.221.238,34331) 
(0 bytes).
221 Goodbye.</screen><para>In this example, the same user <literal>kryten</literal> uses
the <command>mget</command> command to copy a set of files from the <filename>/tmp</filename> directory to his home directory. Note that <literal>kryten</literal> can
accept or reject individual files in the set.</para><screen>$ ftp> <userinput>cd /tmp</userinput>
250 CWD command successful.
ftp> <userinput>ls files</userinput>
200 PORT command successful.
150 ASCII data connection for /bin/ls (129.152.221.238,34345) 
(0 bytes).
fileb
filec
filed
remote: files
21 bytes received in 0.015 seconds (1.36 Kbytes/s)
ftp> <userinput>cd files</userinput>
250 CWD command successful.
ftp> <userinput>mget file*</userinput>
mget fileb? <userinput>y</userinput>
200 PORT command successful.
150 ASCII data connection for fileb (129.152.221.238,34347) 
(0 bytes).
226 ASCII Transfer complete.
mget filec? <userinput>y</userinput>
200 PORT command successful.
150 ASCII data connection for filec (129.152.221.238,34348) 
(0 bytes).
226 ASCII Transfer complete.
mget filed? <userinput>y</userinput>
200 PORT command successful.
150 ASCII data connection for filed (129.152.221.238,34351) 
(0 bytes).
226 ASCII Transfer complete.200 PORT command successful.
ftp> <userinput>bye</userinput>
221 Goodbye.</screen>
</example>
</task><task id="remotehowtoaccess-60496"><title>How to Copy Files to a Remote System
(<command>ftp</command>)</title><procedure><step id="remotehowtoaccess-step-33"><para>Change to the source directory on the local system.  </para><para>The
directory from which you type the <command>ftp</command> command is the local
working directory, and thus the source directory for this operation.</para>
</step><step id="remotehowtoaccess-step-34"><para>Establish an <command>ftp</command> connection.</para><para>See <olink targetptr="remotehowtoaccess-40629" remap="internal">How to Open an
ftp Connection to a Remote System</olink>.</para>
</step><step id="remotehowtoaccess-step-35"><para>Change to the target directory.</para><screen>ftp> <userinput>cd</userinput> <replaceable>target-directory</replaceable></screen><para>Remember, if your system is using the automounter, the home directory
of the remote system's user appears parallel to yours, under <filename>/home</filename>.</para>
</step><step id="remotehowtoaccess-step-36"><para>Ensure that you have write permission
to the target directory.  </para><screen>ftp> <userinput>ls -l</userinput> <replaceable>target-directory</replaceable></screen>
</step><step id="remotehowtoaccess-step-36a"><para>Set the transfer type to binary.</para><screen>ftp> <userinput>binary</userinput></screen>
</step><step id="remotehowtoaccess-step-37"><para>To copy a single file, use the <command>put</command> command. </para><screen>ftp> <userinput>put</userinput> <replaceable>filename</replaceable></screen>
</step><step id="remotehowtoaccess-step-38"><para>To copy multiple files at once,
use the <command>mput</command> command. </para><screen>ftp> <userinput>mput</userinput> <replaceable>filename</replaceable> [<replaceable>filename</replaceable> ...]</screen><para>You can supply a series of individual file names and you can use wildcard
characters. The <command>mput</command> command copies each file individually,
asking you for confirmation each time. </para>
</step><step id="remotehowtoaccess-step-39"><para>To close the <command>ftp</command> connection,
type <command>bye</command>.   </para><screen>ftp> <userinput>bye</userinput></screen>
</step>
</procedure><example><title>Copying Files to a Remote System (<command>ftp</command>)</title><para>In this example, the user <literal>kryten</literal> opens an <command>ftp</command> connection to the system <literal>pluto</literal>, and uses
the <command>put</command> command to copy a file from his or her system to
the <filename>/tmp</filename> directory on system <literal>pluto</literal>. </para><screen>$ <userinput>cd /tmp</userinput>
<userinput>ftp pluto</userinput>
Connected to pluto.
220 pluto FTP server (SunOS 5.8) ready.
Name (pluto:kryten): <userinput>kryten</userinput>
331 Password required for kryten.
Password: <userinput>xxx</userinput>
230 User kryten logged in.
ftp> <userinput>cd /tmp</userinput>
250 CWD command successful.
ftp> <userinput>put filef</userinput>
200 PORT command successful.
150 ASCII data connection for filef (129.152.221.238,34356).
226 Transfer complete.
ftp> <userinput>ls</userinput>
200 PORT command successful.
150 ASCII data connection for /bin/ls (129.152.221.238,34357) (0 bytes).
dtdbcache_:0
filea
filef
files
ps_data
speckeysd.lock
226 ASCII Transfer complete.
60 bytes received in 0.058 seconds (1.01 Kbytes/s)
ftp> <userinput>bye</userinput>
221 Goodbye.</screen><para>In this example, the same user <literal>kryten</literal> uses
the <command>mput</command> command to copy a set of files from his or her
home directory to <literal>pluto</literal>'s <filename>/tmp</filename> directory.
Note that <literal>kryten</literal> can accept or reject individual files
in the set. </para><screen>$ <userinput>cd $HOME/testdir</userinput>
$ <userinput>ls</userinput>
test1   test2   test3
$ <userinput>ftp pluto</userinput>
Connected to pluto.
220 pluto FTP server (SunOS 5.8) ready.
Name (pluto:kryten): <userinput>kryten</userinput>
331 Password required for kryten.
Password: <userinput>xxx</userinput>
230 User kryten logged in.
ftp> <userinput>cd /tmp</userinput>
250 CWD command successful.
ftp> <userinput>mput test*</userinput>
mput test1? <userinput>y</userinput>
200 PORT command successful.
150 ASCII data connection for test1 (129.152.221.238,34365).
226 Transfer complete.
mput test2? <userinput>y</userinput>
200 PORT command successful.
150 ASCII data connection for test2 (129.152.221.238,34366).
226 Transfer complete.
mput test3? <userinput>y</userinput>
200 PORT command successful.
150 ASCII data connection for filef (129.152.221.238,34356).
226 Transfer complete.
ftp> <userinput>bye</userinput>
221 Goodbye.</screen>
</example>
</task>
</sect1><sect1 id="remotehowtoaccess-55154"><title>Remote Copying With <command>rcp</command></title><para>The <command>rcp</command> command copies files or directories
between a local and a remote system or between two remote systems. You can
use this command from a remote system (after logging in with the <command>rlogin</command> command)
or from the local system (without logging in to a remote system). </para><itemizedlist><para>With <command>rcp</command>, you can perform the following remote
copy operations:</para><listitem override="bullet"><para>Copy a file or directory from your system
to a remote system</para>
</listitem><listitem override="bullet"><para>Copy a file or directory from a remote system
to your local system</para>
</listitem><listitem override="bullet"><para>Copy a file or directory between remote
systems from your local system</para>
</listitem>
</itemizedlist><para>If you have the automounter running, you can perform these remote operations
with the <command>cp</command> command. However, the range of <command>cp</command> is
constrained to the virtual file system that is created by the automounter
and to operations relative to a user's home directory. Because <command>rcp</command> performs
the same operations without these constraints, this section describes only
the <command>rcp</command> versions of these tasks. </para><sect2 id="remotehowtoaccess-87896"><title>Security Considerations for Copy
Operations</title><para>To copy files or directories between systems, you must have permission
to log in and copy files.  </para><caution><para>Both the <command>cp</command> and <command>rcp</command> commands
can overwrite files without warning. Ensure that file names are correct before
executing the command.</para>
</caution>
</sect2><sect2 id="remotehowtoaccess-41"><title>Specifying Source and Target</title><para>With the <command>rcp</command> command in the C shell, you can
specify source (the file or directory you want to copy) and target (the location
into which you will copy the file or directory) with either absolute or abbreviated
path names.         </para><informaltable frame="all"><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="81*"/><colspec colname="column2" colwidth="156*"/><colspec colwidth="159*"/><thead><row><entry><para></para>
</entry><entry><para>Absolute Path Names</para>
</entry><entry><para>Abbreviated Path Names</para>
</entry>
</row>
</thead><tbody><row><entry><para>From Local System</para>
</entry><entry><para><filename>mars:/home/jones/myfile.txt</filename></para>
</entry><entry><para><filename>~jones/myfile.txt</filename></para>
</entry>
</row><row><entry><para>After Remote Login</para>
</entry><entry><para><filename>/home/jones/myfile.txt</filename></para>
</entry><entry><para><filename>~jones/myfile.txt</filename></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>Absolute path names identify files or directories that are mounted on
a particular system. In the previous example, the first absolute path name
identifies a file (<filename>myfile.txt</filename>) on the <literal>mars</literal> system.
Abbreviated path names identify files or directories relative to a user's
home directory, wherever it might reside. In the previous first example, the
abbreviated path name identifies the same file, <filename>myfile.txt</filename>,
but uses &ldquo;~&rdquo; symbol to indicate the <filename>jones</filename> home
directory: </para><para><filename>~  =  mars:/home/jones</filename>   </para><para>The examples on the second line demonstrate the user of absolute and
abbreviated path names after a remote login. No difference is evident for
the abbreviated path name. However, because the remote login operation mounted
the <filename>jones</filename> home directory onto the local system (parallel
to the local user's home directory), the absolute path name no longer requires
the system name <literal>mars</literal>. For more information about how a
remote login operation mounts another user's home directory, see <olink targetptr="remotehowtoaccess-37094" remap="internal">What Happens After You Log In Remotely</olink>.</para><itemizedlist><para>The following table provides a sample of absolute and abbreviated path
names that are recognized by the C shell. The sample uses the following terminology:</para><listitem override="bullet"><para>Working directory &ndash; The directory from which the <command>rcp</command> command
is entered. Can be remote or local. </para>
</listitem><listitem override="bullet"><para>Current user &ndash; The user name under which the <command>rcp</command> command
is entered.</para>
</listitem>
</itemizedlist><table frame="topbot" id="remotehowtoaccess-tbl-42"><title>Allowed Syntaxes
for Directory and File Names</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="67*"/><colspec colname="column2" colwidth="133*"/><colspec colname="column3" colwidth="196*"/><thead><row rowsep="1"><entry><para>Logged in to</para>
</entry><entry><para>Syntax</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Local system </para>
</entry><entry><para><literal>.</literal></para>
</entry><entry><para>The local working directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> in
the local working directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><literal>~</literal></para>
</entry><entry><para>The current user's home directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>~/path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> beneath
the current user's home directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>~user</replaceable></para>
</entry><entry><para>The home directory of <replaceable>user</replaceable></para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>~user/path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> beneath
the home directory of <emphasis>user</emphasis></para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>remote-system:path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> in
the remote working directory</para>
</entry>
</row><row><entry><para>Remote system</para>
</entry><entry><para><literal>.</literal></para>
</entry><entry><para>The remote working directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>filename</replaceable></para>
</entry><entry><para>The <replaceable>filename</replaceable> in the remote working directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> in
the remote working directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><literal>~</literal></para>
</entry><entry><para>The current user's home directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>~/path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> in
the current user's home directory</para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>~user</replaceable></para>
</entry><entry><para>The home directory of <replaceable>user</replaceable></para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>~/user/path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> beneath
the home directory of <replaceable>user</replaceable></para>
</entry>
</row><row><entry><para></para>
</entry><entry><para><replaceable>local-system:path/filename</replaceable></para>
</entry><entry><para>The <replaceable>path</replaceable> and <replaceable>filename</replaceable> in
the local working directory </para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><task id="remotehowtoaccess-46771"><title>How to Copy Files Between a Local
and a Remote System (<command>rcp</command>)</title><procedure><step id="remotehowtoaccess-step-44"><para>Ensure that you have permission to copy.  </para><para>You should
at least have read permission on the source system and write permission on
the target system.</para>
</step><step id="remotehowtoaccess-step-45"><para>Determine the location of the source
and target.</para><para>If you don't know the path of the source or target, you can first
log in to the remote system with the <command>rlogin</command> command, as
described in <olink targetptr="remotehowtoaccess-40964" remap="internal">How to Log In to a
Remote System (rlogin)</olink>. Then, navigate through the remote system until
you find the location. You can then perform the next step without logging
out. </para>
</step><step id="remotehowtoaccess-step-46"><para>Copy the file or directory.   </para><screen>$ <userinput>rcp</userinput> [<userinput>-r</userinput>] <replaceable>source-file|directory   target-file|directory</replaceable></screen><variablelist><varlistentry><term><command>rcp</command></term><listitem><para>(No options) Copies a single file from the source to the target. </para>
</listitem>
</varlistentry><varlistentry><term><option>r</option></term><listitem><para>Copies a directory from the source to the target.</para>
</listitem>
</varlistentry>
</variablelist><para>This syntax applies whether you are logged in to the remote system or
in to the local system. Only the path name of the file or directory changes,
as described in <olink targetptr="remotehowtoaccess-tbl-42" remap="internal">Table 29&ndash;4</olink> and
as illustrated in the following examples.</para><para>You can use the &ldquo;<literal>~</literal>&rdquo; and &ldquo;<literal>.</literal>&rdquo; characters to specify the path portions of the local file
or directory names. Note, however, that &ldquo;<literal>~</literal>&rdquo;
applies to the current user, not the remote system, and that &ldquo;<literal>.</literal>&rdquo;
applies to system you are logged in to. For explanations of these symbols,
see <olink targetptr="remotehowtoaccess-tbl-42" remap="internal">Table 29&ndash;4</olink>.
   </para>
</step>
</procedure><example><title>Using <command>rcp</command> to Copy a Remote File to a Local System</title><para>In this example, <command>rcp</command> is used to copy the file <filename>letter.doc</filename> from the <filename>/home/jones</filename> directory
of the remote system <literal>pluto</literal> to the working directory (<filename>/home/smith</filename>) on the local system, <literal>earth</literal>:</para><screen>earth(/home/smith): <userinput>rcp pluto:/home/jones/letter.doc .</userinput></screen><para>In this instance, the <command>rcp</command> operation is performed
without a remote login. Here, the &ldquo;<literal>.</literal>&rdquo; symbol
at the end of the command line refers to the local system, not the remote
system.</para><para>The target directory is the also local user's home directory, so it
can also be specified with the &ldquo;<literal>~</literal>&rdquo; symbol.</para>
</example><example><title>Using <command>rlogin</command> and <command>rcp</command> to Copy
a Remote File to a Local System</title><para>In this example, the <command>rcp</command> operation is run after the <command>rlogin</command> command is executed to copy a file from a remote to a local
system. Although the flow of the operation is the same as that of the previous
example, the paths change to allow for the remote login:</para><screen>earth(/home/smith): <userinput>rlogin pluto</userinput>
.
.
.
pluto(/home/jones): <userinput>rcp letter.doc ~</userinput></screen><para>Using the &ldquo;<literal>.</literal>&rdquo; symbol at the end of the
command line would be inappropriate in this instance. Because of the remote
login, the symbol would simply refer to the remote system; essentially
directing <command>rcp</command> to create a duplicate file. The &ldquo;<literal>~</literal>&rdquo; symbol, however, refers to the current user's home directory,
even when the login is to a remote system.</para>
</example><example><title>Using <command>rcp</command> to Copy a Local File to a Remote System</title><para>In this example, <command>rcp</command> is used to copy the file <filename>notice.doc</filename> from the home directory (<filename>/home/smith</filename>)
of the local system <literal>earth</literal> to the <filename>/home/jones</filename> directory
of the remote system, <literal>pluto</literal>:</para><screen>earth(/home/smith): <userinput>rcp notice.doc pluto:/home/jones</userinput></screen><para>Because no remote file name is provided, the file <filename>notice.doc</filename> is
copied into the <filename>/home/jones</filename> directory with the same name.</para><para>In this instance, the <command>rcp</command> operation from the previous
example is repeated, but <command>rcp</command> is entered from a different
working directory on the local system (<filename>/tmp</filename>). Note the
use of the &ldquo;<literal>~</literal>&rdquo; symbol to refer to the current
user's home directory:</para><screen>earth(/tmp): <userinput>rcp ~/notice.doc pluto:/home/jones</userinput></screen>
</example><example><title>Using <command>rlogin</command> and <command>rcp</command> to Copy
a Local File to a Remote System</title><para>In this example, the <command>rcp</command> operation is run after the <command>rlogin</command> command is executed to copy a local file to a remote directory.
Although the flow of the operation is the same as that of the previous example,
the paths change to allow for the remote login.</para><screen>earth(/home/smith): <userinput>rlogin pluto</userinput>
.
.
.
pluto(/home/jones): <userinput>rcp ~/notice.doc .</userinput></screen><para>In this instance, the &ldquo;<literal>~</literal>&rdquo; symbol
can be used to denote the current user's home directory, even though it is
on the local system. The &ldquo;<literal>.</literal>&rdquo; symbol refers
to the working directory on the remote system because the user is logged in
to the remote system. Here is an alternative syntax that performs the same
operation:         </para><screen>pluto(/home/jones): <userinput>rcp earth:/home/smith/notice.doc /home/jones</userinput></screen>
</example>
</task>
</sect1>
</chapter>