Remote Copy

The rcp command provides an alternative to ftp; it allows users to copy files over the network. The rcp command is the remote version of the Unix cp (copy) command. When using rcp, you do not need to supply a user ID or password. Some rudimentary security is provided by the fact that the name of your computer must reside in either of two server-based files named rhosts and hosts.equiv. The rcp command allows a user to copy files between a local computer and the host server or between two remote computers. The syntax for the rcp command is

rcp [hostname1]:filename1 [hostname2]:filename2

  • hostname1 Optionally indicates the hostname or Fully Qualified Domain Name (FQDN) of the source computer. Use this hostname if the source file is located on a remote computer. See Hour 11, “Name Resolution,” for more on hostnames and FQDNs.

  • filename1 Indicates the path and filename of the source file.

  • hostname2 Optionally indicates the hostname or FQDN of the destination computer. Use this hostname if the destination file is located on a remote computer.

  • filename2 Indicates the path and filename of the destination file.

The following are examples using the rcp command.

This example copies a file from the remote Unix computer to the local host:

rcp server3.corporate.earthquakes.txt earthquakes.txt

This example copies a file from the local host to a remote computer:

rcp earthquakes.txt server3.corporate.earthquakes.txt

You can also use rcp to copy a file from one remote host to another remote host. See Hour 15 for more on rcp and other remote access options.

The popularity of rcp has faded in recent years due to its security concerns. A new program known as scp performs the same functions as rcp but operates over an encrypted connection. Scp is part of the SSH program suite, which you’ll learn about in Hour 15.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.27.45